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

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

_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEED2Ev:
  569|  29.6M|      {
  570|  29.6M|         free_data();
  571|  29.6M|         free_index();
  572|  29.6M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9free_dataEv:
  266|  29.6M|      {
  267|  29.6M|         destroy_all();
  268|  29.6M|         ::operator delete(data_);
  269|  29.6M|         data_ = nullptr;
  270|  29.6M|         size_ = 0;
  271|  29.6M|         capacity_ = 0;
  272|  29.6M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11destroy_allEv:
  259|  38.2M|      {
  260|  57.7M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (260:31): [True: 19.5M, False: 38.2M]
  ------------------
  261|  19.5M|            std::destroy_at(data_ + i);
  262|  19.5M|         }
  263|  38.2M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10free_indexEv:
  308|  29.6M|      {
  309|  29.6M|         std::free(index_);
  310|  29.6M|         index_ = nullptr;
  311|  29.6M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2Ev:
  566|  17.2M|      ordered_small_map() = default;
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEaSEOS4_:
  628|  2.34k|      {
  629|  2.34k|         if (this != &other) {
  ------------------
  |  Branch (629:14): [True: 2.34k, False: 0]
  ------------------
  630|  2.34k|            free_data();
  631|  2.34k|            free_index();
  632|  2.34k|            data_ = other.data_;
  633|  2.34k|            size_ = other.size_;
  634|  2.34k|            capacity_ = other.capacity_;
  635|  2.34k|            index_ = other.index_;
  636|  2.34k|            other.data_ = nullptr;
  637|  2.34k|            other.size_ = 0;
  638|  2.34k|            other.capacity_ = 0;
  639|  2.34k|            other.index_ = nullptr;
  640|  2.34k|         }
  641|  2.34k|         return *this;
  642|  2.34k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2EOS4_:
  610|  12.3M|         : data_(other.data_), size_(other.size_), capacity_(other.capacity_), index_(other.index_)
  611|  12.3M|      {
  612|  12.3M|         other.data_ = nullptr;
  613|  12.3M|         other.size_ = 0;
  614|  12.3M|         other.capacity_ = 0;
  615|  12.3M|         other.index_ = nullptr;
  616|  12.3M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5emptyEv:
  662|  15.4M|      [[nodiscard]] bool empty() const noexcept { return size_ == 0; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5beginEv:
  645|  15.3M|      iterator begin() noexcept { return data_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE3endEv:
  649|  32.5M|      iterator end() noexcept { return data_ + size_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11linear_findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  421|  15.7M|      {
  422|  27.4M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (422:31): [True: 14.0M, False: 13.3M]
  ------------------
  423|  14.0M|            if (data_[i].first == key) return data_ + i;
  ------------------
  |  Branch (423:17): [True: 2.41M, False: 11.6M]
  ------------------
  424|  14.0M|         }
  425|  13.3M|         return data_ + size_;
  426|  15.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14grow_if_neededEv:
  217|  15.2M|      {
  218|  15.2M|         if (size_ == capacity_) {
  ------------------
  |  Branch (218:14): [True: 8.60M, False: 6.61M]
  ------------------
  219|  8.60M|            if (size_ == max_u32) {
  ------------------
  |  Branch (219:17): [True: 0, False: 8.60M]
  ------------------
  220|      0|               throw_capacity_overflow();
  221|      0|            }
  222|  8.60M|            const uint32_t new_cap = next_data_capacity(capacity_);
  223|  8.60M|            reallocate_data(new_cap);
  224|  8.60M|         }
  225|  15.2M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE18next_data_capacityEj:
  120|  8.60M|      {
  121|  8.60M|         if (current == 0) return 4;
  ------------------
  |  Branch (121:14): [True: 8.25M, False: 351k]
  ------------------
  122|   351k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (122:14): [True: 0, False: 351k]
  ------------------
  123|   351k|         return current * 2;
  124|   351k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15reallocate_dataEj:
  205|  8.60M|      {
  206|  8.60M|         if (new_cap < size_) {
  ------------------
  |  Branch (206:14): [True: 0, False: 8.60M]
  ------------------
  207|      0|            throw_capacity_overflow();
  208|      0|         }
  209|  8.60M|         auto* new_data = allocate_and_relocate(new_cap);
  210|  8.60M|         destroy_all();
  211|  8.60M|         ::operator delete(data_);
  212|  8.60M|         data_ = new_data;
  213|  8.60M|         capacity_ = new_cap;
  214|  8.60M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21allocate_and_relocateEj:
  159|  8.60M|      {
  160|  8.60M|         auto* new_data = static_cast<value_type*>(::operator new(checked_data_allocation_bytes(new_cap)));
  161|  8.60M|#if __cpp_exceptions
  162|  8.60M|         uint32_t constructed = 0;
  163|  8.60M|         try {
  164|  12.9M|            for (; constructed < size_; ++constructed) {
  ------------------
  |  Branch (164:20): [True: 4.32M, False: 8.60M]
  ------------------
  165|  4.32M|               std::construct_at(new_data + constructed, std::move_if_noexcept(data_[constructed]));
  166|  4.32M|            }
  167|  8.60M|         }
  168|  8.60M|         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|  8.60M|         return new_data;
  179|  8.60M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE29checked_data_allocation_bytesEj:
  134|  8.60M|      {
  135|  8.60M|         if (count > ((std::numeric_limits<size_t>::max)() / sizeof(value_type))) {
  ------------------
  |  Branch (135:14): [True: 0, False: 8.60M]
  ------------------
  136|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  137|      0|         }
  138|  8.60M|         return static_cast<size_t>(count) * sizeof(value_type);
  139|  8.60M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE8hash_keyENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
   97|  7.16M|      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|  3.03M|      {
  286|  3.03M|         const uint32_t a = h & bloom_mask;
  287|  3.03M|         const uint32_t b = (h >> 10) & bloom_mask;
  288|  3.03M|         return (index_->bloom[a >> 3] & (uint8_t(1) << (a & 7))) && (index_->bloom[b >> 3] & (uint8_t(1) << (b & 7)));
  ------------------
  |  Branch (288:17): [True: 1.54M, False: 1.49M]
  |  Branch (288:70): [True: 1.35M, False: 189k]
  ------------------
  289|  3.03M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17index_find_or_posINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS4_17index_find_resultERKT_j:
  400|  1.50M|      {
  401|  1.50M|         ensure_index();
  402|       |
  403|  1.50M|         const auto* base = index_entries();
  404|  1.50M|         const auto* idx_end = base + index_->size;
  405|  1.50M|         const auto* p = branchless_lower_bound(base, index_->size, h);
  406|  1.50M|         const size_t pos = static_cast<size_t>(p - base);
  407|       |
  408|       |         // Scan adjacent entries with matching hash
  409|  1.52M|         for (auto* scan = p; scan != idx_end && scan->key_hash == h; ++scan) {
  ------------------
  |  Branch (409:31): [True: 1.51M, False: 4.86k]
  |  Branch (409:50): [True: 1.22M, False: 290k]
  ------------------
  410|  1.22M|            if (data_[scan->index].first == key) {
  ------------------
  |  Branch (410:17): [True: 1.20M, False: 22.5k]
  ------------------
  411|  1.20M|               return {data_ + scan->index, pos, h};
  412|  1.20M|            }
  413|  1.22M|         }
  414|       |
  415|   295k|         return {data_ + size_, pos, h};
  416|  1.50M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE12ensure_indexEv:
  360|  1.50M|      {
  361|  1.50M|         if (size_ <= linear_search_threshold) return;
  ------------------
  |  Branch (361:14): [True: 0, False: 1.50M]
  ------------------
  362|  1.50M|         const auto current = index_size();
  363|  1.50M|         if (current == size_) return; // fully current
  ------------------
  |  Branch (363:14): [True: 1.02M, False: 477k]
  ------------------
  364|       |
  365|   477k|         if (current == 0 || (size_ - current) > linear_search_threshold) {
  ------------------
  |  Branch (365:14): [True: 64.1k, False: 412k]
  |  Branch (365:30): [True: 52.7k, False: 360k]
  ------------------
  366|   116k|            rebuild_index(); // full rebuild
  367|   116k|            return;
  368|   116k|         }
  369|       |
  370|       |         // Incrementally insert-sort the few new entries
  371|  1.22M|         for (uint32_t i = current; i < size_; ++i) {
  ------------------
  |  Branch (371:37): [True: 867k, False: 360k]
  ------------------
  372|   867k|            const hash_index_entry entry{hash_key(data_[i].first), i};
  373|   867k|            const auto* base = index_entries();
  374|   867k|            const auto* p = branchless_lower_bound(base, index_->size, entry.key_hash);
  375|   867k|            auto pos = static_cast<size_t>(p - base);
  376|       |
  377|   867k|            const uint32_t m = index_->size;
  378|   867k|            ensure_index_capacity(static_cast<size_type>(m) + 1);
  379|   867k|            auto* entries = index_entries();
  380|   867k|            if (pos < m) {
  ------------------
  |  Branch (380:17): [True: 833k, False: 33.5k]
  ------------------
  381|   833k|               std::memmove(entries + pos + 1, entries + pos, (m - pos) * sizeof(hash_index_entry));
  382|   833k|            }
  383|   867k|            entries[pos] = entry;
  384|   867k|            index_->size = i + 1;
  385|   867k|         }
  386|   360k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEv:
  343|   116k|      {
  344|   116k|         ensure_index_capacity(static_cast<size_type>(size_));
  345|   116k|         bloom_clear();
  346|   116k|         auto* entries = index_entries();
  347|  3.23M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (347:31): [True: 3.11M, False: 116k]
  ------------------
  348|  3.11M|            const uint32_t h = hash_key(data_[i].first);
  349|  3.11M|            entries[i] = {h, i};
  350|  3.11M|            bloom_set(h);
  351|  3.11M|         }
  352|   116k|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
  353|   116k|         index_->size = size_;
  354|   116k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11bloom_clearEv:
  291|   116k|      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|  19.5M|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE22branchless_lower_boundEPKNS4_16hash_index_entryEmj:
  440|  2.36M|      {
  441|  16.1M|         while (len > 1) {
  ------------------
  |  Branch (441:17): [True: 13.7M, False: 2.36M]
  ------------------
  442|  13.7M|            size_t half = len / 2;
  443|  13.7M|            p += (p[half - 1].key_hash < target) * half;
  444|  13.7M|            len -= half;
  445|  13.7M|         }
  446|       |         // Final element check: advance past it if it's less than target
  447|  2.36M|         p += (len == 1 && p->key_hash < target);
  ------------------
  |  Branch (447:16): [True: 2.36M, False: 0]
  |  Branch (447:28): [True: 38.4k, False: 2.33M]
  ------------------
  448|  2.36M|         return p;
  449|  2.36M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9bloom_setEj:
  277|  5.09M|      {
  278|  5.09M|         const uint32_t a = h & bloom_mask;
  279|  5.09M|         const uint32_t b = (h >> 10) & bloom_mask;
  280|  5.09M|         index_->bloom[a >> 3] |= uint8_t(1) << (a & 7);
  281|  5.09M|         index_->bloom[b >> 3] |= uint8_t(1) << (b & 7);
  282|  5.09M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10index_sizeEv:
  300|  1.79M|      uint32_t index_size() const noexcept { return index_ ? index_->size : 0; }
  ------------------
  |  Branch (300:53): [True: 1.73M, False: 64.1k]
  ------------------
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21ensure_index_capacityEm:
  314|  1.27M|      {
  315|  1.27M|         if (needed == 0) return;
  ------------------
  |  Branch (315:14): [True: 0, False: 1.27M]
  ------------------
  316|  1.27M|         if (needed > static_cast<size_type>(max_u32)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 1.27M]
  ------------------
  317|      0|            throw_index_overflow();
  318|      0|         }
  319|  1.27M|         const auto needed_u32 = static_cast<uint32_t>(needed);
  320|  1.27M|         if (index_ && index_->capacity >= needed_u32) return;
  ------------------
  |  Branch (320:14): [True: 1.21M, False: 64.1k]
  |  Branch (320:24): [True: 1.14M, False: 70.1k]
  ------------------
  321|   134k|         uint32_t cap = index_ ? index_->capacity : 0;
  ------------------
  |  Branch (321:25): [True: 70.1k, False: 64.1k]
  ------------------
  322|   274k|         while (cap < needed_u32) {
  ------------------
  |  Branch (322:17): [True: 140k, False: 134k]
  ------------------
  323|   140k|            const uint32_t next = next_index_capacity(cap);
  324|   140k|            if (next <= cap) {
  ------------------
  |  Branch (324:17): [True: 0, False: 140k]
  ------------------
  325|      0|               throw_index_overflow();
  326|      0|            }
  327|   140k|            cap = next;
  328|   140k|         }
  329|   134k|         auto* block = static_cast<index_header*>(std::realloc(index_, checked_index_allocation_bytes(cap)));
  330|   134k|         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: 134k]
  ------------------
  331|   134k|         if (!index_) {
  ------------------
  |  Branch (331:14): [True: 64.1k, False: 70.1k]
  ------------------
  332|  64.1k|            block->size = 0;
  333|  64.1k|            std::memset(block->bloom, 0, bloom_bytes);
  334|  64.1k|         }
  335|   134k|         block->capacity = cap;
  336|   134k|         index_ = block;
  337|   134k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE19next_index_capacityEj:
  127|   140k|      {
  128|   140k|         if (current == 0) return 16;
  ------------------
  |  Branch (128:14): [True: 64.1k, False: 76.2k]
  ------------------
  129|  76.2k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (129:14): [True: 0, False: 76.2k]
  ------------------
  130|  76.2k|         return current * 2;
  131|  76.2k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE30checked_index_allocation_bytesEj:
  142|   134k|      {
  143|   134k|         constexpr size_t header = sizeof(index_header);
  144|   134k|         constexpr size_t entry = sizeof(hash_index_entry);
  145|   134k|         if (count > (((std::numeric_limits<size_t>::max)() - header) / entry)) {
  ------------------
  |  Branch (145:14): [True: 0, False: 134k]
  ------------------
  146|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  147|      0|         }
  148|   134k|         return header + static_cast<size_t>(count) * entry;
  149|   134k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13index_entriesEv:
  296|  3.64M|      {
  297|  3.64M|         return static_cast<hash_index_entry*>(static_cast<void*>(index_ + 1));
  298|  3.64M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  902|  61.1k|      {
  903|  61.1k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (903:14): [True: 61.1k, False: 0]
  ------------------
  904|  61.1k|            return linear_find(key);
  905|  61.1k|         }
  906|      0|         return index_find(key);
  907|  61.1k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE6insertEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  719|  61.1k|      {
  720|  61.1k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (720:14): [True: 61.1k, False: 0]
  ------------------
  721|  61.1k|            auto it = linear_find(value.first);
  722|  61.1k|            if (it != end()) return {it, false};
  ------------------
  |  Branch (722:17): [True: 0, False: 61.1k]
  ------------------
  723|  61.1k|            push_back_impl(std::move(value));
  724|  61.1k|            return {data_ + size_ - 1, true};
  725|  61.1k|         }
  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|  61.1k|      {
  236|  61.1k|         grow_if_needed();
  237|  61.1k|         std::construct_at(data_ + size_, std::move(val));
  238|  61.1k|         ++size_;
  239|  61.1k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE7emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  746|  18.7M|      {
  747|  18.7M|         return try_emplace(std::forward<K>(key), std::forward<Args>(args)...);
  748|  18.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  752|  18.7M|      {
  753|  18.7M|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (753:14): [True: 15.6M, False: 3.18M]
  ------------------
  754|  15.6M|            auto it = linear_find(key);
  755|  15.6M|            if (it != end()) return {it, false};
  ------------------
  |  Branch (755:17): [True: 2.41M, False: 13.1M]
  ------------------
  756|  13.1M|            emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  757|  13.1M|            return {data_ + size_ - 1, true};
  758|  15.6M|         }
  759|  3.18M|         const uint32_t h = hash_key(key);
  760|  3.18M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
  ------------------
  |  Branch (760:14): [True: 1.67M, False: 1.50M]
  ------------------
  761|  1.67M|            return {data_ + size_ - 1, true};
  762|  1.67M|         }
  763|  1.50M|         auto [it, pos, _] = index_find_or_pos(key, h);
  764|  1.50M|         if (it != end()) return {it, false};
  ------------------
  |  Branch (764:14): [True: 1.20M, False: 295k]
  ------------------
  765|   295k|         emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  766|   295k|         bloom_set(h);
  767|   295k|         if (index_size() > 0) {
  ------------------
  |  Branch (767:14): [True: 295k, False: 0]
  ------------------
  768|   295k|            const uint32_t n = index_->size;
  769|   295k|            ensure_index_capacity(static_cast<size_type>(n) + 1);
  770|   295k|            auto* entries = index_entries();
  771|   295k|            if (pos < n) {
  ------------------
  |  Branch (771:17): [True: 290k, False: 4.86k]
  ------------------
  772|   290k|               std::memmove(entries + pos + 1, entries + pos, (n - pos) * sizeof(hash_index_entry));
  773|   290k|            }
  774|   295k|            entries[pos] = {h, static_cast<uint32_t>(size_ - 1)};
  775|   295k|            index_->size = size_;
  776|   295k|         }
  777|   295k|         return {data_ + size_ - 1, true};
  778|  1.50M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15emplace_back_kvINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEEvOT_DpOT0_:
  251|  15.1M|      {
  252|  15.1M|         grow_if_needed();
  253|  15.1M|         std::construct_at(data_ + size_, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(key)),
  254|  15.1M|                           std::forward_as_tuple(std::forward<Args>(args)...));
  255|  15.1M|         ++size_;
  256|  15.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|  3.18M|      {
  530|  3.18M|         if (index_ && size_ <= bloom_threshold && !bloom_maybe_contains(h)) {
  ------------------
  |  Branch (530:14): [True: 3.11M, False: 64.1k]
  |  Branch (530:24): [True: 3.03M, False: 83.7k]
  |  Branch (530:52): [True: 1.67M, False: 1.35M]
  ------------------
  531|       |            // Definitely not present — skip the search
  532|  1.67M|            append_fn();
  533|  1.67M|            bloom_set(h);
  534|       |            // Index is now stale (index_->size < size_), will rebuild on next lookup or false positive
  535|  1.67M|            return true;
  536|  1.67M|         }
  537|  1.50M|         return false;
  538|  3.18M|      }
_ZZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_ENKUlvE_clEv:
  760|  1.67M|         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|  9.81k|      size_type size() const noexcept { return size_; }

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

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

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

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

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

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

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

_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2Ev:
  379|  37.7M|      generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEED2Ev:
  131|  65.5M|      ~generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEDn:
  272|    212|      {
  273|    212|         data = value;
  274|    212|         return *this;
  275|    212|      }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEOS3_:
  383|  8.09M|      generic_json& operator=(generic_json&&) = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2EOS3_:
  382|  27.7M|      generic_json(generic_json&& other) noexcept : data(std::move(other.data)) {}
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEixITkNSt3__114convertible_toINS5_17basic_string_viewIcNS5_11char_traitsIcEEEEEERNS5_12basic_stringIcS9_NS5_9allocatorIcEEEEEERS3_OT_:
  245|  61.1k|      {
  246|  61.1k|         if (holds<null_t>()) data = object_t{};
  ------------------
  |  Branch (246:14): [True: 61.1k, False: 0]
  ------------------
  247|  61.1k|         auto* object = std::get_if<object_t>(&data);
  248|  61.1k|         if (!object) [[unlikely]] {
  ------------------
  |  Branch (248:14): [True: 0, False: 61.1k]
  ------------------
  249|      0|            key_type_mismatch(key);
  250|      0|         }
  251|  61.1k|         auto iter = object->find(key);
  252|  61.1k|         if (iter == object->end()) {
  ------------------
  |  Branch (252:14): [True: 61.1k, False: 0]
  ------------------
  253|  61.1k|            iter = object->insert(std::make_pair(std::string(key), generic_json{})).first;
  254|  61.1k|         }
  255|  61.1k|         return iter->second;
  256|  61.1k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE5holdsIDnEEbv:
  224|  4.31M|      {
  225|  4.31M|         return std::holds_alternative<T>(data);
  226|  4.31M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE7is_nullEv:
  459|  4.25M|      [[nodiscard]] bool is_null() const noexcept { return holds<std::nullptr_t>(); }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPT_v:
  176|  5.51M|      {
  177|  5.51M|         return std::get_if<T>(&data);
  178|  5.51M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE4sizeEv:
  575|  18.5k|      {
  576|  18.5k|         if (auto* v = get_if<object_t>()) {
  ------------------
  |  Branch (576:20): [True: 9.81k, False: 8.75k]
  ------------------
  577|  9.81k|            return v->size();
  578|  9.81k|         }
  579|  8.75k|         else if (auto* v = get_if<array_t>()) {
  ------------------
  |  Branch (579:25): [True: 2.27k, False: 6.47k]
  ------------------
  580|  2.27k|            return v->size();
  581|  2.27k|         }
  582|  6.47k|         else if (auto* v = get_if<std::string>()) {
  ------------------
  |  Branch (582:25): [True: 3.30k, False: 3.17k]
  ------------------
  583|  3.30k|            return v->size();
  584|  3.30k|         }
  585|  3.17k|         else {
  586|  3.17k|            return 0;
  587|  3.17k|         }
  588|  18.5k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINS2_IS3_EEEEPKT_v:
  182|  18.5k|      {
  183|  18.5k|         return std::get_if<T>(&data);
  184|  18.5k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__16vectorIS3_NS5_9allocatorIS3_EEEEEEPKT_v:
  182|  8.75k|      {
  183|  8.75k|         return std::get_if<T>(&data);
  184|  8.75k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPKT_v:
  182|  6.47k|      {
  183|  6.47k|         return std::get_if<T>(&data);
  184|  6.47k|      }

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

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

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

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

_ZN3glz10fast_float10from_charsIdciEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_12chars_formatE:
 4237|  4.39M|           chars_format fmt /*= chars_format::general*/) noexcept {
 4238|  4.39M|  return from_chars_caller<T>::call(first, last, value,
 4239|  4.39M|                                    parse_options_t<UC>(fmt));
 4240|  4.39M|}
_ZN3glz10fast_float17from_chars_callerIdE4callIcEENS0_19from_chars_result_tIT_EEPKS5_S8_RdNS0_15parse_options_tIS5_EE:
 4195|  4.39M|       parse_options_t<UC> options) noexcept {
 4196|  4.39M|    return from_chars_advanced(first, last, value, options);
 4197|  4.39M|  }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4443|  4.39M|                    parse_options_t<UC> options) noexcept {
 4444|  4.39M|  return from_chars_advanced_caller<
 4445|  4.39M|      size_t(is_supported_float_type<T>::value) +
 4446|  4.39M|      2 * size_t(is_supported_integer_type<T>::value)>::call(first, last, value,
 4447|  4.39M|                                                             options);
 4448|  4.39M|}
_ZN3glz10fast_float26from_chars_advanced_callerILm1EE4callIdcEENS0_19from_chars_result_tIT0_EEPKS5_S8_RT_NS0_15parse_options_tIS5_EE:
 4426|  4.39M|       parse_options_t<UC> options) noexcept {
 4427|  4.39M|    return from_chars_float_advanced(first, last, value, options);
 4428|  4.39M|  }
_ZN3glz10fast_float25from_chars_float_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4338|  4.39M|                          parse_options_t<UC> options) noexcept {
 4339|       |
 4340|  4.39M|  static_assert(is_supported_float_type<T>::value,
 4341|  4.39M|                "only some floating-point types are supported");
 4342|  4.39M|  static_assert(is_supported_char_type<UC>::value,
 4343|  4.39M|                "only char, wchar_t, char16_t and char32_t are supported");
 4344|       |
 4345|  4.39M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 4346|       |
 4347|  4.39M|  from_chars_result_t<UC> answer;
 4348|  4.39M|  if (uint64_t(fmt & chars_format::skip_white_space)) {
  ------------------
  |  Branch (4348:7): [True: 0, False: 4.39M]
  ------------------
 4349|      0|    while ((first != last) && fast_float::is_space(*first)) {
  ------------------
  |  Branch (4349:12): [True: 0, False: 0]
  |  Branch (4349:31): [True: 0, False: 0]
  ------------------
 4350|      0|      first++;
 4351|      0|    }
 4352|      0|  }
 4353|  4.39M|  if (first == last) {
  ------------------
  |  Branch (4353:7): [True: 1.29k, False: 4.39M]
  ------------------
 4354|  1.29k|    answer.ec = std::errc::invalid_argument;
 4355|  1.29k|    answer.ptr = first;
 4356|  1.29k|    return answer;
 4357|  1.29k|  }
 4358|  4.39M|  parsed_number_string_t<UC> pns =
 4359|  4.39M|      uint64_t(fmt & detail::basic_json_fmt)
  ------------------
  |  Branch (4359:7): [True: 0, False: 4.39M]
  ------------------
 4360|  4.39M|          ? parse_number_string<true, UC>(first, last, options)
 4361|  4.39M|          : parse_number_string<false, UC>(first, last, options);
 4362|  4.39M|  if (!pns.valid) {
  ------------------
  |  Branch (4362:7): [True: 261k, False: 4.13M]
  ------------------
 4363|   261k|    if (uint64_t(fmt & chars_format::no_infnan)) {
  ------------------
  |  Branch (4363:9): [True: 0, False: 261k]
  ------------------
 4364|      0|      answer.ec = std::errc::invalid_argument;
 4365|      0|      answer.ptr = first;
 4366|      0|      return answer;
 4367|   261k|    } else {
 4368|   261k|      return detail::parse_infnan(first, last, value, fmt);
 4369|   261k|    }
 4370|   261k|  }
 4371|       |
 4372|       |  // call overload that takes parsed_number_string_t directly.
 4373|  4.13M|  return from_chars_advanced(pns, value);
 4374|  4.39M|}
_ZN3glz10fast_float6detail25adjust_for_feature_macrosENS0_12chars_formatE:
 1375|  8.79M|constexpr chars_format adjust_for_feature_macros(chars_format fmt) {
 1376|  8.79M|  return fmt
 1377|       |#ifdef GLZ_FASTFLOAT_ALLOWS_LEADING_PLUS
 1378|       |         | chars_format::allow_leading_plus
 1379|       |#endif
 1380|       |#ifdef GLZ_FASTFLOAT_SKIP_WHITE_SPACE
 1381|       |         | chars_format::skip_white_space
 1382|       |#endif
 1383|  8.79M|      ;
 1384|  8.79M|}
_ZN3glz10fast_floatanENS0_12chars_formatES1_:
 1340|  30.1M|constexpr chars_format operator&(chars_format lhs, chars_format rhs) noexcept {
 1341|  30.1M|  using int_type = std::underlying_type<chars_format>::type;
 1342|  30.1M|  return static_cast<chars_format>(static_cast<int_type>(lhs) &
 1343|  30.1M|                                   static_cast<int_type>(rhs));
 1344|  30.1M|}
_ZN3glz10fast_float4spanIKcEC2Ev:
  438|  9.31M|  constexpr span() : ptr(nullptr), length(0) {}
_ZN3glz10fast_float18report_parse_errorIcEENS0_22parsed_number_string_tIT_EEPKS3_NS0_11parse_errorE:
 1727|   261k|report_parse_error(UC const *p, parse_error error) {
 1728|   261k|  parsed_number_string_t<UC> answer;
 1729|   261k|  answer.valid = false;
 1730|   261k|  answer.lastmatch = p;
 1731|   261k|  answer.error = error;
 1732|   261k|  return answer;
 1733|   261k|}
_ZN3glz10fast_float10is_integerIcEEbT_:
 1481|   445k|fastfloat_really_inline constexpr bool is_integer(UC c) noexcept {
 1482|   445k|  return !(c > UC('9') || c < UC('0'));
  ------------------
  |  Branch (1482:12): [True: 6.90k, False: 438k]
  |  Branch (1482:27): [True: 7.55k, False: 431k]
  ------------------
 1483|   445k|}
_ZN3glz10fast_float11digit_valueIcEEmT_:
 1489|  16.9M|fastfloat_really_inline constexpr uint64_t digit_value(UC c) noexcept {
 1490|  16.9M|  return uint64_t(uint8_t(c) - uint8_t('0'));
 1491|  16.9M|}
_ZN3glz10fast_float4spanIKcEC2EPS2_m:
  436|  4.65M|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float26loop_parse_if_eight_digitsERPKcS2_Rm:
 1679|   260k|                           uint64_t &i) {
 1680|       |  // optimizes better than parse_if_eight_digits_unrolled() for UC = char.
 1681|   603k|  while ((std::distance(p, pend) >= 8) &&
  ------------------
  |  Branch (1681:10): [True: 382k, False: 220k]
  ------------------
 1682|   382k|         is_made_of_eight_digits_fast(read8_to_u64(p))) {
  ------------------
  |  Branch (1682:10): [True: 342k, False: 40.0k]
  ------------------
 1683|   342k|    i = i * 100000000 +
 1684|   342k|        parse_eight_digits_unrolled(read8_to_u64(
 1685|   342k|            p)); // in rare cases, this will overflow, but that's ok
 1686|   342k|    p += 8;
 1687|   342k|  }
 1688|   260k|}
_ZN3glz10fast_float28is_made_of_eight_digits_fastEm:
 1597|   382k|is_made_of_eight_digits_fast(uint64_t val) noexcept {
 1598|   382k|  return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) &
 1599|   382k|            0x8080808080808080));
 1600|   382k|}
_ZN3glz10fast_float12read8_to_u64IcEEmPKT_:
 1503|  1.00M|read8_to_u64(UC const *chars) {
 1504|  1.00M|  if (cpp20_and_in_constexpr() || !std::is_same<UC, char>::value) {
  ------------------
  |  Branch (1504:7): [Folded, False: 0]
  |  Branch (1504:35): [Folded, False: 0]
  ------------------
 1505|      0|    uint64_t val = 0;
 1506|      0|    for (int i = 0; i < 8; ++i) {
  ------------------
  |  Branch (1506:21): [True: 0, False: 0]
  ------------------
 1507|      0|      val |= uint64_t(uint8_t(*chars)) << (i * 8);
 1508|      0|      ++chars;
 1509|      0|    }
 1510|      0|    return val;
 1511|      0|  }
 1512|  1.00M|  uint64_t val;
 1513|  1.00M|  ::memcpy(&val, chars, sizeof(uint64_t));
 1514|       |#if GLZ_FASTFLOAT_IS_BIG_ENDIAN == 1
 1515|       |  // Need to read as-if the number was in little-endian order.
 1516|       |  val = byteswap(val);
 1517|       |#endif
 1518|  1.00M|  return val;
 1519|  1.00M|}
_ZN3glz10fast_float27parse_eight_digits_unrolledEm:
 1575|   617k|parse_eight_digits_unrolled(uint64_t val) {
 1576|   617k|  uint64_t const mask = 0x000000FF000000FF;
 1577|   617k|  uint64_t const mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
 1578|   617k|  uint64_t const mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
 1579|   617k|  val -= 0x3030303030303030;
 1580|   617k|  val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
 1581|   617k|  val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
 1582|   617k|  return uint32_t(val);
 1583|   617k|}
_ZNK3glz10fast_float4spanIKcE3lenEv:
  440|  95.0k|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float19parse_number_stringILb0EcEENS0_22parsed_number_string_tIT0_EEPKS3_S6_NS0_15parse_options_tIS3_EE:
 1740|  4.39M|                    parse_options_t<UC> options) noexcept {
 1741|  4.39M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 1742|  4.39M|  UC const decimal_point = options.decimal_point;
 1743|       |
 1744|  4.39M|  parsed_number_string_t<UC> answer;
 1745|  4.39M|  answer.valid = false;
 1746|  4.39M|  answer.too_many_digits = false;
 1747|       |  // assume p < pend, so dereference without checks;
 1748|  4.39M|  answer.negative = (*p == UC('-'));
 1749|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 1750|  4.39M|  if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (1750:7): [True: 17.8k, False: 4.37M]
  |  Branch (1750:27): [True: 0, False: 4.37M]
  ------------------
 1751|  17.8k|                          !basic_json_fmt && *p == UC('+'))) {
  ------------------
  |  Branch (1751:27): [True: 0, Folded]
  |  Branch (1751:46): [True: 0, False: 0]
  ------------------
 1752|  17.8k|    ++p;
 1753|  17.8k|    if (p == pend) {
  ------------------
  |  Branch (1753:9): [True: 1.09k, False: 16.7k]
  ------------------
 1754|  1.09k|      return report_parse_error<UC>(
 1755|  1.09k|          p, parse_error::missing_integer_or_dot_after_sign);
 1756|  1.09k|    }
 1757|  16.7k|    GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  16.7k|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1758|  16.7k|      if (!is_integer(*p)) { // a sign must be followed by an integer
 1759|  16.7k|        return report_parse_error<UC>(p,
 1760|  16.7k|                                      parse_error::missing_integer_after_sign);
 1761|  16.7k|      }
 1762|  16.7k|    }
 1763|  16.7k|    else {
 1764|  16.7k|      if (!is_integer(*p) &&
  ------------------
  |  Branch (1764:11): [True: 6.69k, False: 10.0k]
  ------------------
 1765|  6.69k|          (*p !=
  ------------------
  |  Branch (1765:11): [True: 1.87k, False: 4.81k]
  ------------------
 1766|  6.69k|           decimal_point)) { // a sign must be followed by an integer or the dot
 1767|  1.87k|        return report_parse_error<UC>(
 1768|  1.87k|            p, parse_error::missing_integer_or_dot_after_sign);
 1769|  1.87k|      }
 1770|  16.7k|    }
 1771|  16.7k|  }
 1772|  4.39M|  UC const *const start_digits = p;
 1773|       |
 1774|  4.39M|  uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad)
 1775|       |
 1776|  4.39M|  uint64_t digit;
 1777|  20.4M|  while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1777:10): [True: 16.7M, False: 3.75M]
  |  Branch (1777:25): [True: 16.0M, False: 644k]
  ------------------
 1778|       |    // a multiplication by 10 is cheaper than an arbitrary integer
 1779|       |    // multiplication
 1780|  16.0M|    i = 10 * i + digit; // might overflow, we will handle the overflow later
 1781|  16.0M|    ++p;
 1782|  16.0M|  }
 1783|  4.39M|  UC const *const end_of_integer_part = p;
 1784|  4.39M|  int64_t digit_count = int64_t(end_of_integer_part - start_digits);
 1785|  4.39M|  answer.integer = span<UC const>(start_digits, size_t(digit_count));
 1786|  4.39M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  4.39M|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1787|       |    // at least 1 digit in integer part, without leading zeros
 1788|       |    if (digit_count == 0) {
 1789|       |      return report_parse_error<UC>(p, parse_error::no_digits_in_integer_part);
 1790|       |    }
 1791|       |    if ((start_digits[0] == UC('0') && digit_count > 1)) {
 1792|       |      return report_parse_error<UC>(start_digits,
 1793|       |                                    parse_error::leading_zeros_in_integer_part);
 1794|       |    }
 1795|       |  }
 1796|       |
 1797|  4.39M|  int64_t exponent = 0;
 1798|  4.39M|  bool const has_decimal_point = (p != pend) && (*p == decimal_point);
  ------------------
  |  Branch (1798:34): [True: 644k, False: 3.75M]
  |  Branch (1798:49): [True: 260k, False: 383k]
  ------------------
 1799|  4.39M|  if (has_decimal_point) {
  ------------------
  |  Branch (1799:7): [True: 260k, False: 4.13M]
  ------------------
 1800|   260k|    ++p;
 1801|   260k|    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|   260k|    loop_parse_if_eight_digits(p, pend, i);
 1805|       |
 1806|   372k|    while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1806:12): [True: 242k, False: 130k]
  |  Branch (1806:27): [True: 112k, False: 130k]
  ------------------
 1807|   112k|      ++p;
 1808|   112k|      i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
 1809|   112k|    }
 1810|   260k|    exponent = before - p;
 1811|   260k|    answer.fraction = span<UC const>(before, size_t(p - before));
 1812|   260k|    digit_count -= exponent;
 1813|   260k|  }
 1814|  4.39M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  4.39M|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1815|       |    // at least 1 digit in fractional part
 1816|       |    if (has_decimal_point && exponent == 0) {
 1817|       |      return report_parse_error<UC>(p,
 1818|       |                                    parse_error::no_digits_in_fractional_part);
 1819|       |    }
 1820|       |  }
 1821|  4.39M|  else if (digit_count == 0) { // we must have encountered at least one integer!
  ------------------
  |  Branch (1821:12): [True: 258k, False: 4.13M]
  ------------------
 1822|   258k|    return report_parse_error<UC>(p, parse_error::no_digits_in_mantissa);
 1823|   258k|  }
 1824|  4.13M|  int64_t exp_number = 0; // explicit exponential part
 1825|  4.39M|  if ((uint64_t(fmt & chars_format::scientific) && (p != pend) &&
  ------------------
  |  Branch (1825:8): [True: 4.13M, False: 260k]
  |  Branch (1825:52): [True: 346k, False: 3.78M]
  ------------------
 1826|   346k|       ((UC('e') == *p) || (UC('E') == *p))) ||
  ------------------
  |  Branch (1826:9): [True: 7.28k, False: 339k]
  |  Branch (1826:28): [True: 11.0k, False: 328k]
  ------------------
 1827|  4.11M|      (uint64_t(fmt & detail::basic_fortran_fmt) && (p != pend) &&
  ------------------
  |  Branch (1827:8): [True: 0, False: 4.11M]
  |  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|  18.3k|        (UC('D') == *p)))) {
  ------------------
  |  Branch (1829:9): [True: 0, False: 0]
  ------------------
 1830|  18.3k|    UC const *location_of_e = p;
 1831|  18.3k|    if ((UC('e') == *p) || (UC('E') == *p) || (UC('d') == *p) ||
  ------------------
  |  Branch (1831:9): [True: 7.28k, False: 11.0k]
  |  Branch (1831:28): [True: 11.0k, False: 0]
  |  Branch (1831:47): [True: 0, False: 0]
  ------------------
 1832|  18.3k|        (UC('D') == *p)) {
  ------------------
  |  Branch (1832:9): [True: 0, False: 0]
  ------------------
 1833|  18.3k|      ++p;
 1834|  18.3k|    }
 1835|  18.3k|    bool neg_exp = false;
 1836|  18.3k|    if ((p != pend) && (UC('-') == *p)) {
  ------------------
  |  Branch (1836:9): [True: 17.1k, False: 1.22k]
  |  Branch (1836:24): [True: 5.56k, False: 11.5k]
  ------------------
 1837|  5.56k|      neg_exp = true;
 1838|  5.56k|      ++p;
 1839|  12.7k|    } else if ((p != pend) &&
  ------------------
  |  Branch (1839:16): [True: 11.5k, False: 1.22k]
  ------------------
 1840|  11.5k|               (UC('+') ==
  ------------------
  |  Branch (1840:16): [True: 750, False: 10.8k]
  ------------------
 1841|  11.5k|                *p)) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
 1842|    750|      ++p;
 1843|    750|    }
 1844|  18.3k|    if ((p == pend) || !is_integer(*p)) {
  ------------------
  |  Branch (1844:9): [True: 1.50k, False: 16.8k]
  |  Branch (1844:24): [True: 1.55k, False: 15.2k]
  ------------------
 1845|  3.06k|      if (!uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 3.06k]
  ------------------
 1846|       |        // The exponential part is invalid for scientific notation, so it must
 1847|       |        // be a trailing token for fixed notation. However, fixed notation is
 1848|       |        // disabled, so report a scientific notation error.
 1849|      0|        return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1850|      0|      }
 1851|       |      // Otherwise, we will be ignoring the 'e'.
 1852|  3.06k|      p = location_of_e;
 1853|  15.2k|    } else {
 1854|   421k|      while ((p != pend) && is_integer(*p)) {
  ------------------
  |  Branch (1854:14): [True: 411k, False: 9.09k]
  |  Branch (1854:29): [True: 405k, False: 6.20k]
  ------------------
 1855|   405k|        uint8_t exp_digit = uint8_t(*p - UC('0'));
 1856|   405k|        if (exp_number < 0x10000000) {
  ------------------
  |  Branch (1856:13): [True: 49.0k, False: 356k]
  ------------------
 1857|  49.0k|          exp_number = 10 * exp_number + exp_digit;
 1858|  49.0k|        }
 1859|   405k|        ++p;
 1860|   405k|      }
 1861|  15.2k|      if (neg_exp) {
  ------------------
  |  Branch (1861:11): [True: 5.51k, False: 9.78k]
  ------------------
 1862|  5.51k|        exp_number = -exp_number;
 1863|  5.51k|      }
 1864|  15.2k|      exponent += exp_number;
 1865|  15.2k|    }
 1866|  4.37M|  } else {
 1867|       |    // If it scientific and not fixed, we have to bail out.
 1868|  4.37M|    if (uint64_t(fmt & chars_format::scientific) &&
  ------------------
  |  Branch (1868:9): [True: 4.11M, False: 260k]
  ------------------
 1869|  4.11M|        !uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1869:9): [True: 0, False: 4.11M]
  ------------------
 1870|      0|      return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1871|      0|    }
 1872|  4.37M|  }
 1873|  4.39M|  answer.lastmatch = p;
 1874|  4.39M|  answer.valid = true;
 1875|       |
 1876|       |  // If we frequently had to deal with long strings of digits,
 1877|       |  // we could extend our code by using a 128-bit integer instead
 1878|       |  // of a 64-bit integer. However, this is uncommon.
 1879|       |  //
 1880|       |  // We can deal with up to 19 digits.
 1881|  4.39M|  if (digit_count > 19) { // this is uncommon
  ------------------
  |  Branch (1881:7): [True: 68.9k, False: 4.32M]
  ------------------
 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|  68.9k|    UC const *start = start_digits;
 1887|  4.52M|    while ((start != pend) && (*start == UC('0') || *start == decimal_point)) {
  ------------------
  |  Branch (1887:12): [True: 4.52M, False: 784]
  |  Branch (1887:32): [True: 4.42M, False: 97.9k]
  |  Branch (1887:53): [True: 29.8k, False: 68.1k]
  ------------------
 1888|  4.45M|      if (*start == UC('0')) {
  ------------------
  |  Branch (1888:11): [True: 4.42M, False: 29.8k]
  ------------------
 1889|  4.42M|        digit_count--;
 1890|  4.42M|      }
 1891|  4.45M|      start++;
 1892|  4.45M|    }
 1893|       |
 1894|  68.9k|    if (digit_count > 19) {
  ------------------
  |  Branch (1894:9): [True: 64.0k, False: 4.89k]
  ------------------
 1895|  64.0k|      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|  64.0k|      i = 0;
 1900|  64.0k|      p = answer.integer.ptr;
 1901|  64.0k|      UC const *int_end = p + answer.integer.len();
 1902|  64.0k|      uint64_t const minimal_nineteen_digit_integer{1000000000000000000};
 1903|  1.26M|      while ((i < minimal_nineteen_digit_integer) && (p != int_end)) {
  ------------------
  |  Branch (1903:14): [True: 1.21M, False: 52.9k]
  |  Branch (1903:54): [True: 1.20M, False: 11.1k]
  ------------------
 1904|  1.20M|        i = i * 10 + uint64_t(*p - UC('0'));
 1905|  1.20M|        ++p;
 1906|  1.20M|      }
 1907|  64.0k|      if (i >= minimal_nineteen_digit_integer) { // We have a big integers
  ------------------
  |  Branch (1907:11): [True: 52.9k, False: 11.1k]
  ------------------
 1908|  52.9k|        exponent = end_of_integer_part - p + exp_number;
 1909|  52.9k|      } else { // We have a value with a fractional component.
 1910|  11.1k|        p = answer.fraction.ptr;
 1911|  11.1k|        UC const *frac_end = p + answer.fraction.len();
 1912|   161k|        while ((i < minimal_nineteen_digit_integer) && (p != frac_end)) {
  ------------------
  |  Branch (1912:16): [True: 150k, False: 11.1k]
  |  Branch (1912:56): [True: 150k, False: 0]
  ------------------
 1913|   150k|          i = i * 10 + uint64_t(*p - UC('0'));
 1914|   150k|          ++p;
 1915|   150k|        }
 1916|  11.1k|        exponent = answer.fraction.ptr - p + exp_number;
 1917|  11.1k|      }
 1918|       |      // We have now corrected both exponent and i, to a truncated value
 1919|  64.0k|    }
 1920|  68.9k|  }
 1921|  4.39M|  answer.exponent = exponent;
 1922|  4.39M|  answer.mantissa = i;
 1923|  4.39M|  return answer;
 1924|  4.39M|}
_ZN3glz10fast_float6detail12parse_infnanIdcEENS0_19from_chars_result_tIT0_EEPKS4_S7_RT_NS0_12chars_formatE:
 4076|   261k|                                       T &value, chars_format fmt) noexcept {
 4077|   261k|  from_chars_result_t<UC> answer{};
 4078|   261k|  answer.ptr = first;
 4079|   261k|  answer.ec = std::errc(); // be optimistic
 4080|       |  // assume first < last, so dereference without checks;
 4081|   261k|  bool const minusSign = (*first == UC('-'));
 4082|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 4083|   261k|  if ((*first == UC('-')) ||
  ------------------
  |  Branch (4083:7): [True: 3.88k, False: 257k]
  ------------------
 4084|   257k|      (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (4084:8): [True: 0, False: 257k]
  ------------------
 4085|  3.88k|       (*first == UC('+')))) {
  ------------------
  |  Branch (4085:8): [True: 0, False: 0]
  ------------------
 4086|  3.88k|    ++first;
 4087|  3.88k|  }
 4088|   261k|  if (last - first >= 3) {
  ------------------
  |  Branch (4088:7): [True: 120k, False: 140k]
  ------------------
 4089|   120k|    if (fastfloat_strncasecmp(first, str_const_nan<UC>(), 3)) {
  ------------------
  |  Branch (4089:9): [True: 15.1k, False: 105k]
  ------------------
 4090|  15.1k|      answer.ptr = (first += 3);
 4091|  15.1k|      value = minusSign ? -std::numeric_limits<T>::quiet_NaN()
  ------------------
  |  Branch (4091:15): [True: 32, False: 15.0k]
  ------------------
 4092|  15.1k|                        : 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|  15.1k|      if (first != last && *first == UC('(')) {
  ------------------
  |  Branch (4095:11): [True: 14.6k, False: 404]
  |  Branch (4095:28): [True: 14.4k, False: 292]
  ------------------
 4096|  65.9k|        for (UC const *ptr = first + 1; ptr != last; ++ptr) {
  ------------------
  |  Branch (4096:41): [True: 64.8k, False: 1.13k]
  ------------------
 4097|  64.8k|          if (*ptr == UC(')')) {
  ------------------
  |  Branch (4097:15): [True: 502, False: 64.3k]
  ------------------
 4098|    502|            answer.ptr = ptr + 1; // valid nan(n-char-seq-opt)
 4099|    502|            break;
 4100|  64.3k|          } else if (!((UC('a') <= *ptr && *ptr <= UC('z')) ||
  ------------------
  |  Branch (4100:25): [True: 804, False: 63.5k]
  |  Branch (4100:44): [True: 490, False: 314]
  ------------------
 4101|  63.8k|                       (UC('A') <= *ptr && *ptr <= UC('Z')) ||
  ------------------
  |  Branch (4101:25): [True: 51.1k, False: 12.7k]
  |  Branch (4101:44): [True: 50.7k, False: 324]
  ------------------
 4102|  13.0k|                       (UC('0') <= *ptr && *ptr <= UC('9')) || *ptr == UC('_')))
  ------------------
  |  Branch (4102:25): [True: 1.11k, False: 11.9k]
  |  Branch (4102:44): [True: 278, False: 840]
  |  Branch (4102:64): [True: 0, False: 12.7k]
  ------------------
 4103|  12.7k|            break; // forbidden char, not nan(n-char-seq-opt)
 4104|  64.8k|        }
 4105|  14.4k|      }
 4106|  15.1k|      return answer;
 4107|  15.1k|    }
 4108|   105k|    if (fastfloat_strncasecmp(first, str_const_inf<UC>(), 3)) {
  ------------------
  |  Branch (4108:9): [True: 20.8k, False: 84.7k]
  ------------------
 4109|  20.8k|      if ((last - first >= 8) &&
  ------------------
  |  Branch (4109:11): [True: 19.7k, False: 1.13k]
  ------------------
 4110|  19.7k|          fastfloat_strncasecmp(first + 3, str_const_inf<UC>() + 3, 5)) {
  ------------------
  |  Branch (4110:11): [True: 222, False: 19.5k]
  ------------------
 4111|    222|        answer.ptr = first + 8;
 4112|  20.6k|      } else {
 4113|  20.6k|        answer.ptr = first + 3;
 4114|  20.6k|      }
 4115|  20.8k|      value = minusSign ? -std::numeric_limits<T>::infinity()
  ------------------
  |  Branch (4115:15): [True: 864, False: 20.0k]
  ------------------
 4116|  20.8k|                        : std::numeric_limits<T>::infinity();
 4117|  20.8k|      return answer;
 4118|  20.8k|    }
 4119|   105k|  }
 4120|   225k|  answer.ec = std::errc::invalid_argument;
 4121|   225k|  return answer;
 4122|   261k|}
_ZN3glz10fast_float21fastfloat_strncasecmpIcEEbPKT_S4_m:
  417|   246k|                      size_t length) {
  418|   357k|  for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (418:22): [True: 321k, False: 36.2k]
  ------------------
  419|   321k|    UC const actual = actual_mixedcase[i];
  420|   321k|    if ((actual < 256 ? actual | 32 : actual) != expected_lowercase[i]) {
  ------------------
  |  Branch (420:9): [True: 209k, False: 111k]
  |  Branch (420:10): [True: 321k, False: 0]
  ------------------
  421|   209k|      return false;
  422|   209k|    }
  423|   321k|  }
  424|  36.2k|  return true;
  425|   246k|}
_ZN3glz10fast_float13str_const_nanIcEEPKT_v:
 1186|   120k|template <> constexpr char const *str_const_nan<char>() { return "nan"; }
_ZN3glz10fast_float13str_const_infIcEEPKT_v:
 1206|   125k|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|  4.13M|from_chars_advanced(parsed_number_string_t<UC> &pns, T &value) noexcept {
 4250|       |
 4251|  4.13M|  static_assert(is_supported_float_type<T>::value,
 4252|  4.13M|                "only some floating-point types are supported");
 4253|  4.13M|  static_assert(is_supported_char_type<UC>::value,
 4254|  4.13M|                "only char, wchar_t, char16_t and char32_t are supported");
 4255|       |
 4256|  4.13M|  from_chars_result_t<UC> answer;
 4257|       |
 4258|  4.13M|  answer.ec = std::errc(); // be optimistic
 4259|  4.13M|  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|  4.13M|  if (binary_format<T>::min_exponent_fast_path() <= pns.exponent &&
  ------------------
  |  Branch (4265:7): [True: 4.12M, False: 6.44k]
  ------------------
 4266|  4.12M|      pns.exponent <= binary_format<T>::max_exponent_fast_path() &&
  ------------------
  |  Branch (4266:7): [True: 4.11M, False: 9.70k]
  ------------------
 4267|  4.11M|      !pns.too_many_digits) {
  ------------------
  |  Branch (4267:7): [True: 4.06M, False: 57.6k]
  ------------------
 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|  4.06M|    if (!cpp20_and_in_constexpr() && detail::rounds_to_nearest()) {
  ------------------
  |  Branch (4275:9): [True: 4.06M, Folded]
  |  Branch (4275:38): [True: 4.06M, False: 0]
  ------------------
 4276|       |      // We have that fegetround() == FE_TONEAREST.
 4277|       |      // Next is Clinger's fast path.
 4278|  4.06M|      if (pns.mantissa <= binary_format<T>::max_mantissa_fast_path()) {
  ------------------
  |  Branch (4278:11): [True: 4.04M, False: 20.6k]
  ------------------
 4279|  4.04M|        value = T(pns.mantissa);
 4280|  4.04M|        if (pns.exponent < 0) {
  ------------------
  |  Branch (4280:13): [True: 39.5k, False: 4.00M]
  ------------------
 4281|  39.5k|          value = value / binary_format<T>::exact_power_of_ten(-pns.exponent);
 4282|  4.00M|        } else {
 4283|  4.00M|          value = value * binary_format<T>::exact_power_of_ten(pns.exponent);
 4284|  4.00M|        }
 4285|  4.04M|        if (pns.negative) {
  ------------------
  |  Branch (4285:13): [True: 12.2k, False: 4.02M]
  ------------------
 4286|  12.2k|          value = -value;
 4287|  12.2k|        }
 4288|  4.04M|        return answer;
 4289|  4.04M|      }
 4290|  4.06M|    } 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|  4.06M|  }
 4313|  94.4k|  adjusted_mantissa am =
 4314|  94.4k|      compute_float<binary_format<T>>(pns.exponent, pns.mantissa);
 4315|  94.4k|  if (pns.too_many_digits && am.power2 >= 0) {
  ------------------
  |  Branch (4315:7): [True: 64.0k, False: 30.4k]
  |  Branch (4315:30): [True: 64.0k, False: 0]
  ------------------
 4316|  64.0k|    if (am != compute_float<binary_format<T>>(pns.exponent, pns.mantissa + 1)) {
  ------------------
  |  Branch (4316:9): [True: 12.2k, False: 51.7k]
  ------------------
 4317|  12.2k|      am = compute_error<binary_format<T>>(pns.exponent, pns.mantissa);
 4318|  12.2k|    }
 4319|  64.0k|  }
 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|  94.4k|  if (am.power2 < 0) {
  ------------------
  |  Branch (4323:7): [True: 12.2k, False: 82.2k]
  ------------------
 4324|  12.2k|    am = digit_comp<T>(pns, am);
 4325|  12.2k|  }
 4326|  94.4k|  to_float(pns.negative, am, value);
 4327|       |  // Test for over/underflow.
 4328|  94.4k|  if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) ||
  ------------------
  |  Branch (4328:8): [True: 92.6k, False: 1.80k]
  |  Branch (4328:29): [True: 7.88k, False: 84.7k]
  |  Branch (4328:49): [True: 2.28k, False: 5.60k]
  ------------------
 4329|  92.1k|      am.power2 == binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (4329:7): [True: 2.21k, False: 89.9k]
  ------------------
 4330|  4.50k|    answer.ec = std::errc::result_out_of_range;
 4331|  4.50k|  }
 4332|  94.4k|  return answer;
 4333|  4.13M|}
_ZN3glz10fast_float13binary_formatIdE22min_exponent_fast_pathEv:
  695|  4.13M|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|  4.13M|  return -22;
  700|  4.13M|#endif
  701|  4.13M|}
_ZN3glz10fast_float13binary_formatIdE22max_exponent_fast_pathEv:
  767|  4.12M|inline constexpr int binary_format<double>::max_exponent_fast_path() {
  768|  4.12M|  return 22;
  769|  4.12M|}
_ZN3glz10fast_float6detail17rounds_to_nearestEv:
 4129|  4.06M|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|  4.06M|  static float volatile fmin = (std::numeric_limits<float>::min)();
 4151|  4.06M|  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|  4.06M|#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|  4.06M|  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|  4.06M|}
_ZN3glz10fast_float13binary_formatIdE22max_mantissa_fast_pathEv:
  777|  4.06M|inline constexpr uint64_t binary_format<double>::max_mantissa_fast_path() {
  778|  4.06M|  return uint64_t(2) << mantissa_explicit_bits();
  779|  4.06M|}
_ZN3glz10fast_float13binary_formatIdE22mantissa_explicit_bitsEv:
  713|  4.70M|inline constexpr int binary_format<double>::mantissa_explicit_bits() {
  714|  4.70M|  return 52;
  715|  4.70M|}
_ZN3glz10fast_float13binary_formatIdE18exact_power_of_tenEl:
 1057|  4.04M|binary_format<double>::exact_power_of_ten(int64_t power) {
 1058|       |  // Work around clang bug https://godbolt.org/z/zedh7rrhc
 1059|  4.04M|  return (void)powers_of_ten[0], powers_of_ten[power];
 1060|  4.04M|}
_ZN3glz10fast_float13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2852|   158k|compute_float(int64_t q, uint64_t w) noexcept {
 2853|   158k|  adjusted_mantissa answer;
 2854|   158k|  if ((w == 0) || (q < binary::smallest_power_of_ten())) {
  ------------------
  |  Branch (2854:7): [True: 1.80k, False: 156k]
  |  Branch (2854:19): [True: 2.48k, False: 154k]
  ------------------
 2855|  4.28k|    answer.power2 = 0;
 2856|  4.28k|    answer.mantissa = 0;
 2857|       |    // result should be zero
 2858|  4.28k|    return answer;
 2859|  4.28k|  }
 2860|   154k|  if (q > binary::largest_power_of_ten()) {
  ------------------
  |  Branch (2860:7): [True: 2.57k, False: 151k]
  ------------------
 2861|       |    // we want to get infinity:
 2862|  2.57k|    answer.power2 = binary::infinite_power();
 2863|  2.57k|    answer.mantissa = 0;
 2864|  2.57k|    return answer;
 2865|  2.57k|  }
 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|   151k|  int lz = leading_zeroes(w);
 2871|   151k|  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|   151k|  value128 product =
 2880|   151k|      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|   151k|  int upperbit = int(product.high >> 63);
 2891|   151k|  int shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
 2892|       |
 2893|   151k|  answer.mantissa = product.high >> shift;
 2894|       |
 2895|   151k|  answer.power2 = int32_t(detail::power(int32_t(q)) + upperbit - lz -
 2896|   151k|                          binary::minimum_exponent());
 2897|   151k|  if (answer.power2 <= 0) { // we have a subnormal?
  ------------------
  |  Branch (2897:7): [True: 5.62k, False: 145k]
  ------------------
 2898|       |    // Here have that answer.power2 <= 0 so -answer.power2 >= 0
 2899|  5.62k|    if (-answer.power2 + 1 >=
  ------------------
  |  Branch (2899:9): [True: 842, False: 4.78k]
  ------------------
 2900|  5.62k|        64) { // if we have more than 64 bits below the minimum exponent, you
 2901|       |              // have a zero for sure.
 2902|    842|      answer.power2 = 0;
 2903|    842|      answer.mantissa = 0;
 2904|       |      // result should be zero
 2905|    842|      return answer;
 2906|    842|    }
 2907|       |    // next line is safe because -answer.power2 + 1 < 64
 2908|  4.78k|    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|  4.78k|    answer.mantissa += (answer.mantissa & 1); // round up
 2913|  4.78k|    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|  4.78k|    answer.power2 =
 2922|  4.78k|        (answer.mantissa < (uint64_t(1) << binary::mantissa_explicit_bits()))
  ------------------
  |  Branch (2922:9): [True: 4.77k, False: 4]
  ------------------
 2923|  4.78k|            ? 0
 2924|  4.78k|            : 1;
 2925|  4.78k|    return answer;
 2926|  5.62k|  }
 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|   145k|  if ((product.low <= 1) && (q >= binary::min_exponent_round_to_even()) &&
  ------------------
  |  Branch (2931:7): [True: 104k, False: 41.7k]
  |  Branch (2931:29): [True: 103k, False: 838]
  ------------------
 2932|   103k|      (q <= binary::max_exponent_round_to_even()) &&
  ------------------
  |  Branch (2932:7): [True: 102k, False: 844]
  ------------------
 2933|   102k|      ((answer.mantissa & 3) == 1)) { // we may fall between two floats!
  ------------------
  |  Branch (2933:7): [True: 5.53k, False: 97.0k]
  ------------------
 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|  5.53k|    if ((answer.mantissa << shift) == product.high) {
  ------------------
  |  Branch (2939:9): [True: 2.36k, False: 3.17k]
  ------------------
 2940|  2.36k|      answer.mantissa &= ~uint64_t(1); // flip it so that we do not round up
 2941|  2.36k|    }
 2942|  5.53k|  }
 2943|       |
 2944|   145k|  answer.mantissa += (answer.mantissa & 1); // round up
 2945|   145k|  answer.mantissa >>= 1;
 2946|   145k|  if (answer.mantissa >= (uint64_t(2) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (2946:7): [True: 3.28k, False: 142k]
  ------------------
 2947|  3.28k|    answer.mantissa = (uint64_t(1) << binary::mantissa_explicit_bits());
 2948|  3.28k|    answer.power2++; // undo previous addition
 2949|  3.28k|  }
 2950|       |
 2951|   145k|  answer.mantissa &= ~(uint64_t(1) << binary::mantissa_explicit_bits());
 2952|   145k|  if (answer.power2 >= binary::infinite_power()) { // infinity
  ------------------
  |  Branch (2952:7): [True: 450, False: 145k]
  ------------------
 2953|    450|    answer.power2 = binary::infinite_power();
 2954|    450|    answer.mantissa = 0;
 2955|    450|  }
 2956|   145k|  return answer;
 2957|   151k|}
_ZN3glz10fast_float17adjusted_mantissaC2Ev:
  568|   182k|  adjusted_mantissa() = default;
_ZN3glz10fast_float13binary_formatIdE21smallest_power_of_tenEv:
 1077|   156k|inline constexpr int binary_format<double>::smallest_power_of_ten() {
 1078|   156k|  return -342;
 1079|   156k|}
_ZN3glz10fast_float13binary_formatIdE20largest_power_of_tenEv:
 1068|   154k|template <> inline constexpr int binary_format<double>::largest_power_of_ten() {
 1069|   154k|  return 308;
 1070|   154k|}
_ZN3glz10fast_float14leading_zeroesEm:
  488|   173k|leading_zeroes(uint64_t input_num) {
  489|   173k|  assert(input_num > 0);
  ------------------
  |  Branch (489:3): [True: 173k, False: 0]
  ------------------
  490|   173k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (490:7): [Folded, False: 173k]
  ------------------
  491|      0|    return leading_zeroes_generic(input_num);
  492|      0|  }
  493|       |#ifdef GLZ_FASTFLOAT_VISUAL_STUDIO
  494|       |#if defined(_M_X64) || defined(_M_ARM64)
  495|       |  unsigned long leading_zero = 0;
  496|       |  // Search the mask data from most significant bit (MSB)
  497|       |  // to least significant bit (LSB) for a set bit (1).
  498|       |  _BitScanReverse64(&leading_zero, input_num);
  499|       |  return (int)(63 - leading_zero);
  500|       |#else
  501|       |  return leading_zeroes_generic(input_num);
  502|       |#endif
  503|       |#else
  504|   173k|  return __builtin_clzll(input_num);
  505|   173k|#endif
  506|   173k|}
_ZN3glz10fast_float29compute_product_approximationILi55EEENS0_8value128Elm:
 2771|   163k|compute_product_approximation(int64_t q, uint64_t w) {
 2772|   163k|  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|   163k|  value128 firstproduct =
 2777|   163k|      full_multiplication(w, powers::power_of_five_128[index]);
 2778|   163k|  static_assert((bit_precision >= 0) && (bit_precision <= 64),
 2779|   163k|                " precision should  be in (0,64]");
 2780|   163k|  constexpr uint64_t precision_mask =
 2781|   163k|      (bit_precision < 64) ? (uint64_t(0xFFFFFFFFFFFFFFFF) >> bit_precision)
  ------------------
  |  Branch (2781:7): [True: 0, Folded]
  ------------------
 2782|   163k|                           : uint64_t(0xFFFFFFFFFFFFFFFF);
 2783|   163k|  if ((firstproduct.high & precision_mask) ==
  ------------------
  |  Branch (2783:7): [True: 15.0k, False: 148k]
  ------------------
 2784|   163k|      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|  15.0k|    value128 secondproduct =
 2789|  15.0k|        full_multiplication(w, powers::power_of_five_128[index + 1]);
 2790|  15.0k|    firstproduct.low += secondproduct.high;
 2791|  15.0k|    if (secondproduct.high > firstproduct.low) {
  ------------------
  |  Branch (2791:9): [True: 4.95k, False: 10.1k]
  ------------------
 2792|  4.95k|      firstproduct.high++;
 2793|  4.95k|    }
 2794|  15.0k|  }
 2795|   163k|  return firstproduct;
 2796|   163k|}
_ZN3glz10fast_float19full_multiplicationEmm:
  540|   178k|full_multiplication(uint64_t a, uint64_t b) {
  541|   178k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (541:7): [Folded, False: 178k]
  ------------------
  542|      0|    value128 answer;
  543|      0|    answer.low = umul128_generic(a, b, &answer.high);
  544|      0|    return answer;
  545|      0|  }
  546|   178k|  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|   178k|  answer.low = uint64_t(r);
  558|   178k|  answer.high = uint64_t(r >> 64);
  559|       |#else
  560|       |  answer.low = umul128_generic(a, b, &answer.high);
  561|       |#endif
  562|   178k|  return answer;
  563|   178k|}
_ZN3glz10fast_float8value128C2Ev:
  454|   178k|  constexpr value128() : low(0), high(0) {}
_ZN3glz10fast_float6detail5powerEi:
 2814|   163k|constexpr fastfloat_really_inline int32_t power(int32_t q) noexcept {
 2815|   163k|  return (((152170 + 65536) * q) >> 16) + 63;
 2816|   163k|}
_ZN3glz10fast_float13binary_formatIdE16minimum_exponentEv:
  742|   176k|template <> inline constexpr int binary_format<double>::minimum_exponent() {
  743|   176k|  return -1023;
  744|   176k|}
_ZN3glz10fast_float13binary_formatIdE26min_exponent_round_to_evenEv:
  733|   104k|inline constexpr int binary_format<double>::min_exponent_round_to_even() {
  734|   104k|  return -4;
  735|   104k|}
_ZN3glz10fast_float13binary_formatIdE26max_exponent_round_to_evenEv:
  723|   103k|inline constexpr int binary_format<double>::max_exponent_round_to_even() {
  724|   103k|  return 23;
  725|   103k|}
_ZNK3glz10fast_float17adjusted_mantissaneERKS1_:
  574|  64.0k|  constexpr bool operator!=(adjusted_mantissa const &o) const {
  575|  64.0k|    return mantissa != o.mantissa || power2 != o.power2;
  ------------------
  |  Branch (575:12): [True: 12.2k, False: 51.7k]
  |  Branch (575:38): [True: 0, False: 51.7k]
  ------------------
  576|  64.0k|  }
_ZN3glz10fast_float13compute_errorINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2837|  12.2k|compute_error(int64_t q, uint64_t w) noexcept {
 2838|  12.2k|  int lz = leading_zeroes(w);
 2839|  12.2k|  w <<= lz;
 2840|  12.2k|  value128 product =
 2841|  12.2k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2842|  12.2k|  return compute_error_scaled<binary>(q, product.high, lz);
 2843|  12.2k|}
_ZN3glz10fast_float20compute_error_scaledINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElmi:
 2823|  12.2k|compute_error_scaled(int64_t q, uint64_t w, int lz) noexcept {
 2824|  12.2k|  int hilz = int(w >> 63) ^ 1;
 2825|  12.2k|  adjusted_mantissa answer;
 2826|  12.2k|  answer.mantissa = w << hilz;
 2827|  12.2k|  int bias = binary::mantissa_explicit_bits() - binary::minimum_exponent();
 2828|  12.2k|  answer.power2 = int32_t(detail::power(int32_t(q)) + bias - hilz - lz - 62 +
 2829|  12.2k|                          invalid_am_bias);
 2830|  12.2k|  return answer;
 2831|  12.2k|}
_ZN3glz10fast_float10digit_compIdcEENS0_17adjusted_mantissaERNS0_22parsed_number_string_tIT0_EES2_:
 4034|  12.2k|digit_comp(parsed_number_string_t<UC> &num, adjusted_mantissa am) noexcept {
 4035|       |  // remove the invalid exponent bias
 4036|  12.2k|  am.power2 -= invalid_am_bias;
 4037|       |
 4038|  12.2k|  int32_t sci_exp = scientific_exponent(num);
 4039|  12.2k|  size_t max_digits = binary_format<T>::max_digits();
 4040|  12.2k|  size_t digits = 0;
 4041|  12.2k|  bigint bigmant;
 4042|  12.2k|  parse_mantissa(bigmant, num, max_digits, digits);
 4043|       |  // can't underflow, since digits is at most max_digits.
 4044|  12.2k|  int32_t exponent = sci_exp + 1 - int32_t(digits);
 4045|  12.2k|  if (exponent >= 0) {
  ------------------
  |  Branch (4045:7): [True: 4.93k, False: 7.28k]
  ------------------
 4046|  4.93k|    return positive_digit_comp<T>(bigmant, exponent);
 4047|  7.28k|  } else {
 4048|  7.28k|    return negative_digit_comp<T>(bigmant, am, exponent);
 4049|  7.28k|  }
 4050|  12.2k|}
_ZN3glz10fast_float19scientific_exponentIcEEiRNS0_22parsed_number_string_tIT_EE:
 3640|  12.2k|scientific_exponent(parsed_number_string_t<UC> &num) noexcept {
 3641|  12.2k|  uint64_t mantissa = num.mantissa;
 3642|  12.2k|  int32_t exponent = int32_t(num.exponent);
 3643|  61.1k|  while (mantissa >= 10000) {
  ------------------
  |  Branch (3643:10): [True: 48.8k, False: 12.2k]
  ------------------
 3644|  48.8k|    mantissa /= 10000;
 3645|  48.8k|    exponent += 4;
 3646|  48.8k|  }
 3647|  24.4k|  while (mantissa >= 100) {
  ------------------
  |  Branch (3647:10): [True: 12.2k, False: 12.2k]
  ------------------
 3648|  12.2k|    mantissa /= 100;
 3649|  12.2k|    exponent += 2;
 3650|  12.2k|  }
 3651|  12.2k|  while (mantissa >= 10) {
  ------------------
  |  Branch (3651:10): [True: 0, False: 12.2k]
  ------------------
 3652|      0|    mantissa /= 10;
 3653|      0|    exponent += 1;
 3654|      0|  }
 3655|  12.2k|  return exponent;
 3656|  12.2k|}
_ZN3glz10fast_float13binary_formatIdE10max_digitsEv:
 1085|  12.2k|template <> inline constexpr size_t binary_format<double>::max_digits() {
 1086|  12.2k|  return 769;
 1087|  12.2k|}
_ZN3glz10fast_float6bigintC2Ev:
 3399|  12.2k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint() : vec() {}
_ZN3glz10fast_float8stackvecILt62EEC2Ev:
 3006|  88.0k|  stackvec() = default;
_ZN3glz10fast_float14parse_mantissaIcEEvRNS0_6bigintERNS0_22parsed_number_string_tIT_EEmRm:
 3859|  12.2k|               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|  12.2k|  size_t counter = 0;
 3864|  12.2k|  digits = 0;
 3865|  12.2k|  limb value = 0;
 3866|  12.2k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3867|  12.2k|  size_t step = 19;
 3868|       |#else
 3869|       |  size_t step = 9;
 3870|       |#endif
 3871|       |
 3872|       |  // process all integer digits.
 3873|  12.2k|  UC const *p = num.integer.ptr;
 3874|  12.2k|  UC const *pend = p + num.integer.len();
 3875|  12.2k|  skip_zeros(p, pend);
 3876|       |  // process all digits, in increments of step per loop
 3877|  29.9k|  while (p != pend) {
  ------------------
  |  Branch (3877:10): [True: 17.7k, False: 12.2k]
  ------------------
 3878|  36.0k|    while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3878:12): [True: 21.4k, False: 14.6k]
  |  Branch (3878:45): [True: 18.3k, False: 3.10k]
  ------------------
 3879|  18.3k|           (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3879:12): [True: 18.3k, False: 0]
  ------------------
 3880|  18.3k|      parse_eight_digits(p, value, counter, digits);
 3881|  18.3k|    }
 3882|  57.7k|    while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3882:12): [True: 51.1k, False: 6.54k]
  |  Branch (3882:30): [True: 39.9k, False: 11.1k]
  |  Branch (3882:43): [True: 39.9k, False: 0]
  ------------------
 3883|  39.9k|      parse_one_digit(p, value, counter, digits);
 3884|  39.9k|    }
 3885|  17.7k|    if (digits == max_digits) {
  ------------------
  |  Branch (3885:9): [True: 0, False: 17.7k]
  ------------------
 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|  17.7k|    } else {
 3897|  17.7k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3898|  17.7k|      counter = 0;
 3899|  17.7k|      value = 0;
 3900|  17.7k|    }
 3901|  17.7k|  }
 3902|       |
 3903|       |  // add our fraction digits, if they're available.
 3904|  12.2k|  if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3904:7): [True: 7.75k, False: 4.46k]
  ------------------
 3905|  7.75k|    p = num.fraction.ptr;
 3906|  7.75k|    pend = p + num.fraction.len();
 3907|  7.75k|    if (digits == 0) {
  ------------------
  |  Branch (3907:9): [True: 990, False: 6.76k]
  ------------------
 3908|    990|      skip_zeros(p, pend);
 3909|    990|    }
 3910|       |    // process all digits, in increments of step per loop
 3911|   137k|    while (p != pend) {
  ------------------
  |  Branch (3911:12): [True: 132k, False: 4.84k]
  ------------------
 3912|   388k|      while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3912:14): [True: 381k, False: 7.04k]
  |  Branch (3912:47): [True: 257k, False: 123k]
  ------------------
 3913|   257k|             (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3913:14): [True: 256k, False: 1.79k]
  ------------------
 3914|   256k|        parse_eight_digits(p, value, counter, digits);
 3915|   256k|      }
 3916|   524k|      while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3916:14): [True: 399k, False: 125k]
  |  Branch (3916:32): [True: 394k, False: 4.31k]
  |  Branch (3916:45): [True: 392k, False: 2.84k]
  ------------------
 3917|   392k|        parse_one_digit(p, value, counter, digits);
 3918|   392k|      }
 3919|   132k|      if (digits == max_digits) {
  ------------------
  |  Branch (3919:11): [True: 2.91k, False: 129k]
  ------------------
 3920|       |        // add the temporary value, then check if we've truncated any digits
 3921|  2.91k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3922|  2.91k|        bool truncated = is_truncated(p, pend);
 3923|  2.91k|        if (truncated) {
  ------------------
  |  Branch (3923:13): [True: 2.12k, False: 788]
  ------------------
 3924|  2.12k|          round_up_bigint(result, digits);
 3925|  2.12k|        }
 3926|  2.91k|        return;
 3927|   129k|      } else {
 3928|   129k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3929|   129k|        counter = 0;
 3930|   129k|        value = 0;
 3931|   129k|      }
 3932|   132k|    }
 3933|  7.75k|  }
 3934|       |
 3935|  9.31k|  if (counter != 0) {
  ------------------
  |  Branch (3935:7): [True: 0, False: 9.31k]
  ------------------
 3936|      0|    add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3937|      0|  }
 3938|  9.31k|}
_ZN3glz10fast_float10skip_zerosIcEEvRPKT_S4_:
 3773|  13.2k|skip_zeros(UC const *&first, UC const *last) noexcept {
 3774|  13.2k|  uint64_t val;
 3775|  17.4k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3775:10): [True: 17.4k, Folded]
  ------------------
 3776|  17.4k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3776:10): [True: 12.6k, False: 4.78k]
  ------------------
 3777|  12.6k|    ::memcpy(&val, first, sizeof(uint64_t));
 3778|  12.6k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3778:9): [True: 8.43k, False: 4.22k]
  ------------------
 3779|  8.43k|      break;
 3780|  8.43k|    }
 3781|  4.22k|    first += int_cmp_len<UC>();
 3782|  4.22k|  }
 3783|  22.6k|  while (first != last) {
  ------------------
  |  Branch (3783:10): [True: 21.7k, False: 990]
  ------------------
 3784|  21.7k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3784:9): [True: 12.2k, False: 9.48k]
  ------------------
 3785|  12.2k|      break;
 3786|  12.2k|    }
 3787|  9.48k|    first++;
 3788|  9.48k|  }
 3789|  13.2k|}
_ZN3glz10fast_float11int_cmp_lenIcEEiv:
 1180|  32.8k|template <typename UC> constexpr int int_cmp_len() {
 1181|  32.8k|  return sizeof(uint64_t) / sizeof(UC);
 1182|  32.8k|}
_ZN3glz10fast_float13int_cmp_zerosIcEEmv:
 1170|  17.7k|template <typename UC> constexpr uint64_t int_cmp_zeros() {
 1171|  17.7k|  static_assert((sizeof(UC) == 1) || (sizeof(UC) == 2) || (sizeof(UC) == 4),
 1172|  17.7k|                "Unsupported character size");
 1173|  17.7k|  return (sizeof(UC) == 1) ? 0x3030303030303030
  ------------------
  |  Branch (1173:10): [True: 17.7k, Folded]
  ------------------
 1174|  17.7k|         : (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|  17.7k|}
_ZN3glz10fast_float18parse_eight_digitsIcEEvRPKT_RmS6_S6_:
 3824|   274k|                   size_t &count) noexcept {
 3825|   274k|  value = value * 100000000 + parse_eight_digits_unrolled(p);
 3826|   274k|  p += 8;
 3827|   274k|  counter += 8;
 3828|   274k|  count += 8;
 3829|   274k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledIcEEjPKT_:
 1588|   274k|parse_eight_digits_unrolled(UC const *chars) noexcept {
 1589|   274k|  if (cpp20_and_in_constexpr() || !has_simd_opt<UC>()) {
  ------------------
  |  Branch (1589:7): [Folded, False: 0]
  |  Branch (1589:35): [True: 0, Folded]
  ------------------
 1590|   274k|    return parse_eight_digits_unrolled(read8_to_u64(chars)); // truncation okay
 1591|   274k|  }
 1592|      0|  return parse_eight_digits_unrolled(simd_read8_to_u64(chars));
 1593|   274k|}
_ZN3glz10fast_float15parse_one_digitIcEEvRPKT_RmS6_S6_:
 3834|   432k|                size_t &count) noexcept {
 3835|   432k|  value = value * 10 + limb(*p - UC('0'));
 3836|   432k|  p++;
 3837|   432k|  counter++;
 3838|   432k|  count++;
 3839|   432k|}
_ZN3glz10fast_float10add_nativeERNS0_6bigintEmm:
 3842|   152k|add_native(bigint &big, limb power, limb value) noexcept {
 3843|   152k|  big.mul(power);
 3844|   152k|  big.add(value);
 3845|   152k|}
_ZN3glz10fast_float6bigint3mulEm:
 3552|   152k|  GLZ_FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
_ZN3glz10fast_float9small_mulILt62EEEbRNS0_8stackvecIXT_EEEm:
 3249|   261k|                                            limb y) noexcept {
 3250|   261k|  limb carry = 0;
 3251|  4.02M|  for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3251:26): [True: 3.76M, False: 261k]
  ------------------
 3252|  3.76M|    vec[index] = scalar_mul(vec[index], y, carry);
 3253|  3.76M|  }
 3254|   261k|  if (carry != 0) {
  ------------------
  |  Branch (3254:7): [True: 232k, False: 28.7k]
  ------------------
 3255|   232k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|   232k|  {                                                                            \
  |  |  355|   232k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 232k]
  |  |  ------------------
  |  |  356|   232k|      return false;                                                            \
  |  |  357|   232k|  }
  ------------------
 3256|   232k|  }
 3257|   261k|  return true;
 3258|   261k|}
_ZNK3glz10fast_float8stackvecILt62EE3lenEv:
 3039|  5.19M|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float10scalar_mulEmmRm:
 3196|  3.76M|scalar_mul(limb x, limb y, limb &carry) noexcept {
 3197|  3.76M|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3198|  3.76M|#if defined(__SIZEOF_INT128__)
 3199|       |  // GCC and clang both define it as an extension.
 3200|  3.76M|  __uint128_t z = __uint128_t(x) * __uint128_t(y) + __uint128_t(carry);
 3201|  3.76M|  carry = limb(z >> limb_bits);
 3202|  3.76M|  return limb(z);
 3203|       |#else
 3204|       |  // fallback, no native 128-bit integer multiplication with carry.
 3205|       |  // on msvc, this optimizes identically, somehow.
 3206|       |  value128 z = full_multiplication(x, y);
 3207|       |  bool overflow;
 3208|       |  z.low = scalar_add(z.low, carry, overflow);
 3209|       |  z.high += uint64_t(overflow); // cannot overflow
 3210|       |  carry = z.high;
 3211|       |  return z.low;
 3212|       |#endif
 3213|       |#else
 3214|       |  uint64_t z = uint64_t(x) * uint64_t(y) + uint64_t(carry);
 3215|       |  carry = limb(z >> limb_bits);
 3216|       |  return limb(z);
 3217|       |#endif
 3218|  3.76M|}
_ZN3glz10fast_float8stackvecILt62EEixEm:
 3017|  9.41M|  GLZ_FASTFLOAT_CONSTEXPR14 limb &operator[](size_t index) noexcept {
 3018|  9.41M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  9.41M|  { ((void)(x)); }
  ------------------
 3019|  9.41M|    return data[index];
 3020|  9.41M|  }
_ZN3glz10fast_float8stackvecILt62EE8try_pushEm:
 3052|   246k|  GLZ_FASTFLOAT_CONSTEXPR14 bool try_push(limb value) noexcept {
 3053|   246k|    if (len() < capacity()) {
  ------------------
  |  Branch (3053:9): [True: 246k, False: 0]
  ------------------
 3054|   246k|      push_unchecked(value);
 3055|   246k|      return true;
 3056|   246k|    } else {
 3057|      0|      return false;
 3058|      0|    }
 3059|   246k|  }
_ZNK3glz10fast_float8stackvecILt62EE8capacityEv:
 3043|   405k|  constexpr size_t capacity() const noexcept { return size; }
_ZN3glz10fast_float8stackvecILt62EE14push_uncheckedEm:
 3046|   253k|  GLZ_FASTFLOAT_CONSTEXPR14 void push_unchecked(limb value) noexcept {
 3047|   253k|    data[length] = value;
 3048|   253k|    length++;
 3049|   253k|  }
_ZN3glz10fast_float6bigint3addEm:
 3554|   152k|  GLZ_FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
_ZN3glz10fast_float9small_addILt62EEEbRNS0_8stackvecIXT_EEEm:
 3242|   152k|small_add(stackvec<size> &vec, limb y) noexcept {
 3243|   152k|  return small_add_from(vec, y, 0);
 3244|   152k|}
_ZN3glz10fast_float14small_add_fromILt62EEEbRNS0_8stackvecIXT_EEEmm:
 3224|   152k|                                                 size_t start) noexcept {
 3225|   152k|  size_t index = start;
 3226|   152k|  limb carry = y;
 3227|   152k|  bool overflow;
 3228|   236k|  while (carry != 0 && index < vec.len()) {
  ------------------
  |  Branch (3228:10): [True: 96.5k, False: 139k]
  |  Branch (3228:24): [True: 84.0k, False: 12.5k]
  ------------------
 3229|  84.0k|    vec[index] = scalar_add(vec[index], carry, overflow);
 3230|  84.0k|    carry = limb(overflow);
 3231|  84.0k|    index += 1;
 3232|  84.0k|  }
 3233|   152k|  if (carry != 0) {
  ------------------
  |  Branch (3233:7): [True: 12.5k, False: 139k]
  ------------------
 3234|  12.5k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  12.5k|  {                                                                            \
  |  |  355|  12.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 12.5k]
  |  |  ------------------
  |  |  356|  12.5k|      return false;                                                            \
  |  |  357|  12.5k|  }
  ------------------
 3235|  12.5k|  }
 3236|   152k|  return true;
 3237|   152k|}
_ZN3glz10fast_float10scalar_addEmmRb:
 3176|  1.15M|scalar_add(limb x, limb y, bool &overflow) noexcept {
 3177|  1.15M|  limb z;
 3178|       |// gcc and clang
 3179|  1.15M|#if defined(__has_builtin)
 3180|  1.15M|#if __has_builtin(__builtin_add_overflow)
 3181|  1.15M|  if (!cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (3181:7): [True: 1.15M, Folded]
  ------------------
 3182|  1.15M|    overflow = __builtin_add_overflow(x, y, &z);
 3183|  1.15M|    return z;
 3184|  1.15M|  }
 3185|      0|#endif
 3186|      0|#endif
 3187|       |
 3188|       |  // generic, this still optimizes correctly on MSVC.
 3189|      0|  z = x + y;
 3190|      0|  overflow = z < x;
 3191|      0|  return z;
 3192|  1.15M|}
_ZN3glz10fast_float12is_truncatedIcEEbPKT_S4_:
 3795|  2.91k|is_truncated(UC const *first, UC const *last) noexcept {
 3796|       |  // do 8-bit optimizations, can just compare to 8 literal 0s.
 3797|  2.91k|  uint64_t val;
 3798|  7.04k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3798:10): [True: 7.04k, Folded]
  ------------------
 3799|  7.04k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3799:10): [True: 5.08k, False: 1.95k]
  ------------------
 3800|  5.08k|    ::memcpy(&val, first, sizeof(uint64_t));
 3801|  5.08k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3801:9): [True: 952, False: 4.13k]
  ------------------
 3802|    952|      return true;
 3803|    952|    }
 3804|  4.13k|    first += int_cmp_len<UC>();
 3805|  4.13k|  }
 3806|  4.73k|  while (first != last) {
  ------------------
  |  Branch (3806:10): [True: 3.94k, False: 788]
  ------------------
 3807|  3.94k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3807:9): [True: 1.17k, False: 2.77k]
  ------------------
 3808|  1.17k|      return true;
 3809|  1.17k|    }
 3810|  2.77k|    ++first;
 3811|  2.77k|  }
 3812|    788|  return false;
 3813|  1.95k|}
_ZN3glz10fast_float15round_up_bigintERNS0_6bigintERm:
 3848|  2.12k|round_up_bigint(bigint &big, size_t &count) noexcept {
 3849|       |  // need to round-up the digits, but need to avoid rounding
 3850|       |  // ....9999 to ...10000, which could cause a false halfway point.
 3851|  2.12k|  add_native(big, 10, 1);
 3852|  2.12k|  count++;
 3853|  2.12k|}
_ZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEi:
 3942|  4.93k|positive_digit_comp(bigint &bigmant, int32_t exponent) noexcept {
 3943|  4.93k|  GLZ_FASTFLOAT_ASSERT(bigmant.pow10(uint32_t(exponent)));
  ------------------
  |  |  344|  4.93k|  { ((void)(x)); }
  ------------------
 3944|  4.93k|  adjusted_mantissa answer;
 3945|  4.93k|  bool truncated;
 3946|  4.93k|  answer.mantissa = bigmant.hi64(truncated);
 3947|  4.93k|  int bias = binary_format<T>::mantissa_explicit_bits() -
 3948|  4.93k|             binary_format<T>::minimum_exponent();
 3949|  4.93k|  answer.power2 = bigmant.bit_length() - 64 + bias;
 3950|       |
 3951|  4.93k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  4.93k|    round_nearest_tie_even(
 3953|  4.93k|        a, shift,
 3954|  4.93k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  4.93k|          return is_above || (is_halfway && truncated) ||
 3956|  4.93k|                 (is_odd && is_halfway);
 3957|  4.93k|        });
 3958|  4.93k|  });
 3959|       |
 3960|  4.93k|  return answer;
 3961|  4.93k|}
_ZN3glz10fast_float6bigint5pow10Ej:
 3591|  4.93k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow10(uint32_t exp) noexcept {
 3592|  4.93k|    GLZ_FASTFLOAT_TRY(pow5(exp));
  ------------------
  |  |  354|  4.93k|  {                                                                            \
  |  |  355|  4.93k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 4.93k]
  |  |  ------------------
  |  |  356|  4.93k|      return false;                                                            \
  |  |  357|  4.93k|  }
  ------------------
 3593|  4.93k|    return pow2(exp);
 3594|  4.93k|  }
_ZN3glz10fast_float6bigint4pow5Ej:
 3560|  12.2k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow5(uint32_t exp) noexcept {
 3561|       |    // multiply by a power of 5
 3562|  12.2k|    size_t large_length = sizeof(large_power_of_5) / sizeof(limb);
 3563|  12.2k|    limb_span large = limb_span(large_power_of_5, large_length);
 3564|  29.3k|    while (exp >= large_step) {
  ------------------
  |  Branch (3564:12): [True: 17.1k, False: 12.2k]
  ------------------
 3565|  17.1k|      GLZ_FASTFLOAT_TRY(large_mul(vec, large));
  ------------------
  |  |  354|  17.1k|  {                                                                            \
  |  |  355|  17.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 17.1k]
  |  |  ------------------
  |  |  356|  17.1k|      return false;                                                            \
  |  |  357|  17.1k|  }
  ------------------
 3566|  17.1k|      exp -= large_step;
 3567|  17.1k|    }
 3568|  12.2k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3569|  12.2k|    uint32_t small_step = 27;
 3570|  12.2k|    limb max_native = 7450580596923828125UL;
 3571|       |#else
 3572|       |    uint32_t small_step = 13;
 3573|       |    limb max_native = 1220703125U;
 3574|       |#endif
 3575|  26.8k|    while (exp >= small_step) {
  ------------------
  |  Branch (3575:12): [True: 14.6k, False: 12.2k]
  ------------------
 3576|  14.6k|      GLZ_FASTFLOAT_TRY(small_mul(vec, max_native));
  ------------------
  |  |  354|  14.6k|  {                                                                            \
  |  |  355|  14.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 14.6k]
  |  |  ------------------
  |  |  356|  14.6k|      return false;                                                            \
  |  |  357|  14.6k|  }
  ------------------
 3577|  14.6k|      exp -= small_step;
 3578|  14.6k|    }
 3579|  12.2k|    if (exp != 0) {
  ------------------
  |  Branch (3579:9): [True: 8.29k, False: 3.92k]
  ------------------
 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|  8.29k|      GLZ_FASTFLOAT_TRY(small_mul(
  ------------------
  |  |  354|  8.29k|  {                                                                            \
  |  |  355|  8.29k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 8.29k]
  |  |  ------------------
  |  |  356|  8.29k|      return false;                                                            \
  |  |  357|  8.29k|  }
  ------------------
 3584|  8.29k|          vec, limb(((void)small_power_of_5[0], small_power_of_5[exp]))));
 3585|  8.29k|    }
 3586|       |
 3587|  12.2k|    return true;
 3588|  12.2k|  }
_ZN3glz10fast_float4spanImEC2EPKmm:
  436|   115k|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float9large_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3329|  17.1k|GLZ_FASTFLOAT_CONSTEXPR20 bool large_mul(stackvec<size> &x, limb_span y) noexcept {
 3330|  17.1k|  if (y.len() == 1) {
  ------------------
  |  Branch (3330:7): [True: 0, False: 17.1k]
  ------------------
 3331|      0|    GLZ_FASTFLOAT_TRY(small_mul(x, y[0]));
  ------------------
  |  |  354|      0|  {                                                                            \
  |  |  355|      0|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  356|      0|      return false;                                                            \
  |  |  357|      0|  }
  ------------------
 3332|  17.1k|  } else {
 3333|  17.1k|    GLZ_FASTFLOAT_TRY(long_mul(x, y));
  ------------------
  |  |  354|  17.1k|  {                                                                            \
  |  |  355|  17.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 17.1k]
  |  |  ------------------
  |  |  356|  17.1k|      return false;                                                            \
  |  |  357|  17.1k|  }
  ------------------
 3334|  17.1k|  }
 3335|  17.1k|  return true;
 3336|  17.1k|}
_ZNK3glz10fast_float4spanImE3lenEv:
  440|  1.33M|  constexpr size_t len() const noexcept { return length; }
_ZNK3glz10fast_float4spanImEixEm:
  442|   839k|  GLZ_FASTFLOAT_CONSTEXPR14 const T &operator[](size_t index) const noexcept {
  443|   839k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|   839k|  { ((void)(x)); }
  ------------------
  444|   839k|    return ptr[index];
  445|   839k|  }
_ZN3glz10fast_float8long_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3301|  17.1k|GLZ_FASTFLOAT_CONSTEXPR20 bool long_mul(stackvec<size> &x, limb_span y) noexcept {
 3302|  17.1k|  limb_span xs = limb_span(x.data, x.len());
 3303|  17.1k|  stackvec<size> z(xs);
 3304|  17.1k|  limb_span zs = limb_span(z.data, z.len());
 3305|       |
 3306|  17.1k|  if (y.len() != 0) {
  ------------------
  |  Branch (3306:7): [True: 17.1k, False: 0]
  ------------------
 3307|  17.1k|    limb y0 = y[0];
 3308|  17.1k|    GLZ_FASTFLOAT_TRY(small_mul(x, y0));
  ------------------
  |  |  354|  17.1k|  {                                                                            \
  |  |  355|  17.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 17.1k]
  |  |  ------------------
  |  |  356|  17.1k|      return false;                                                            \
  |  |  357|  17.1k|  }
  ------------------
 3309|  85.7k|    for (size_t index = 1; index < y.len(); index++) {
  ------------------
  |  Branch (3309:28): [True: 68.5k, False: 17.1k]
  ------------------
 3310|  68.5k|      limb yi = y[index];
 3311|  68.5k|      stackvec<size> zi;
 3312|  68.5k|      if (yi != 0) {
  ------------------
  |  Branch (3312:11): [True: 68.5k, False: 0]
  ------------------
 3313|       |        // re-use the same buffer throughout
 3314|  68.5k|        zi.set_len(0);
 3315|  68.5k|        GLZ_FASTFLOAT_TRY(zi.try_extend(zs));
  ------------------
  |  |  354|  68.5k|  {                                                                            \
  |  |  355|  68.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 68.5k]
  |  |  ------------------
  |  |  356|  68.5k|      return false;                                                            \
  |  |  357|  68.5k|  }
  ------------------
 3316|  68.5k|        GLZ_FASTFLOAT_TRY(small_mul(zi, yi));
  ------------------
  |  |  354|  68.5k|  {                                                                            \
  |  |  355|  68.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 68.5k]
  |  |  ------------------
  |  |  356|  68.5k|      return false;                                                            \
  |  |  357|  68.5k|  }
  ------------------
 3317|  68.5k|        limb_span zis = limb_span(zi.data, zi.len());
 3318|  68.5k|        GLZ_FASTFLOAT_TRY(large_add_from(x, zis, index));
  ------------------
  |  |  354|  68.5k|  {                                                                            \
  |  |  355|  68.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 68.5k]
  |  |  ------------------
  |  |  356|  68.5k|      return false;                                                            \
  |  |  357|  68.5k|  }
  ------------------
 3319|  68.5k|      }
 3320|  68.5k|    }
 3321|  17.1k|  }
 3322|       |
 3323|  17.1k|  x.normalize();
 3324|  17.1k|  return true;
 3325|  17.1k|}
_ZN3glz10fast_float8stackvecILt62EEC2ENS0_4spanImEE:
 3013|  17.1k|  GLZ_FASTFLOAT_CONSTEXPR20 stackvec(limb_span s) {
 3014|  17.1k|    GLZ_FASTFLOAT_ASSERT(try_extend(s));
  ------------------
  |  |  344|  17.1k|  { ((void)(x)); }
  ------------------
 3015|  17.1k|  }
_ZN3glz10fast_float8stackvecILt62EE7set_lenEm:
 3035|   227k|  GLZ_FASTFLOAT_CONSTEXPR14 void set_len(size_t len) noexcept {
 3036|   227k|    length = uint16_t(len);
 3037|   227k|  }
_ZN3glz10fast_float8stackvecILt62EE10try_extendENS0_4spanImEE:
 3069|  85.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_extend(limb_span s) noexcept {
 3070|  85.7k|    if (len() + s.len() <= capacity()) {
  ------------------
  |  Branch (3070:9): [True: 85.7k, False: 0]
  ------------------
 3071|  85.7k|      extend_unchecked(s);
 3072|  85.7k|      return true;
 3073|  85.7k|    } else {
 3074|      0|      return false;
 3075|      0|    }
 3076|  85.7k|  }
_ZN3glz10fast_float8stackvecILt62EE16extend_uncheckedENS0_4spanImEE:
 3062|  85.7k|  GLZ_FASTFLOAT_CONSTEXPR20 void extend_unchecked(limb_span s) noexcept {
 3063|  85.7k|    limb *ptr = data + length;
 3064|  85.7k|    std::copy_n(s.ptr, s.len(), ptr);
 3065|  85.7k|    set_len(len() + s.len());
 3066|  85.7k|  }
_ZN3glz10fast_float14large_add_fromILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEEm:
 3264|  68.5k|                                          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|  68.5k|  if (x.len() < start || y.len() > x.len() - start) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 68.5k]
  |  Branch (3267:26): [True: 68.0k, False: 554]
  ------------------
 3268|  68.0k|    GLZ_FASTFLOAT_TRY(x.try_resize(y.len() + start, 0));
  ------------------
  |  |  354|  68.0k|  {                                                                            \
  |  |  355|  68.0k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 68.0k]
  |  |  ------------------
  |  |  356|  68.0k|      return false;                                                            \
  |  |  357|  68.0k|  }
  ------------------
 3269|  68.0k|  }
 3270|       |
 3271|  68.5k|  bool carry = false;
 3272|   821k|  for (size_t index = 0; index < y.len(); index++) {
  ------------------
  |  Branch (3272:26): [True: 753k, False: 68.5k]
  ------------------
 3273|   753k|    limb xi = x[index + start];
 3274|   753k|    limb yi = y[index];
 3275|   753k|    bool c1 = false;
 3276|   753k|    bool c2 = false;
 3277|   753k|    xi = scalar_add(xi, yi, c1);
 3278|   753k|    if (carry) {
  ------------------
  |  Branch (3278:9): [True: 318k, False: 435k]
  ------------------
 3279|   318k|      xi = scalar_add(xi, 1, c2);
 3280|   318k|    }
 3281|   753k|    x[index + start] = xi;
 3282|   753k|    carry = c1 | c2;
 3283|   753k|  }
 3284|       |
 3285|       |  // handle overflow
 3286|  68.5k|  if (carry) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 68.5k]
  ------------------
 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|  68.5k|  return true;
 3290|  68.5k|}
_ZN3glz10fast_float8stackvecILt62EE10try_resizeEmm:
 3095|  68.0k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_resize(size_t new_len, limb value) noexcept {
 3096|  68.0k|    if (new_len > capacity()) {
  ------------------
  |  Branch (3096:9): [True: 0, False: 68.0k]
  ------------------
 3097|      0|      return false;
 3098|  68.0k|    } else {
 3099|  68.0k|      resize_unchecked(new_len, value);
 3100|  68.0k|      return true;
 3101|  68.0k|    }
 3102|  68.0k|  }
_ZN3glz10fast_float8stackvecILt62EE16resize_uncheckedEmm:
 3082|  68.0k|  void resize_unchecked(size_t new_len, limb value) noexcept {
 3083|  68.0k|    if (new_len > len()) {
  ------------------
  |  Branch (3083:9): [True: 68.0k, False: 0]
  ------------------
 3084|  68.0k|      size_t count = new_len - len();
 3085|  68.0k|      limb *first = data + len();
 3086|  68.0k|      limb *last = first + count;
 3087|  68.0k|      ::std::fill(first, last, value);
 3088|  68.0k|      set_len(new_len);
 3089|  68.0k|    } else {
 3090|      0|      set_len(new_len);
 3091|      0|    }
 3092|  68.0k|  }
_ZN3glz10fast_float8stackvecILt62EE9normalizeEv:
 3118|  24.4k|  GLZ_FASTFLOAT_CONSTEXPR14 void normalize() noexcept {
 3119|  24.4k|    while (len() > 0 && rindex(0) == 0) {
  ------------------
  |  Branch (3119:12): [True: 24.4k, False: 0]
  |  Branch (3119:25): [True: 0, False: 24.4k]
  ------------------
 3120|      0|      length--;
 3121|      0|    }
 3122|  24.4k|  }
_ZNK3glz10fast_float8stackvecILt62EE6rindexEm:
 3028|  38.7k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &rindex(size_t index) const noexcept {
 3029|  38.7k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  38.7k|  { ((void)(x)); }
  ------------------
 3030|  38.7k|    size_t rindex = length - index - 1;
 3031|  38.7k|    return data[rindex];
 3032|  38.7k|  }
_ZN3glz10fast_float6bigint4pow2Ej:
 3557|  11.9k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow2(uint32_t exp) noexcept { return shl(exp); }
_ZN3glz10fast_float6bigint3shlEm:
 3519|  11.9k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {
 3520|  11.9k|    size_t rem = n % limb_bits;
 3521|  11.9k|    size_t div = n / limb_bits;
 3522|  11.9k|    if (rem != 0) {
  ------------------
  |  Branch (3522:9): [True: 7.64k, False: 4.35k]
  ------------------
 3523|  7.64k|      GLZ_FASTFLOAT_TRY(shl_bits(rem));
  ------------------
  |  |  354|  7.64k|  {                                                                            \
  |  |  355|  7.64k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 7.64k]
  |  |  ------------------
  |  |  356|  7.64k|      return false;                                                            \
  |  |  357|  7.64k|  }
  ------------------
 3524|  7.64k|    }
 3525|  11.9k|    if (div != 0) {
  ------------------
  |  Branch (3525:9): [True: 5.27k, False: 6.72k]
  ------------------
 3526|  5.27k|      GLZ_FASTFLOAT_TRY(shl_limbs(div));
  ------------------
  |  |  354|  5.27k|  {                                                                            \
  |  |  355|  5.27k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 5.27k]
  |  |  ------------------
  |  |  356|  5.27k|      return false;                                                            \
  |  |  357|  5.27k|  }
  ------------------
 3527|  5.27k|    }
 3528|  11.9k|    return true;
 3529|  11.9k|  }
_ZN3glz10fast_float6bigint8shl_bitsEm:
 3472|  7.64k|  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|  7.64k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  7.64k|  { ((void)(x)); }
  ------------------
 3479|  7.64k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n < sizeof(limb) * 8);
  ------------------
  |  |  349|  7.64k|  { ((void)(x)); }
  ------------------
 3480|       |
 3481|  7.64k|    size_t shl = n;
 3482|  7.64k|    size_t shr = limb_bits - shl;
 3483|  7.64k|    limb prev = 0;
 3484|   112k|    for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3484:28): [True: 104k, False: 7.64k]
  ------------------
 3485|   104k|      limb xi = vec[index];
 3486|   104k|      vec[index] = (xi << shl) | (prev >> shr);
 3487|   104k|      prev = xi;
 3488|   104k|    }
 3489|       |
 3490|  7.64k|    limb carry = prev >> shr;
 3491|  7.64k|    if (carry != 0) {
  ------------------
  |  Branch (3491:9): [True: 1.66k, False: 5.97k]
  ------------------
 3492|  1.66k|      return vec.try_push(carry);
 3493|  1.66k|    }
 3494|  5.97k|    return true;
 3495|  7.64k|  }
_ZN3glz10fast_float6bigint9shl_limbsEm:
 3498|  5.27k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
 3499|  5.27k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  5.27k|  { ((void)(x)); }
  ------------------
 3500|  5.27k|    if (n + vec.len() > vec.capacity()) {
  ------------------
  |  Branch (3500:9): [True: 0, False: 5.27k]
  ------------------
 3501|      0|      return false;
 3502|  5.27k|    } else if (!vec.is_empty()) {
  ------------------
  |  Branch (3502:16): [True: 5.27k, False: 0]
  ------------------
 3503|       |      // move limbs
 3504|  5.27k|      limb *dst = vec.data + n;
 3505|  5.27k|      limb const *src = vec.data;
 3506|  5.27k|      std::copy_backward(src, src + vec.len(), dst + vec.len());
 3507|       |      // fill in empty limbs
 3508|  5.27k|      limb *first = vec.data;
 3509|  5.27k|      limb *last = first + n;
 3510|  5.27k|      ::std::fill(first, last, 0);
 3511|  5.27k|      vec.set_len(n + vec.len());
 3512|  5.27k|      return true;
 3513|  5.27k|    } else {
 3514|      0|      return true;
 3515|      0|    }
 3516|  5.27k|  }
_ZNK3glz10fast_float8stackvecILt62EE8is_emptyEv:
 3041|  10.2k|  constexpr bool is_empty() const noexcept { return length == 0; }
_ZNK3glz10fast_float6bigint4hi64ERb:
 3418|  4.93k|  GLZ_FASTFLOAT_CONSTEXPR20 uint64_t hi64(bool &truncated) const noexcept {
 3419|  4.93k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3420|  4.93k|    if (vec.len() == 0) {
  ------------------
  |  Branch (3420:9): [True: 0, False: 4.93k]
  ------------------
 3421|      0|      return empty_hi64(truncated);
 3422|  4.93k|    } else if (vec.len() == 1) {
  ------------------
  |  Branch (3422:16): [True: 2.03k, False: 2.89k]
  ------------------
 3423|  2.03k|      return uint64_hi64(vec.rindex(0), truncated);
 3424|  2.89k|    } else {
 3425|  2.89k|      uint64_t result = uint64_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3426|  2.89k|      truncated |= vec.nonzero(2);
 3427|  2.89k|      return result;
 3428|  2.89k|    }
 3429|       |#else
 3430|       |    if (vec.len() == 0) {
 3431|       |      return empty_hi64(truncated);
 3432|       |    } else if (vec.len() == 1) {
 3433|       |      return uint32_hi64(vec.rindex(0), truncated);
 3434|       |    } else if (vec.len() == 2) {
 3435|       |      return uint32_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3436|       |    } else {
 3437|       |      uint64_t result =
 3438|       |          uint32_hi64(vec.rindex(0), vec.rindex(1), vec.rindex(2), truncated);
 3439|       |      truncated |= vec.nonzero(3);
 3440|       |      return result;
 3441|       |    }
 3442|       |#endif
 3443|  4.93k|  }
_ZN3glz10fast_float11uint64_hi64EmRb:
 3132|  2.03k|uint64_hi64(uint64_t r0, bool &truncated) noexcept {
 3133|  2.03k|  truncated = false;
 3134|  2.03k|  int shl = leading_zeroes(r0);
 3135|  2.03k|  return r0 << shl;
 3136|  2.03k|}
_ZN3glz10fast_float11uint64_hi64EmmRb:
 3139|  2.89k|uint64_hi64(uint64_t r0, uint64_t r1, bool &truncated) noexcept {
 3140|  2.89k|  int shl = leading_zeroes(r0);
 3141|  2.89k|  if (shl == 0) {
  ------------------
  |  Branch (3141:7): [True: 332, False: 2.56k]
  ------------------
 3142|    332|    truncated = r1 != 0;
 3143|    332|    return r0;
 3144|  2.56k|  } else {
 3145|  2.56k|    int shr = 64 - shl;
 3146|  2.56k|    truncated = (r1 << shl) != 0;
 3147|  2.56k|    return (r0 << shl) | (r1 >> shr);
 3148|  2.56k|  }
 3149|  2.89k|}
_ZNK3glz10fast_float8stackvecILt62EE7nonzeroEm:
 3107|  2.89k|  GLZ_FASTFLOAT_CONSTEXPR14 bool nonzero(size_t index) const noexcept {
 3108|  2.89k|    while (index < len()) {
  ------------------
  |  Branch (3108:12): [True: 1.52k, False: 1.37k]
  ------------------
 3109|  1.52k|      if (rindex(index) != 0) {
  ------------------
  |  Branch (3109:11): [True: 1.52k, False: 0]
  ------------------
 3110|  1.52k|        return true;
 3111|  1.52k|      }
 3112|      0|      index++;
 3113|      0|    }
 3114|  1.37k|    return false;
 3115|  2.89k|  }
_ZNK3glz10fast_float6bigint10bit_lengthEv:
 3547|  4.93k|  GLZ_FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {
 3548|  4.93k|    int lz = ctlz();
 3549|  4.93k|    return int(limb_bits * vec.len()) - lz;
 3550|  4.93k|  }
_ZNK3glz10fast_float6bigint4ctlzEv:
 3532|  4.93k|  GLZ_FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
 3533|  4.93k|    if (vec.is_empty()) {
  ------------------
  |  Branch (3533:9): [True: 0, False: 4.93k]
  ------------------
 3534|      0|      return 0;
 3535|  4.93k|    } else {
 3536|  4.93k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3537|  4.93k|      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|  4.93k|    }
 3544|  4.93k|  }
_ZN3glz10fast_float5roundIdZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiEUlRS3_iE_EEvS6_T0_:
 3707|  4.93k|                                                         callback cb) noexcept {
 3708|  4.93k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  4.93k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 4.93k]
  ------------------
 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.93k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  4.93k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 4.93k]
  ------------------
 3726|  4.93k|      (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.93k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  4.93k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 4.93k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  4.93k|}
_ZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_i:
 3951|  4.93k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  4.93k|    round_nearest_tie_even(
 3953|  4.93k|        a, shift,
 3954|  4.93k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  4.93k|          return is_above || (is_halfway && truncated) ||
 3956|  4.93k|                 (is_odd && is_halfway);
 3957|  4.93k|        });
 3958|  4.93k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS3_iE_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  4.93k|                       callback cb) noexcept {
 3743|  4.93k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 4.93k]
  ------------------
 3744|  4.93k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 4.93k]
  ------------------
 3745|  4.93k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  4.93k|  bool is_above = truncated_bits > halfway;
 3747|  4.93k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  4.93k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 4.93k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  4.93k|  } else {
 3753|  4.93k|    am.mantissa >>= shift;
 3754|  4.93k|  }
 3755|  4.93k|  am.power2 += shift;
 3756|       |
 3757|  4.93k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  4.93k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  4.93k|}
_ZZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_iENKUlbbbE_clEbbb:
 3954|  4.93k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  4.93k|          return is_above || (is_halfway && truncated) ||
  ------------------
  |  Branch (3955:18): [True: 1.61k, False: 3.31k]
  |  Branch (3955:31): [True: 944, False: 2.37k]
  |  Branch (3955:45): [True: 484, False: 460]
  ------------------
 3956|  2.83k|                 (is_odd && is_halfway);
  ------------------
  |  Branch (3956:19): [True: 1.48k, False: 1.34k]
  |  Branch (3956:29): [True: 186, False: 1.30k]
  ------------------
 3957|  4.93k|        });
_ZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_i:
 3970|  7.28k|    bigint &bigmant, adjusted_mantissa am, int32_t exponent) noexcept {
 3971|  7.28k|  bigint &real_digits = bigmant;
 3972|  7.28k|  int32_t real_exp = exponent;
 3973|       |
 3974|       |  // get the value of `b`, rounded down, and get a bigint representation of b+h
 3975|  7.28k|  adjusted_mantissa am_b = am;
 3976|       |  // gcc7 buf: use a lambda to remove the noexcept qualifier bug with
 3977|       |  // -Wnoexcept-type.
 3978|  7.28k|  round<T>(am_b,
 3979|  7.28k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
 3980|  7.28k|  T b;
 3981|  7.28k|  to_float(false, am_b, b);
 3982|  7.28k|  adjusted_mantissa theor = to_extended_halfway(b);
 3983|  7.28k|  bigint theor_digits(theor.mantissa);
 3984|  7.28k|  int32_t theor_exp = theor.power2;
 3985|       |
 3986|       |  // scale real digits and theor digits to be same power.
 3987|  7.28k|  int32_t pow2_exp = theor_exp - real_exp;
 3988|  7.28k|  uint32_t pow5_exp = uint32_t(-real_exp);
 3989|  7.28k|  if (pow5_exp != 0) {
  ------------------
  |  Branch (3989:7): [True: 7.28k, False: 0]
  ------------------
 3990|  7.28k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow5(pow5_exp));
  ------------------
  |  |  344|  7.28k|  { ((void)(x)); }
  ------------------
 3991|  7.28k|  }
 3992|  7.28k|  if (pow2_exp > 0) {
  ------------------
  |  Branch (3992:7): [True: 4.68k, False: 2.60k]
  ------------------
 3993|  4.68k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow2(uint32_t(pow2_exp)));
  ------------------
  |  |  344|  4.68k|  { ((void)(x)); }
  ------------------
 3994|  4.68k|  } else if (pow2_exp < 0) {
  ------------------
  |  Branch (3994:14): [True: 2.38k, False: 222]
  ------------------
 3995|  2.38k|    GLZ_FASTFLOAT_ASSERT(real_digits.pow2(uint32_t(-pow2_exp)));
  ------------------
  |  |  344|  2.38k|  { ((void)(x)); }
  ------------------
 3996|  2.38k|  }
 3997|       |
 3998|       |  // compare digits, and use it to director rounding
 3999|  7.28k|  int ord = real_digits.compare(theor_digits);
 4000|  7.28k|  adjusted_mantissa answer = am;
 4001|  7.28k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  7.28k|    round_nearest_tie_even(
 4003|  7.28k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.28k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.28k|          (void)__; // not needed, since we've done our comparison
 4006|  7.28k|          if (ord > 0) {
 4007|  7.28k|            return true;
 4008|  7.28k|          } else if (ord < 0) {
 4009|  7.28k|            return false;
 4010|  7.28k|          } else {
 4011|  7.28k|            return is_odd;
 4012|  7.28k|          }
 4013|  7.28k|        });
 4014|  7.28k|  });
 4015|       |
 4016|  7.28k|  return answer;
 4017|  7.28k|}
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE_EEvS6_T0_:
 3707|  7.28k|                                                         callback cb) noexcept {
 3708|  7.28k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  7.28k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 538, False: 6.74k]
  ------------------
 3710|       |    // have a denormal float
 3711|    538|    int32_t shift = -am.power2 + 1;
 3712|    538|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    538|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 538, False: 0]
  ------------------
 3715|    538|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    538|                    ? 0
 3717|    538|                    : 1;
 3718|    538|    return;
 3719|    538|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  6.74k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  6.74k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 6.74k]
  ------------------
 3726|  6.74k|      (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|  6.74k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  6.74k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 6.74k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  6.74k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE_clES5_i:
 3979|  7.28k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
_ZN3glz10fast_float10round_downERNS0_17adjusted_mantissaEi:
 3762|  7.28k|round_down(adjusted_mantissa &am, int32_t shift) noexcept {
 3763|  7.28k|  if (shift == 64) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 7.28k]
  ------------------
 3764|      0|    am.mantissa = 0;
 3765|  7.28k|  } else {
 3766|  7.28k|    am.mantissa >>= shift;
 3767|  7.28k|  }
 3768|  7.28k|  am.power2 += shift;
 3769|  7.28k|}
_ZN3glz10fast_float19to_extended_halfwayIdEENS0_17adjusted_mantissaET_:
 3696|  7.28k|to_extended_halfway(T value) noexcept {
 3697|  7.28k|  adjusted_mantissa am = to_extended(value);
 3698|  7.28k|  am.mantissa <<= 1;
 3699|  7.28k|  am.mantissa += 1;
 3700|  7.28k|  am.power2 -= 1;
 3701|  7.28k|  return am;
 3702|  7.28k|}
_ZN3glz10fast_float11to_extendedIdEENS0_17adjusted_mantissaET_:
 3661|  7.28k|to_extended(T value) noexcept {
 3662|  7.28k|  using equiv_uint = equiv_uint_t<T>;
 3663|  7.28k|  constexpr equiv_uint exponent_mask = binary_format<T>::exponent_mask();
 3664|  7.28k|  constexpr equiv_uint mantissa_mask = binary_format<T>::mantissa_mask();
 3665|  7.28k|  constexpr equiv_uint hidden_bit_mask = binary_format<T>::hidden_bit_mask();
 3666|       |
 3667|  7.28k|  adjusted_mantissa am;
 3668|  7.28k|  int32_t bias = binary_format<T>::mantissa_explicit_bits() -
 3669|  7.28k|                 binary_format<T>::minimum_exponent();
 3670|  7.28k|  equiv_uint bits;
 3671|  7.28k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 3672|  7.28k|  bits = std::bit_cast<equiv_uint>(value);
 3673|       |#else
 3674|       |  ::memcpy(&bits, &value, sizeof(T));
 3675|       |#endif
 3676|  7.28k|  if ((bits & exponent_mask) == 0) {
  ------------------
  |  Branch (3676:7): [True: 538, False: 6.74k]
  ------------------
 3677|       |    // denormal
 3678|    538|    am.power2 = 1 - bias;
 3679|    538|    am.mantissa = bits & mantissa_mask;
 3680|  6.74k|  } else {
 3681|       |    // normal
 3682|  6.74k|    am.power2 = int32_t((bits & exponent_mask) >>
 3683|  6.74k|                        binary_format<T>::mantissa_explicit_bits());
 3684|  6.74k|    am.power2 -= bias;
 3685|  6.74k|    am.mantissa = (bits & mantissa_mask) | hidden_bit_mask;
 3686|  6.74k|  }
 3687|       |
 3688|  7.28k|  return am;
 3689|  7.28k|}
_ZN3glz10fast_float6bigintC2Em:
 3406|  7.28k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint(uint64_t value) : vec() {
 3407|  7.28k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3408|  7.28k|    vec.push_unchecked(value);
 3409|       |#else
 3410|       |    vec.push_unchecked(uint32_t(value));
 3411|       |    vec.push_unchecked(uint32_t(value >> 32));
 3412|       |#endif
 3413|  7.28k|    vec.normalize();
 3414|  7.28k|  }
_ZNK3glz10fast_float6bigint7compareERKS1_:
 3451|  7.28k|  GLZ_FASTFLOAT_CONSTEXPR20 int compare(bigint const &other) const noexcept {
 3452|  7.28k|    if (vec.len() > other.vec.len()) {
  ------------------
  |  Branch (3452:9): [True: 0, False: 7.28k]
  ------------------
 3453|      0|      return 1;
 3454|  7.28k|    } else if (vec.len() < other.vec.len()) {
  ------------------
  |  Branch (3454:16): [True: 0, False: 7.28k]
  ------------------
 3455|      0|      return -1;
 3456|  7.28k|    } else {
 3457|  25.4k|      for (size_t index = vec.len(); index > 0; index--) {
  ------------------
  |  Branch (3457:38): [True: 24.9k, False: 432]
  ------------------
 3458|  24.9k|        limb xi = vec[index - 1];
 3459|  24.9k|        limb yi = other.vec[index - 1];
 3460|  24.9k|        if (xi > yi) {
  ------------------
  |  Branch (3460:13): [True: 3.53k, False: 21.4k]
  ------------------
 3461|  3.53k|          return 1;
 3462|  21.4k|        } else if (xi < yi) {
  ------------------
  |  Branch (3462:20): [True: 3.31k, False: 18.1k]
  ------------------
 3463|  3.31k|          return -1;
 3464|  3.31k|        }
 3465|  24.9k|      }
 3466|    432|      return 0;
 3467|  7.28k|    }
 3468|  7.28k|  }
_ZNK3glz10fast_float8stackvecILt62EEixEm:
 3022|  49.9k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &operator[](size_t index) const noexcept {
 3023|  49.9k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  49.9k|  { ((void)(x)); }
  ------------------
 3024|  49.9k|    return data[index];
 3025|  49.9k|  }
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE0_EEvS6_T0_:
 3707|  7.28k|                                                         callback cb) noexcept {
 3708|  7.28k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  7.28k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 538, False: 6.74k]
  ------------------
 3710|       |    // have a denormal float
 3711|    538|    int32_t shift = -am.power2 + 1;
 3712|    538|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    538|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 538, False: 0]
  ------------------
 3715|    538|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    538|                    ? 0
 3717|    538|                    : 1;
 3718|    538|    return;
 3719|    538|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  6.74k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  6.74k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 274, False: 6.47k]
  ------------------
 3726|  6.74k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|    274|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|    274|    am.power2++;
 3729|    274|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  6.74k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  6.74k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 6.74k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  6.74k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_i:
 4001|  7.28k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  7.28k|    round_nearest_tie_even(
 4003|  7.28k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.28k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.28k|          (void)__; // not needed, since we've done our comparison
 4006|  7.28k|          if (ord > 0) {
 4007|  7.28k|            return true;
 4008|  7.28k|          } else if (ord < 0) {
 4009|  7.28k|            return false;
 4010|  7.28k|          } else {
 4011|  7.28k|            return is_odd;
 4012|  7.28k|          }
 4013|  7.28k|        });
 4014|  7.28k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iENKUlRS3_iE0_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  7.28k|                       callback cb) noexcept {
 3743|  7.28k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 7.28k]
  ------------------
 3744|  7.28k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 7.28k]
  ------------------
 3745|  7.28k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  7.28k|  bool is_above = truncated_bits > halfway;
 3747|  7.28k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  7.28k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 7.28k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  7.28k|  } else {
 3753|  7.28k|    am.mantissa >>= shift;
 3754|  7.28k|  }
 3755|  7.28k|  am.power2 += shift;
 3756|       |
 3757|  7.28k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  7.28k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  7.28k|}
_ZZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_iENKUlbbbE_clEbbb:
 4003|  7.28k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.28k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.28k|          (void)__; // not needed, since we've done our comparison
 4006|  7.28k|          if (ord > 0) {
  ------------------
  |  Branch (4006:15): [True: 3.53k, False: 3.74k]
  ------------------
 4007|  3.53k|            return true;
 4008|  3.74k|          } else if (ord < 0) {
  ------------------
  |  Branch (4008:22): [True: 3.31k, False: 432]
  ------------------
 4009|  3.31k|            return false;
 4010|  3.31k|          } else {
 4011|    432|            return is_odd;
 4012|    432|          }
 4013|  7.28k|        });
_ZN3glz10fast_float8to_floatIdEEvbNS0_17adjusted_mantissaERT_:
 1131|   101k|to_float(bool negative, adjusted_mantissa am, T &value) {
 1132|   101k|  using equiv_uint = equiv_uint_t<T>;
 1133|   101k|  equiv_uint word = equiv_uint(am.mantissa);
 1134|   101k|  word = equiv_uint(word | equiv_uint(am.power2)
 1135|   101k|                               << binary_format<T>::mantissa_explicit_bits());
 1136|   101k|  word =
 1137|   101k|      equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
 1138|   101k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 1139|   101k|  value = std::bit_cast<T>(word);
 1140|       |#else
 1141|       |  ::memcpy(&value, &word, sizeof(T));
 1142|       |#endif
 1143|   101k|}
_ZN3glz10fast_float13binary_formatIdE10sign_indexEv:
  758|   101k|template <> inline constexpr int binary_format<double>::sign_index() {
  759|   101k|  return 63;
  760|   101k|}
_ZN3glz10fast_float13binary_formatIdE14infinite_powerEv:
  750|   259k|template <> inline constexpr int binary_format<double>::infinite_power() {
  751|   259k|  return 0x7FF;
  752|   259k|}
_ZN3glz10fast_float15parse_options_tIcEC2ENS0_12chars_formatEci:
  217|  4.39M|      : format(fmt), decimal_point(dot), base(b) {}

_ZN3glz18code_point_to_utf8IcEEjjPT_:
  249|  6.20k|   {
  250|  6.20k|      if (code_point <= 0x7F) {
  ------------------
  |  Branch (250:11): [True: 1.16k, False: 5.04k]
  ------------------
  251|  1.16k|         c[0] = Char(code_point);
  252|  1.16k|         return 1;
  253|  1.16k|      }
  254|  5.04k|      if (code_point <= 0x7FF) {
  ------------------
  |  Branch (254:11): [True: 1.26k, False: 3.78k]
  ------------------
  255|  1.26k|         c[0] = Char(0xC0 | ((code_point >> 6) & 0x1F));
  256|  1.26k|         c[1] = Char(0x80 | (code_point & 0x3F));
  257|  1.26k|         return 2;
  258|  1.26k|      }
  259|  3.78k|      if (code_point <= 0xFFFF) {
  ------------------
  |  Branch (259:11): [True: 3.57k, False: 206]
  ------------------
  260|  3.57k|         c[0] = Char(0xE0 | ((code_point >> 12) & 0x0F));
  261|  3.57k|         c[1] = Char(0x80 | ((code_point >> 6) & 0x3F));
  262|  3.57k|         c[2] = Char(0x80 | (code_point & 0x3F));
  263|  3.57k|         return 3;
  264|  3.57k|      }
  265|    206|      if (code_point <= 0x10FFFF) {
  ------------------
  |  Branch (265:11): [True: 206, False: 0]
  ------------------
  266|    206|         c[0] = Char(0xF0 | ((code_point >> 18) & 0x07));
  267|    206|         c[1] = Char(0x80 | ((code_point >> 12) & 0x3F));
  268|    206|         c[2] = Char(0x80 | ((code_point >> 6) & 0x3F));
  269|    206|         c[3] = Char(0x80 | (code_point & 0x3F));
  270|    206|         return 4;
  271|    206|      }
  272|      0|      return 0;
  273|    206|   }
_ZN3glz10hex_to_u32EPKc:
  224|  5.03k|   {
  225|  5.03k|      constexpr auto& t = digit_hex_table;
  226|  5.03k|      const uint8_t arr[4]{t[uint8_t(c[3])], t[uint8_t(c[2])], t[uint8_t(c[1])], t[uint8_t(c[0])]};
  227|  5.03k|      auto chunk = std::bit_cast<uint32_t>(arr);
  228|       |      // On big-endian, bit_cast produces bytes in opposite order than expected
  229|       |      // byteswap to get consistent little-endian representation
  230|       |      if constexpr (std::endian::native == std::endian::big) {
  231|       |         chunk = std::byteswap(chunk);
  232|       |      }
  233|       |      // check that all hex characters are valid
  234|  5.03k|      if (chunk & repeat_byte4(0b11110000u)) [[unlikely]] {
  ------------------
  |  Branch (234:11): [True: 106, False: 4.93k]
  ------------------
  235|    106|         return 0xFFFFFFFFu;
  236|    106|      }
  237|       |
  238|       |      // now pack into first four bytes of uint32_t
  239|  4.93k|      uint32_t packed{};
  240|  4.93k|      packed |= (chunk & 0x0000000F);
  241|  4.93k|      packed |= (chunk & 0x00000F00) >> 4;
  242|  4.93k|      packed |= (chunk & 0x000F0000) >> 8;
  243|  4.93k|      packed |= (chunk & 0x0F000000) >> 12;
  244|  4.93k|      return packed;
  245|  5.03k|   }

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

_ZNK3glz4yaml12yaml_context12indent_stackMUlvE_clEv:
  101|  8.40M|      std::vector<int16_t> indent_stack = [] {
  102|  8.40M|         std::vector<int16_t> v;
  103|  8.40M|         v.reserve(max_yaml_recursive_depth);
  104|  8.40M|         return v;
  105|  8.40M|      }();
_ZN3glz4yaml12yaml_context16reset_read_stateEv:
  342|   162k|      {
  343|   162k|         indent_stack.clear();
  344|   162k|         anchors.clear();
  345|   162k|         active_alias_spans.clear();
  346|   162k|         sequence_item_value_context = false;
  347|   162k|         forced_block_mapping_indent = -1;
  348|   162k|         sequence_dash_indent = -1;
  349|   162k|         explicit_mapping_key_context = false;
  350|   162k|         allow_indentless_sequence = false;
  351|   162k|         reset_line_memo();
  352|   162k|      }
_ZNK3glz4yaml12yaml_context15reset_line_memoEv:
  328|   162k|      {
  329|   162k|         memo_line_begin = nullptr;
  330|   162k|         memo_verified_end = nullptr;
  331|   162k|         memo_first_tab = nullptr;
  332|   162k|         memo_first_content = nullptr;
  333|   162k|      }
_ZN3glz4yaml19skip_document_startIRPKcS3_NS0_12yaml_contextEEEvOT_T0_RT1_:
 1205|   162k|   {
 1206|   162k|      ctx.secondary_tag_handle_overridden = false;
 1207|       |
 1208|       |      // Skip leading blank/comment-only lines before directives or document start.
 1209|   169k|      while (it != end) {
  ------------------
  |  Branch (1209:14): [True: 169k, False: 76]
  ------------------
 1210|   169k|         auto line = it;
 1211|   169k|         skip_inline_ws(line, end);
 1212|   169k|         if (line == end) {
  ------------------
  |  Branch (1212:14): [True: 20, False: 169k]
  ------------------
 1213|     20|            it = line;
 1214|     20|            break;
 1215|     20|         }
 1216|   169k|         if (*line == '#') {
  ------------------
  |  Branch (1216:14): [True: 1.20k, False: 168k]
  ------------------
 1217|  1.20k|            it = line;
 1218|  1.20k|            skip_comment(it, end);
 1219|  1.20k|            skip_newline(it, end);
 1220|  1.20k|            continue;
 1221|  1.20k|         }
 1222|   168k|         if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1222:14): [True: 2.05k, False: 165k]
  |  Branch (1222:31): [True: 3.28k, False: 162k]
  ------------------
 1223|  5.33k|            it = line;
 1224|  5.33k|            skip_newline(it, end);
 1225|  5.33k|            continue;
 1226|  5.33k|         }
 1227|   162k|         it = line;
 1228|   162k|         break;
 1229|   168k|      }
 1230|       |
 1231|       |      // Track if we've seen a %YAML directive (duplicates are an error per spec)
 1232|   162k|      bool seen_yaml_directive = false;
 1233|   162k|      bool saw_any_directive = false;
 1234|   162k|      bool consumed_document_start = false;
 1235|       |
 1236|       |      // Process YAML directives (lines starting with %) until we hit --- or content
 1237|       |      // Directives must appear at the start of a line and before ---
 1238|   168k|      while (it != end && *it == '%') {
  ------------------
  |  Branch (1238:14): [True: 167k, False: 652]
  |  Branch (1238:27): [True: 5.82k, False: 161k]
  ------------------
 1239|  5.82k|         saw_any_directive = true;
 1240|  5.82k|         ++it; // Skip the '%'
 1241|       |
 1242|       |         // Parse directive name
 1243|  5.82k|         auto name_start = it;
 1244|  26.0k|         while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1244:17): [True: 25.8k, False: 208]
  |  Branch (1244:30): [True: 24.0k, False: 1.83k]
  |  Branch (1244:44): [True: 21.5k, False: 2.51k]
  |  Branch (1244:59): [True: 20.8k, False: 632]
  |  Branch (1244:74): [True: 20.2k, False: 644]
  ------------------
 1245|  20.2k|            ++it;
 1246|  20.2k|         }
 1247|  5.82k|         std::string_view directive_name(name_start, static_cast<size_t>(it - name_start));
 1248|       |
 1249|       |         // Check for %YAML directive
 1250|  5.82k|         if (directive_name == "YAML") {
  ------------------
  |  Branch (1250:14): [True: 204, False: 5.62k]
  ------------------
 1251|       |            // Error on duplicate %YAML directive (per spec: "It is an error to specify
 1252|       |            // more than one YAML directive for the same document")
 1253|    204|            if (seen_yaml_directive) {
  ------------------
  |  Branch (1253:17): [True: 6, False: 198]
  ------------------
 1254|      6|               ctx.error = error_code::syntax_error;
 1255|      6|               return;
 1256|      6|            }
 1257|    198|            seen_yaml_directive = true;
 1258|       |
 1259|       |            // Skip whitespace before version
 1260|    806|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1260:20): [True: 788, False: 18]
  |  Branch (1260:34): [True: 400, False: 388]
  |  Branch (1260:48): [True: 208, False: 180]
  ------------------
 1261|    608|               ++it;
 1262|    608|            }
 1263|       |
 1264|       |            // Parse major.minor version and reject malformed forms.
 1265|    198|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1265:17): [True: 18, False: 180]
  |  Branch (1265:30): [True: 20, False: 160]
  |  Branch (1265:43): [True: 4, False: 156]
  ------------------
 1266|     42|               ctx.error = error_code::syntax_error;
 1267|     42|               return;
 1268|     42|            }
 1269|       |            // Clamp rather than accumulate without bound. An int accumulator overflows on a long
 1270|       |            // digit run -- undefined behavior, and in practice a wrap that carries a huge version
 1271|       |            // back into the accepted range, so "%YAML 4294967296.0" was read as major version 0.
 1272|       |            //
 1273|       |            // Clamping is safe because the accumulator only grows: it stops updating once it has
 1274|       |            // already reached max_tracked_version, so a clamped value is always at least that
 1275|       |            // large, and the clamp is far above the threshold checked below. A version big enough
 1276|       |            // to freeze the accumulator therefore still compares greater and is still rejected.
 1277|       |            // The bound is deliberately independent of that threshold, so raising the threshold
 1278|       |            // later cannot quietly reintroduce the wrap. Peak value is 999, well inside int.
 1279|    156|            constexpr int max_tracked_version = 100;
 1280|    156|            int major_version = 0;
 1281|    932|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1281:20): [True: 912, False: 20]
  |  Branch (1281:33): [True: 776, False: 136]
  |  Branch (1281:47): [True: 776, False: 0]
  ------------------
 1282|    776|               if (major_version < max_tracked_version) {
  ------------------
  |  Branch (1282:20): [True: 448, False: 328]
  ------------------
 1283|    448|                  major_version = major_version * 10 + (*it - '0');
 1284|    448|               }
 1285|    776|               ++it;
 1286|    776|            }
 1287|    156|            if (it == end || *it != '.') {
  ------------------
  |  Branch (1287:17): [True: 20, False: 136]
  |  Branch (1287:30): [True: 40, False: 96]
  ------------------
 1288|     60|               ctx.error = error_code::syntax_error;
 1289|     60|               return;
 1290|     60|            }
 1291|     96|            ++it; // skip '.'
 1292|     96|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1292:17): [True: 2, False: 94]
  |  Branch (1292:30): [True: 6, False: 88]
  |  Branch (1292:43): [True: 4, False: 84]
  ------------------
 1293|     12|               ctx.error = error_code::syntax_error;
 1294|     12|               return;
 1295|     12|            }
 1296|    356|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1296:20): [True: 348, False: 8]
  |  Branch (1296:33): [True: 272, False: 76]
  |  Branch (1296:47): [True: 272, False: 0]
  ------------------
 1297|    272|               ++it;
 1298|    272|            }
 1299|       |
 1300|       |            // Check for major version > 1 (per spec: should be rejected)
 1301|     84|            if (major_version > 1) {
  ------------------
  |  Branch (1301:17): [True: 12, False: 72]
  ------------------
 1302|     12|               ctx.error = error_code::syntax_error;
 1303|     12|               return;
 1304|     12|            }
 1305|       |
 1306|       |            // After the version, only spaces/tabs and optional comment are allowed.
 1307|       |            // A '#' must be separated by at least one space.
 1308|     72|            if (it != end && *it == '#') {
  ------------------
  |  Branch (1308:17): [True: 68, False: 4]
  |  Branch (1308:30): [True: 4, False: 64]
  ------------------
 1309|      4|               ctx.error = error_code::syntax_error;
 1310|      4|               return;
 1311|      4|            }
 1312|    468|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1312:20): [True: 456, False: 12]
  |  Branch (1312:34): [True: 192, False: 264]
  |  Branch (1312:48): [True: 208, False: 56]
  ------------------
 1313|    400|               ++it;
 1314|    400|            }
 1315|     68|            if (it != end && *it != '\n' && *it != '\r' && *it != '#') {
  ------------------
  |  Branch (1315:17): [True: 56, False: 12]
  |  Branch (1315:30): [True: 52, False: 4]
  |  Branch (1315:45): [True: 40, False: 12]
  |  Branch (1315:60): [True: 36, False: 4]
  ------------------
 1316|     36|               ctx.error = error_code::syntax_error;
 1317|     36|               return;
 1318|     36|            }
 1319|     68|         }
 1320|  5.62k|         else if (directive_name == "TAG") {
  ------------------
  |  Branch (1320:19): [True: 2.67k, False: 2.95k]
  ------------------
 1321|  6.91k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1321:20): [True: 6.89k, False: 20]
  |  Branch (1321:34): [True: 2.26k, False: 4.62k]
  |  Branch (1321:48): [True: 1.97k, False: 2.65k]
  ------------------
 1322|  4.24k|               ++it;
 1323|  4.24k|            }
 1324|       |
 1325|  2.67k|            auto handle_start = it;
 1326|  10.9k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1326:20): [True: 10.8k, False: 74]
  |  Branch (1326:33): [True: 8.57k, False: 2.30k]
  |  Branch (1326:47): [True: 8.29k, False: 284]
  |  Branch (1326:62): [True: 8.28k, False: 8]
  |  Branch (1326:77): [True: 8.28k, False: 4]
  ------------------
 1327|  8.28k|               ++it;
 1328|  8.28k|            }
 1329|  2.67k|            const std::string_view handle(handle_start, static_cast<size_t>(it - handle_start));
 1330|       |
 1331|  6.05k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1331:20): [True: 5.96k, False: 94]
  |  Branch (1331:34): [True: 2.92k, False: 3.04k]
  |  Branch (1331:48): [True: 464, False: 2.57k]
  ------------------
 1332|  3.38k|               ++it;
 1333|  3.38k|            }
 1334|       |
 1335|  2.67k|            auto prefix_start = it;
 1336|  16.9k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1336:20): [True: 16.7k, False: 158]
  |  Branch (1336:33): [True: 15.3k, False: 1.46k]
  |  Branch (1336:47): [True: 15.1k, False: 208]
  |  Branch (1336:62): [True: 14.5k, False: 608]
  |  Branch (1336:77): [True: 14.2k, False: 228]
  ------------------
 1337|  14.2k|               ++it;
 1338|  14.2k|            }
 1339|  2.67k|            const std::string_view prefix(prefix_start, static_cast<size_t>(it - prefix_start));
 1340|       |
 1341|  2.67k|            if (handle.empty() || prefix.empty()) {
  ------------------
  |  Branch (1341:17): [True: 28, False: 2.64k]
  |  Branch (1341:35): [True: 78, False: 2.56k]
  ------------------
 1342|    106|               ctx.error = error_code::syntax_error;
 1343|    106|               return;
 1344|    106|            }
 1345|       |
 1346|  2.56k|            if (handle == "!!") {
  ------------------
  |  Branch (1346:17): [True: 706, False: 1.85k]
  ------------------
 1347|    706|               ctx.secondary_tag_handle_overridden = (prefix != "tag:yaml.org,2002:");
 1348|    706|            }
 1349|  2.56k|         }
 1350|       |         // %TAG and other directives are silently skipped (per spec: should be ignored)
 1351|       |
 1352|       |         // Skip to end of directive line
 1353|  62.9k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1353:17): [True: 62.5k, False: 446]
  |  Branch (1353:30): [True: 59.3k, False: 3.18k]
  |  Branch (1353:45): [True: 57.4k, False: 1.92k]
  ------------------
 1354|  57.4k|            ++it;
 1355|  57.4k|         }
 1356|       |         // Skip the newline
 1357|  5.55k|         skip_newline(it, end);
 1358|       |         // Skip blank and comment-only lines between directives and document start.
 1359|  7.53k|         while (it != end) {
  ------------------
  |  Branch (1359:17): [True: 6.99k, False: 544]
  ------------------
 1360|  6.99k|            auto line = it;
 1361|  6.99k|            skip_inline_ws(line, end);
 1362|  6.99k|            if (line == end) {
  ------------------
  |  Branch (1362:17): [True: 12, False: 6.97k]
  ------------------
 1363|     12|               it = line;
 1364|     12|               break;
 1365|     12|            }
 1366|  6.97k|            if (*line == '#') {
  ------------------
  |  Branch (1366:17): [True: 692, False: 6.28k]
  ------------------
 1367|    692|               it = line;
 1368|    692|               skip_comment(it, end);
 1369|    692|               skip_newline(it, end);
 1370|    692|               continue;
 1371|    692|            }
 1372|  6.28k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1372:17): [True: 532, False: 5.75k]
  |  Branch (1372:34): [True: 760, False: 4.99k]
  ------------------
 1373|  1.29k|               it = line;
 1374|  1.29k|               skip_newline(it, end);
 1375|  1.29k|               continue;
 1376|  1.29k|            }
 1377|  4.99k|            break;
 1378|  6.28k|         }
 1379|  5.55k|      }
 1380|       |
 1381|       |      // Check for ---
 1382|   162k|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1382:11): [True: 160k, False: 2.05k]
  |  Branch (1382:28): [True: 4.49k, False: 155k]
  |  Branch (1382:44): [True: 350, False: 4.14k]
  |  Branch (1382:60): [True: 288, False: 62]
  ------------------
 1383|    288|         auto after = it + 3;
 1384|       |         // Must be followed by whitespace, newline, or end
 1385|    288|         if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' || *after == '#') {
  ------------------
  |  Branch (1385:14): [True: 4, False: 284]
  |  Branch (1385:30): [True: 40, False: 244]
  |  Branch (1385:47): [True: 84, False: 160]
  |  Branch (1385:65): [True: 48, False: 112]
  |  Branch (1385:83): [True: 28, False: 84]
  |  Branch (1385:101): [True: 28, False: 56]
  ------------------
 1386|    232|            auto content = after;
 1387|    696|            while (content != end && (*content == ' ' || *content == '\t')) {
  ------------------
  |  Branch (1387:20): [True: 674, False: 22]
  |  Branch (1387:39): [True: 212, False: 462]
  |  Branch (1387:58): [True: 252, False: 210]
  ------------------
 1388|    464|               ++content;
 1389|    464|            }
 1390|       |            // Per yaml-test-suite, block mappings cannot begin on the same line as '---'.
 1391|    232|            if (content != end && *content != '\n' && *content != '\r' && *content != '#' &&
  ------------------
  |  Branch (1391:17): [True: 210, False: 22]
  |  Branch (1391:35): [True: 162, False: 48]
  |  Branch (1391:55): [True: 130, False: 32]
  |  Branch (1391:75): [True: 102, False: 28]
  ------------------
 1392|    102|                line_could_be_block_mapping(content, end)) {
  ------------------
  |  Branch (1392:17): [True: 22, False: 80]
  ------------------
 1393|     22|               ctx.error = error_code::syntax_error;
 1394|     22|               return;
 1395|     22|            }
 1396|    210|            consumed_document_start = true;
 1397|    210|            it = after;
 1398|       |            // Skip rest of line (whitespace and optional comment)
 1399|    210|            skip_ws_and_comment(it, end);
 1400|    210|            skip_newline(it, end);
 1401|    210|         }
 1402|    288|      }
 1403|       |
 1404|       |      // A directives section must be followed by a document start marker.
 1405|   162k|      if (saw_any_directive && !consumed_document_start) {
  ------------------
  |  Branch (1405:11): [True: 790, False: 161k]
  |  Branch (1405:32): [True: 768, False: 22]
  ------------------
 1406|    768|         ctx.error = error_code::syntax_error;
 1407|    768|         return;
 1408|    768|      }
 1409|   162k|   }
_ZN3glz4yaml14skip_inline_wsIRPKcS3_EEvOT_T0_:
  901|   147M|   {
  902|   183M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (902:14): [True: 182M, False: 1.01M]
  |  Branch (902:28): [True: 35.0M, False: 147M]
  |  Branch (902:42): [True: 1.28M, False: 146M]
  ------------------
  903|  36.3M|         ++it;
  904|  36.3M|      }
  905|   147M|   }
_ZN3glz4yaml12skip_commentIRPKcS3_EEvOT_T0_:
  910|  7.90M|   {
  911|  7.90M|      if (it != end && *it == '#') {
  ------------------
  |  Branch (911:11): [True: 7.21M, False: 687k]
  |  Branch (911:24): [True: 1.63M, False: 5.58M]
  ------------------
  912|       |         // Stops on a forbidden control byte rather than consuming it, leaving the
  913|       |         // caller's line-end validation to reject the document.
  914|  91.8M|         while (it != end && !comment_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (914:17): [True: 91.8M, False: 62.2k]
  |  Branch (914:30): [True: 90.2M, False: 1.56M]
  ------------------
  915|  90.2M|            ++it;
  916|  90.2M|         }
  917|  1.63M|      }
  918|  7.90M|   }
_ZN3glz4yaml27line_could_be_block_mappingIPKcS3_EEbT_T0_:
 1116|  3.25M|   {
 1117|  3.25M|      const auto stop = implicit_key_scan_end(it, end);
 1118|       |      // A quote is an indicator only where a node can begin. Once a plain scalar is under way it
 1119|       |      // runs to the end of the line, and the spaces and quotes inside it are content ("a 'b'" is
 1120|       |      // one plain scalar, "a '''" likewise), so the guard is whether a node starts here rather
 1121|       |      // than what the preceding character was. A node starts at the beginning of the scan, after
 1122|       |      // an indicator that ends the node before it, and after the properties that precede one. The
 1123|       |      // other implicit-key probes carry the same model and point here for it.
 1124|  3.25M|      bool at_node_start = true;
 1125|  3.25M|      bool prev_was_whitespace = true; // For the '#' rule, which is about the preceding character
 1126|  3.25M|      int flow_depth = 0;
 1127|  43.3M|      while (it != stop) {
  ------------------
  |  Branch (1127:14): [True: 42.9M, False: 312k]
  ------------------
 1128|  42.9M|         const char c = *it;
 1129|  42.9M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1129:14): [True: 638k, False: 42.3M]
  |  Branch (1129:27): [True: 919k, False: 41.4M]
  ------------------
 1130|  1.55M|            return false;
 1131|  1.55M|         }
 1132|  41.4M|         if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1132:14): [True: 5.98M, False: 35.4M]
  |  Branch (1132:26): [True: 719k, False: 34.7M]
  ------------------
 1133|  6.70M|            prev_was_whitespace = true; // Whitespace separates nodes, it does not end one
 1134|  6.70M|            ++it;
 1135|  6.70M|            continue;
 1136|  6.70M|         }
 1137|       |         // Past here `c` is an indicator or content. Either way it ends a run of whitespace, and
 1138|       |         // unless a branch below says otherwise it begins a plain scalar that owns the rest of the
 1139|       |         // line, so both flags clear by default and a branch opts back in.
 1140|  34.7M|         const bool after_whitespace = std::exchange(prev_was_whitespace, false);
 1141|  34.7M|         const bool node_start = std::exchange(at_node_start, false);
 1142|       |
 1143|  34.7M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (1143:14): [True: 2.89M, False: 31.8M]
  |  Branch (1143:26): [True: 2.15M, False: 736k]
  ------------------
 1144|  2.15M|            ++it;
 1145|       |            // Colon followed by space, newline, or end indicates a mapping key
 1146|  2.15M|            if (it == end || *it == ' ' || *it == '\t' || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1146:17): [True: 110k, False: 2.04M]
  |  Branch (1146:30): [True: 809k, False: 1.23M]
  |  Branch (1146:44): [True: 62.3k, False: 1.17M]
  |  Branch (1146:59): [True: 133k, False: 1.04M]
  |  Branch (1146:74): [True: 143k, False: 899k]
  ------------------
 1147|  1.25M|               return true;
 1148|  1.25M|            }
 1149|       |            // Otherwise this ':' is part of plain content (e.g., "::", "http://").
 1150|       |            // Continue scanning for a later mapping separator on the same line.
 1151|   899k|            continue;
 1152|  2.15M|         }
 1153|       |         // Per YAML spec: # only starts a comment when preceded by whitespace
 1154|       |         // Stop scanning if we hit a comment - any colon after is not a key indicator
 1155|  32.5M|         if (c == '#' && flow_depth == 0 && after_whitespace) {
  ------------------
  |  Branch (1155:14): [True: 897k, False: 31.6M]
  |  Branch (1155:26): [True: 785k, False: 112k]
  |  Branch (1155:45): [True: 95.9k, False: 689k]
  ------------------
 1156|  95.9k|            return false;
 1157|  95.9k|         }
 1158|  32.4M|         if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (1158:15): [True: 372k, False: 32.1M]
  |  Branch (1158:27): [True: 73.4k, False: 32.0M]
  |  Branch (1158:41): [True: 260k, False: 185k]
  ------------------
 1159|   260k|            if (not skip_probe_quoted_scalar(it, stop)) {
  ------------------
  |  Branch (1159:17): [True: 30.0k, False: 230k]
  ------------------
 1160|  30.0k|               return false;
 1161|  30.0k|            }
 1162|   230k|            continue;
 1163|   260k|         }
 1164|       |         // A flow collection opens only where a node can begin, and thereafter every bracket is
 1165|       |         // an indicator because ns-plain-safe-in excludes them. In block context a plain scalar
 1166|       |         // already under way swallows them instead: "a['][]" is one plain key.
 1167|  32.2M|         if ((c == '[' || c == '{') && (node_start || flow_depth > 0)) {
  ------------------
  |  Branch (1167:15): [True: 438k, False: 31.7M]
  |  Branch (1167:27): [True: 846k, False: 30.9M]
  |  Branch (1167:41): [True: 954k, False: 331k]
  |  Branch (1167:55): [True: 130k, False: 201k]
  ------------------
 1168|  1.08M|            ++flow_depth;
 1169|  1.08M|            at_node_start = true;
 1170|  1.08M|            ++it;
 1171|  1.08M|            continue;
 1172|  1.08M|         }
 1173|  31.1M|         if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (1173:15): [True: 178k, False: 30.9M]
  |  Branch (1173:27): [True: 498k, False: 30.4M]
  |  Branch (1173:40): [True: 204k, False: 473k]
  ------------------
 1174|   204k|            --flow_depth; // A closing bracket ends a node; it never starts one
 1175|   204k|            ++it;
 1176|   204k|            continue;
 1177|   204k|         }
 1178|       |         // Inside a flow collection ',' separates entries and ':' ends a key, so a node begins
 1179|       |         // after either. Outside one both are ordinary plain content -- ns-plain-safe-out admits
 1180|       |         // them, which is why "a,'b: c" is a single plain key and "a[b]'c: d" another.
 1181|  30.9M|         if (flow_depth > 0 && (c == ',' || c == ':')) {
  ------------------
  |  Branch (1181:14): [True: 6.68M, False: 24.2M]
  |  Branch (1181:33): [True: 481k, False: 6.20M]
  |  Branch (1181:45): [True: 736k, False: 5.46M]
  ------------------
 1182|  1.21M|            at_node_start = true;
 1183|  1.21M|            ++it;
 1184|  1.21M|            continue;
 1185|  1.21M|         }
 1186|  29.7M|         if (node_start && skip_probe_node_property(it, stop)) {
  ------------------
  |  Branch (1186:14): [True: 4.34M, False: 25.3M]
  |  Branch (1186:28): [True: 1.42M, False: 2.92M]
  ------------------
 1187|  1.42M|            at_node_start = true; // Properties precede the node, so it is still starting
 1188|  1.42M|            continue;
 1189|  1.42M|         }
 1190|  28.2M|         ++it;
 1191|  28.2M|      }
 1192|   312k|      return false;
 1193|  3.25M|   }
_ZN3glz4yaml21implicit_key_scan_endIPKcS3_EET_S4_T0_:
   89|  16.6M|   {
   90|  16.6M|      const size_t remaining = size_t(end - it);
   91|  16.6M|      return it + (remaining < max_implicit_key_lookahead ? remaining : max_implicit_key_lookahead);
  ------------------
  |  Branch (91:20): [True: 13.0M, False: 3.54M]
  ------------------
   92|  16.6M|   }
_ZN3glz4yaml24skip_probe_quoted_scalarIPKcS3_EEbRT_T0_:
 1049|  2.17M|   {
 1050|  2.17M|      const char quote = *it;
 1051|  2.17M|      ++it;
 1052|  10.1M|      while (it != stop) {
  ------------------
  |  Branch (1052:14): [True: 10.1M, False: 15.6k]
  ------------------
 1053|  10.1M|         const char c = *it;
 1054|  10.1M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1054:14): [True: 20.7k, False: 10.1M]
  |  Branch (1054:27): [True: 60.0k, False: 10.0M]
  ------------------
 1055|  80.8k|            return false;
 1056|  80.8k|         }
 1057|  10.0M|         if (c == quote) {
  ------------------
  |  Branch (1057:14): [True: 2.05M, False: 7.98M]
  ------------------
 1058|  2.05M|            ++it;
 1059|  2.05M|            if (quote == '\'' && it != stop && *it == '\'') {
  ------------------
  |  Branch (1059:17): [True: 159k, False: 1.89M]
  |  Branch (1059:34): [True: 153k, False: 6.54k]
  |  Branch (1059:48): [True: 8.81k, False: 144k]
  ------------------
 1060|  8.81k|               ++it; // '' is an escaped quote, not the end of the scalar
 1061|  8.81k|               continue;
 1062|  8.81k|            }
 1063|       |            // A closing quote on the last byte of the window reports closed, though the byte past
 1064|       |            // it could have made the pair an escape. Harmless: `it` is then `stop`, so the caller's
 1065|       |            // loop ends and the probe answers false either way.
 1066|  2.04M|            return true;
 1067|  2.05M|         }
 1068|  7.98M|         if (c == '\\' && quote == '"') {
  ------------------
  |  Branch (1068:14): [True: 89.4k, False: 7.89M]
  |  Branch (1068:27): [True: 79.9k, False: 9.53k]
  ------------------
 1069|  79.9k|            ++it; // Skip escape character
 1070|  79.9k|            if (it == stop) {
  ------------------
  |  Branch (1070:17): [True: 6.90k, False: 73.0k]
  ------------------
 1071|  6.90k|               return false;
 1072|  6.90k|            }
 1073|  73.0k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1073:17): [True: 9.50k, False: 63.5k]
  |  Branch (1073:32): [True: 14.8k, False: 48.6k]
  ------------------
 1074|  24.3k|               return false;
 1075|  24.3k|            }
 1076|  73.0k|         }
 1077|  7.95M|         ++it;
 1078|  7.95M|      }
 1079|  15.6k|      return false;
 1080|  2.17M|   }
_ZN3glz4yaml24skip_probe_node_propertyIPKcS3_EEbRT_T0_:
 1088|  22.5M|   {
 1089|  22.5M|      const char c = *it;
 1090|  22.5M|      if (c == '&' || c == '!') {
  ------------------
  |  Branch (1090:11): [True: 2.93M, False: 19.5M]
  |  Branch (1090:23): [True: 1.20M, False: 18.3M]
  ------------------
 1091|       |         // An anchor name and a tag shorthand both run to the next whitespace or flow indicator.
 1092|  4.14M|         ++it;
 1093|   774M|         while (it != stop && *it != ' ' && *it != '\t' && *it != ',' && *it != '[' && *it != ']' && *it != '{' &&
  ------------------
  |  Branch (1093:17): [True: 774M, False: 178k]
  |  Branch (1093:31): [True: 772M, False: 2.24M]
  |  Branch (1093:45): [True: 771M, False: 596k]
  |  Branch (1093:60): [True: 771M, False: 79.0k]
  |  Branch (1093:74): [True: 771M, False: 85.6k]
  |  Branch (1093:88): [True: 771M, False: 33.0k]
  |  Branch (1093:102): [True: 771M, False: 374k]
  ------------------
 1094|   771M|                *it != '}' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1094:17): [True: 771M, False: 92.5k]
  |  Branch (1094:31): [True: 770M, False: 224k]
  |  Branch (1094:46): [True: 770M, False: 229k]
  ------------------
 1095|   770M|            ++it;
 1096|   770M|         }
 1097|  4.14M|         return true;
 1098|  4.14M|      }
 1099|       |      // Only "? " is the explicit key indicator; "?foo" is an ordinary plain scalar.
 1100|  18.3M|      if (c == '?') {
  ------------------
  |  Branch (1100:11): [True: 1.05M, False: 17.3M]
  ------------------
 1101|  1.05M|         const auto next = it + 1;
 1102|  1.05M|         if (next != stop && (*next == ' ' || *next == '\t')) {
  ------------------
  |  Branch (1102:14): [True: 1.03M, False: 14.1k]
  |  Branch (1102:31): [True: 271k, False: 766k]
  |  Branch (1102:47): [True: 3.83k, False: 762k]
  ------------------
 1103|   275k|            ++it;
 1104|   275k|            return true;
 1105|   275k|         }
 1106|  1.05M|      }
 1107|  18.1M|      return false;
 1108|  18.3M|   }
_ZN3glz4yaml19skip_ws_and_commentIRPKcS3_EEvOT_T0_:
  923|  2.17M|   {
  924|  2.17M|      skip_inline_ws(it, end);
  925|  2.17M|      skip_comment(it, end);
  926|  2.17M|   }
_ZN3glz4yaml17at_document_startIRPKcS3_EEbOT_T0_:
 1415|  7.52M|   {
 1416|  7.52M|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1416:11): [True: 7.30M, False: 220k]
  |  Branch (1416:28): [True: 478k, False: 6.82M]
  |  Branch (1416:44): [True: 38.4k, False: 439k]
  |  Branch (1416:60): [True: 24.4k, False: 14.0k]
  ------------------
 1417|  24.4k|         auto after = it + 3;
 1418|  24.4k|         return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r';
  ------------------
  |  Branch (1418:17): [True: 4.27k, False: 20.1k]
  |  Branch (1418:33): [True: 5.47k, False: 14.6k]
  |  Branch (1418:50): [True: 3.07k, False: 11.5k]
  |  Branch (1418:68): [True: 4.10k, False: 7.47k]
  |  Branch (1418:86): [True: 1.27k, False: 6.19k]
  ------------------
 1419|  24.4k|      }
 1420|  7.50M|      return false;
 1421|  7.52M|   }
_ZN3glz4yaml15at_document_endIRPKcS3_EEbOT_T0_:
 1427|  9.71M|   {
 1428|  9.71M|      if (end - it >= 3 && it[0] == '.' && it[1] == '.' && it[2] == '.') {
  ------------------
  |  Branch (1428:11): [True: 9.36M, False: 347k]
  |  Branch (1428:28): [True: 199k, False: 9.16M]
  |  Branch (1428:44): [True: 122k, False: 76.8k]
  |  Branch (1428:60): [True: 97.6k, False: 24.5k]
  ------------------
 1429|  97.6k|         auto after = it + 3;
 1430|   247k|         while (after != end && (*after == ' ' || *after == '\t')) ++after;
  ------------------
  |  Branch (1430:17): [True: 220k, False: 27.3k]
  |  Branch (1430:34): [True: 85.6k, False: 134k]
  |  Branch (1430:51): [True: 64.5k, False: 70.2k]
  ------------------
 1431|  97.6k|         return after == end || *after == '\n' || *after == '\r' || *after == '#';
  ------------------
  |  Branch (1431:17): [True: 27.3k, False: 70.2k]
  |  Branch (1431:33): [True: 23.8k, False: 46.4k]
  |  Branch (1431:51): [True: 12.2k, False: 34.2k]
  |  Branch (1431:69): [True: 10.1k, False: 24.0k]
  ------------------
 1432|  97.6k|      }
 1433|  9.61M|      return false;
 1434|  9.71M|   }
_ZN3glz4yaml25skip_ws_newlines_commentsIRPKcS3_EEvOT_T0_:
  966|  18.6M|   {
  967|  20.3M|      while (it != end) {
  ------------------
  |  Branch (967:14): [True: 20.3M, False: 1.06k]
  ------------------
  968|  20.3M|         if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (968:14): [True: 1.32M, False: 18.9M]
  |  Branch (968:28): [True: 29.6k, False: 18.9M]
  ------------------
  969|  1.35M|            ++it;
  970|  1.35M|         }
  971|  18.9M|         else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (971:19): [True: 85.0k, False: 18.8M]
  |  Branch (971:34): [True: 146k, False: 18.7M]
  ------------------
  972|   231k|            skip_newline(it, end);
  973|   231k|         }
  974|  18.7M|         else if (*it == '#') {
  ------------------
  |  Branch (974:19): [True: 49.1k, False: 18.6M]
  ------------------
  975|  49.1k|            skip_comment(it, end);
  976|  49.1k|         }
  977|  18.6M|         else {
  978|  18.6M|            break;
  979|  18.6M|         }
  980|  20.3M|      }
  981|  18.6M|   }
_ZN3glz4yaml17parse_anchor_nameIPKcS3_EENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEERT_T0_:
 1515|  18.3M|   {
 1516|  18.3M|      auto start = it;
 1517|  18.3M|      if (start == end) return {};
  ------------------
  |  Branch (1517:11): [True: 3.57k, False: 18.3M]
  ------------------
 1518|  3.22G|      while (it != end) {
  ------------------
  |  Branch (1518:14): [True: 3.22G, False: 222k]
  ------------------
 1519|  3.22G|         const char c = *it;
 1520|       |         // Per YAML, anchor names end at whitespace or flow indicators.
 1521|       |         // Colon is allowed in anchor names.
 1522|  3.22G|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == '[' || c == ']' || c == '{' ||
  ------------------
  |  Branch (1522:14): [True: 9.83M, False: 3.21G]
  |  Branch (1522:26): [True: 353k, False: 3.21G]
  |  Branch (1522:39): [True: 1.62M, False: 3.21G]
  |  Branch (1522:52): [True: 969k, False: 3.21G]
  |  Branch (1522:65): [True: 594k, False: 3.21G]
  |  Branch (1522:77): [True: 135k, False: 3.21G]
  |  Branch (1522:89): [True: 59.3k, False: 3.21G]
  |  Branch (1522:101): [True: 1.95M, False: 3.21G]
  ------------------
 1523|  3.21G|             c == '}') {
  ------------------
  |  Branch (1523:14): [True: 2.55M, False: 3.20G]
  ------------------
 1524|  18.0M|            break;
 1525|  18.0M|         }
 1526|  3.20G|         ++it;
 1527|  3.20G|      }
 1528|  18.3M|      return std::string_view(&*start, static_cast<size_t>(it - start));
 1529|  18.3M|   }
_ZNK3glz4yaml12yaml_context23transparent_string_hashclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  138|  70.0M|         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_:
  145|  14.2M|         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_:
  852|  35.7M|   {
  853|  35.7M|      return parse_yaml_tag(it, end, !ctx.secondary_tag_handle_overridden);
  854|  35.7M|   }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_EENS0_8yaml_tagERT_T0_b:
  733|  35.7M|   {
  734|  35.7M|      if (it == end || *it != '!') {
  ------------------
  |  Branch (734:11): [True: 0, False: 35.7M]
  |  Branch (734:24): [True: 33.4M, False: 2.30M]
  ------------------
  735|  33.4M|         return yaml_tag::none;
  736|  33.4M|      }
  737|       |
  738|  2.30M|      ++it; // skip first !
  739|       |
  740|  2.30M|      if (it == end) {
  ------------------
  |  Branch (740:11): [True: 774, False: 2.30M]
  ------------------
  741|    774|         return yaml_tag::unknown;
  742|    774|      }
  743|       |
  744|       |      // Check for !! (shorthand tag)
  745|  2.30M|      if (*it == '!') {
  ------------------
  |  Branch (745:11): [True: 1.37M, False: 926k]
  ------------------
  746|  1.37M|         ++it; // skip second !
  747|       |
  748|       |         // Read tag name
  749|  1.37M|         auto tag_start = it;
  750|   692M|         while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (750:17): [True: 691M, False: 5.54k]
  |  Branch (750:30): [True: 690M, False: 1.36M]
  ------------------
  751|   690M|            ++it;
  752|   690M|         }
  753|       |
  754|  1.37M|         std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  755|  1.37M|         if (tag_name.empty() || malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (755:14): [True: 980, False: 1.37M]
  |  Branch (755:34): [True: 0, False: 1.37M]
  ------------------
  756|    980|            return yaml_tag::unknown;
  757|    980|         }
  758|  1.37M|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (758:14): [True: 1.36M, False: 4.98k]
  |  Branch (758:27): [True: 464, False: 1.36M]
  ------------------
  759|    464|            return yaml_tag::unknown;
  760|    464|         }
  761|       |
  762|       |         // Skip whitespace after tag
  763|  3.84M|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (763:17): [True: 3.84M, False: 5.75k]
  |  Branch (763:31): [True: 1.80M, False: 2.03M]
  |  Branch (763:45): [True: 669k, False: 1.36M]
  ------------------
  764|  2.47M|            ++it;
  765|  2.47M|         }
  766|       |
  767|  1.37M|         if (!allow_core_schema_secondary_handle) {
  ------------------
  |  Branch (767:14): [True: 30, False: 1.37M]
  ------------------
  768|     30|            return yaml_tag::none;
  769|     30|         }
  770|       |
  771|       |         // Match known tags
  772|  1.37M|         if (tag_name == "str") return yaml_tag::str;
  ------------------
  |  Branch (772:14): [True: 48.7k, False: 1.32M]
  ------------------
  773|  1.32M|         if (tag_name == "int") return yaml_tag::int_tag;
  ------------------
  |  Branch (773:14): [True: 24.8k, False: 1.29M]
  ------------------
  774|  1.29M|         if (tag_name == "float") return yaml_tag::float_tag;
  ------------------
  |  Branch (774:14): [True: 23.7k, False: 1.27M]
  ------------------
  775|  1.27M|         if (tag_name == "bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (775:14): [True: 178k, False: 1.09M]
  ------------------
  776|  1.09M|         if (tag_name == "null") return yaml_tag::null_tag;
  ------------------
  |  Branch (776:14): [True: 9.70k, False: 1.08M]
  ------------------
  777|  1.08M|         if (tag_name == "map") return yaml_tag::map;
  ------------------
  |  Branch (777:14): [True: 191k, False: 895k]
  ------------------
  778|   895k|         if (tag_name == "seq") return yaml_tag::seq;
  ------------------
  |  Branch (778:14): [True: 178k, False: 716k]
  ------------------
  779|       |
  780|       |         // Unrecognized shorthand tag (e.g., !!omap) — ignore and parse value normally
  781|   716k|         return yaml_tag::none;
  782|   895k|      }
  783|       |
  784|       |      // Check for verbatim tag !<...>
  785|   926k|      if (*it == '<') {
  ------------------
  |  Branch (785:11): [True: 10.9k, False: 915k]
  ------------------
  786|  10.9k|         ++it;
  787|  10.9k|         auto tag_start = it;
  788|  3.81M|         while (it != end && *it != '>') {
  ------------------
  |  Branch (788:17): [True: 3.81M, False: 354]
  |  Branch (788:30): [True: 3.80M, False: 10.6k]
  ------------------
  789|  3.80M|            ++it;
  790|  3.80M|         }
  791|  10.9k|         if (it == end) {
  ------------------
  |  Branch (791:14): [True: 354, False: 10.6k]
  ------------------
  792|    354|            return yaml_tag::unknown;
  793|    354|         }
  794|       |
  795|  10.6k|         std::string_view tag_uri(tag_start, static_cast<size_t>(it - tag_start));
  796|  10.6k|         if (tag_uri.empty() || malformed_tag_token(tag_uri)) {
  ------------------
  |  Branch (796:14): [True: 202, False: 10.4k]
  |  Branch (796:33): [True: 408, False: 10.0k]
  ------------------
  797|    610|            return yaml_tag::unknown;
  798|    610|         }
  799|  10.0k|         ++it; // skip >
  800|  10.0k|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (800:14): [True: 8.50k, False: 1.51k]
  |  Branch (800:27): [True: 330, False: 8.17k]
  ------------------
  801|    330|            return yaml_tag::unknown;
  802|    330|         }
  803|       |
  804|       |         // Skip whitespace after tag
  805|  16.9k|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (805:17): [True: 14.9k, False: 1.96k]
  |  Branch (805:31): [True: 5.41k, False: 9.57k]
  |  Branch (805:45): [True: 1.85k, False: 7.72k]
  ------------------
  806|  7.26k|            ++it;
  807|  7.26k|         }
  808|       |
  809|       |         // Match known YAML 1.2 URIs
  810|  9.68k|         if (tag_uri == "tag:yaml.org,2002:str") return yaml_tag::str;
  ------------------
  |  Branch (810:14): [True: 1.33k, False: 8.35k]
  ------------------
  811|  8.35k|         if (tag_uri == "tag:yaml.org,2002:int") return yaml_tag::int_tag;
  ------------------
  |  Branch (811:14): [True: 194, False: 8.15k]
  ------------------
  812|  8.15k|         if (tag_uri == "tag:yaml.org,2002:float") return yaml_tag::float_tag;
  ------------------
  |  Branch (812:14): [True: 670, False: 7.48k]
  ------------------
  813|  7.48k|         if (tag_uri == "tag:yaml.org,2002:bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (813:14): [True: 198, False: 7.29k]
  ------------------
  814|  7.29k|         if (tag_uri == "tag:yaml.org,2002:null") return yaml_tag::null_tag;
  ------------------
  |  Branch (814:14): [True: 190, False: 7.10k]
  ------------------
  815|  7.10k|         if (tag_uri == "tag:yaml.org,2002:map") return yaml_tag::map;
  ------------------
  |  Branch (815:14): [True: 454, False: 6.64k]
  ------------------
  816|  6.64k|         if (tag_uri == "tag:yaml.org,2002:seq") return yaml_tag::seq;
  ------------------
  |  Branch (816:14): [True: 194, False: 6.45k]
  ------------------
  817|       |
  818|       |         // Unrecognized verbatim tag — ignore and parse value normally
  819|  6.45k|         return yaml_tag::none;
  820|  6.64k|      }
  821|       |
  822|       |      // Named tag !name - skip it and read name
  823|   915k|      auto tag_start = it;
  824|  27.7M|      while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (824:14): [True: 27.7M, False: 5.74k]
  |  Branch (824:27): [True: 26.8M, False: 909k]
  ------------------
  825|  26.8M|         ++it;
  826|  26.8M|      }
  827|   915k|      std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  828|   915k|      if (!tag_name.empty() && malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (828:11): [True: 588k, False: 327k]
  |  Branch (828:32): [True: 0, False: 588k]
  ------------------
  829|      0|         return yaml_tag::unknown;
  830|      0|      }
  831|   915k|      if (!tag_name.empty() && it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (831:11): [True: 588k, False: 327k]
  |  Branch (831:32): [True: 582k, False: 5.74k]
  |  Branch (831:45): [True: 748, False: 581k]
  ------------------
  832|    748|         return yaml_tag::unknown;
  833|    748|      }
  834|       |
  835|       |      // Skip whitespace after tag
  836|  2.03M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (836:14): [True: 2.02M, False: 9.06k]
  |  Branch (836:28): [True: 825k, False: 1.19M]
  |  Branch (836:42): [True: 293k, False: 905k]
  ------------------
  837|  1.11M|         ++it;
  838|  1.11M|      }
  839|       |
  840|       |      // Unrecognized named tag — ignore and parse value normally
  841|   914k|      return yaml_tag::none;
  842|   915k|   }
_ZN3glz4yaml19malformed_tag_tokenENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  711|  1.97M|   {
  712|       |      // Reject obviously malformed tag tokens used by conformance tests.
  713|       |      // Unknown-but-well-formed tags are still ignored.
  714|   721M|      for (const char c : token) {
  ------------------
  |  Branch (714:25): [True: 721M, False: 1.97M]
  ------------------
  715|   721M|         if (c == '{' || c == '}') return true;
  ------------------
  |  Branch (715:14): [True: 198, False: 721M]
  |  Branch (715:26): [True: 210, False: 721M]
  ------------------
  716|   721M|      }
  717|  1.97M|      return false;
  718|  1.97M|   }
_ZN3glz4yaml25malformed_tag_terminationEc:
  721|  1.95M|   {
  722|  1.95M|      return !(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}');
  ------------------
  |  Branch (722:16): [True: 756k, False: 1.20M]
  |  Branch (722:28): [True: 696k, False: 507k]
  |  Branch (722:41): [True: 87.4k, False: 419k]
  |  Branch (722:54): [True: 109k, False: 310k]
  |  Branch (722:67): [True: 138k, False: 171k]
  |  Branch (722:79): [True: 131k, False: 40.1k]
  |  Branch (722:91): [True: 3.37k, False: 36.7k]
  |  Branch (722:103): [True: 35.2k, False: 1.54k]
  ------------------
  723|  1.95M|   }
_ZN3glz4yaml20tag_valid_for_stringENS0_8yaml_tagE:
  858|  18.6M|   {
  859|  18.6M|      return tag == yaml_tag::none || tag == yaml_tag::str;
  ------------------
  |  Branch (859:14): [True: 18.6M, False: 9.70k]
  |  Branch (859:39): [True: 9.54k, False: 160]
  ------------------
  860|  18.6M|   }
_ZN3glz4yaml17tag_valid_for_mapENS0_8yaml_tagE:
  894|  8.69M|   {
  895|  8.69M|      return tag == yaml_tag::none || tag == yaml_tag::map;
  ------------------
  |  Branch (895:14): [True: 8.69M, False: 4.09k]
  |  Branch (895:39): [True: 4.06k, False: 28]
  ------------------
  896|  8.69M|   }
_ZNK3glz4yaml12yaml_context23alias_span_is_replayingEPKcS3_:
  158|  2.05M|      {
  159|  4.06M|         for (const auto& [b, e] : active_alias_spans) {
  ------------------
  |  Branch (159:34): [True: 4.06M, False: 2.05M]
  ------------------
  160|  4.06M|            if (b == begin && e == end) return true;
  ------------------
  |  Branch (160:17): [True: 8.17k, False: 4.06M]
  |  Branch (160:31): [True: 3.16k, False: 5.00k]
  ------------------
  161|  4.06M|         }
  162|  2.05M|         return false;
  163|  2.05M|      }
_ZN3glz4yaml12yaml_context22charge_alias_expansionEm:
  178|  3.86M|      {
  179|  3.86M|         if (alias_expansion_budget == 0) {
  ------------------
  |  Branch (179:14): [True: 0, False: 3.86M]
  ------------------
  180|      0|            return true; // unbudgeted
  181|      0|         }
  182|  3.86M|         if (bytes >= alias_expansion_budget) {
  ------------------
  |  Branch (182:14): [True: 404, False: 3.86M]
  ------------------
  183|    404|            alias_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  184|    404|            return false;
  185|    404|         }
  186|  3.86M|         alias_expansion_budget -= bytes;
  187|  3.86M|         return true;
  188|  3.86M|      }
_ZN3glz4yaml12yaml_context11push_indentEi:
  110|  4.96M|      {
  111|  4.96M|         if (indent_stack.size() >= max_yaml_recursive_depth) [[unlikely]] {
  ------------------
  |  Branch (111:14): [True: 0, False: 4.96M]
  ------------------
  112|      0|            error = error_code::exceeded_max_recursive_depth;
  113|      0|            return false;
  114|      0|         }
  115|  4.96M|         indent_stack.push_back(static_cast<int16_t>(indent));
  116|  4.96M|         return true;
  117|  4.96M|      }
_ZN3glz4yaml20skip_ws_and_newlinesIRPKcS3_EEvOT_T0_:
  951|  27.1M|   {
  952|  31.4M|      while (it != end && (*it == ' ' || *it == '\t' || *it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (952:14): [True: 31.4M, False: 61.7k]
  |  Branch (952:28): [True: 2.70M, False: 28.7M]
  |  Branch (952:42): [True: 251k, False: 28.4M]
  |  Branch (952:57): [True: 377k, False: 28.0M]
  |  Branch (952:72): [True: 960k, False: 27.1M]
  ------------------
  953|  4.29M|         if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (953:14): [True: 377k, False: 3.91M]
  |  Branch (953:29): [True: 960k, False: 2.95M]
  ------------------
  954|  1.33M|            skip_newline(it, end);
  955|  1.33M|         }
  956|  2.95M|         else {
  957|  2.95M|            ++it;
  958|  2.95M|         }
  959|  4.29M|      }
  960|  27.1M|   }
_ZN3glz4yaml19detect_scalar_styleEc:
 1533|  3.70M|   {
 1534|  3.70M|      switch (c) {
 1535|  51.5k|      case '"':
  ------------------
  |  Branch (1535:7): [True: 51.5k, False: 3.65M]
  ------------------
 1536|  51.5k|         return scalar_style::double_quoted;
 1537|  16.4k|      case '\'':
  ------------------
  |  Branch (1537:7): [True: 16.4k, False: 3.69M]
  ------------------
 1538|  16.4k|         return scalar_style::single_quoted;
 1539|  11.6k|      case '|':
  ------------------
  |  Branch (1539:7): [True: 11.6k, False: 3.69M]
  ------------------
 1540|  11.6k|         return scalar_style::literal_block;
 1541|  46.8k|      case '>':
  ------------------
  |  Branch (1541:7): [True: 46.8k, False: 3.66M]
  ------------------
 1542|  46.8k|         return scalar_style::folded_block;
 1543|  3.58M|      default:
  ------------------
  |  Branch (1543:7): [True: 3.58M, False: 126k]
  ------------------
 1544|  3.58M|         return scalar_style::plain;
 1545|  3.70M|      }
 1546|  3.70M|   }
_ZN3glz4yaml23skip_folded_line_indentINS0_12yaml_contextEEEbRPKcS4_RT_Pi:
 1017|  1.30M|   {
 1018|  1.30M|      bool saw_space = false;
 1019|  1.30M|      int indent_count = 0;
 1020|  1.50M|      while (src < src_end && (*src == ' ' || *src == '\t')) {
  ------------------
  |  Branch (1020:14): [True: 1.48M, False: 22.8k]
  |  Branch (1020:32): [True: 170k, False: 1.31M]
  |  Branch (1020:47): [True: 34.3k, False: 1.27M]
  ------------------
 1021|       |         // In nested block contexts, a tab at indentation column 0 is invalid.
 1022|   205k|         if (*src == '\t' && !saw_space && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1022:14): [True: 34.3k, False: 170k]
  |  Branch (1022:30): [True: 18.0k, False: 16.3k]
  |  Branch (1022:44): [True: 110, False: 17.9k]
  ------------------
 1023|    110|            ctx.error = error_code::syntax_error;
 1024|    110|            return false;
 1025|    110|         }
 1026|   204k|         if (*src == ' ') saw_space = true;
  ------------------
  |  Branch (1026:14): [True: 170k, False: 34.2k]
  ------------------
 1027|   204k|         ++indent_count;
 1028|   204k|         ++src;
 1029|   204k|      }
 1030|  1.30M|      if (ctx.current_indent() >= 0 && src < src_end && *src != '\n' && *src != '\r' &&
  ------------------
  |  Branch (1030:11): [True: 73.4k, False: 1.22M]
  |  Branch (1030:40): [True: 59.3k, False: 14.0k]
  |  Branch (1030:57): [True: 19.7k, False: 39.6k]
  |  Branch (1030:73): [True: 15.0k, False: 4.74k]
  ------------------
 1031|  15.0k|          indent_count < ctx.current_indent()) {
  ------------------
  |  Branch (1031:11): [True: 134, False: 14.8k]
  ------------------
 1032|    134|         ctx.error = error_code::syntax_error;
 1033|    134|         return false;
 1034|    134|      }
 1035|  1.30M|      if (indent_out) *indent_out = indent_count;
  ------------------
  |  Branch (1035:11): [True: 1.30M, False: 0]
  ------------------
 1036|  1.30M|      return true;
 1037|  1.30M|   }
_ZN3glz4yaml27starts_with_document_markerIPKcS3_EEbT_T0_:
  994|  1.22M|   {
  995|  1.22M|      if (src >= src_end) return false;
  ------------------
  |  Branch (995:11): [True: 17.7k, False: 1.20M]
  ------------------
  996|  1.20M|      if ((src_end - src) >= 3) {
  ------------------
  |  Branch (996:11): [True: 1.18M, False: 19.5k]
  ------------------
  997|  1.18M|         if (src[0] == '-' && src[1] == '-' && src[2] == '-') {
  ------------------
  |  Branch (997:14): [True: 131k, False: 1.05M]
  |  Branch (997:31): [True: 121k, False: 10.0k]
  |  Branch (997:48): [True: 3.18k, False: 117k]
  ------------------
  998|  3.18k|            const auto* after = src + 3;
  999|  3.18k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (999:20): [True: 30, False: 3.15k]
  |  Branch (999:40): [True: 30, False: 3.12k]
  |  Branch (999:57): [True: 30, False: 3.09k]
  |  Branch (999:75): [True: 30, False: 3.06k]
  |  Branch (999:93): [True: 30, False: 3.03k]
  ------------------
 1000|  3.03k|                   *after == '#';
  ------------------
  |  Branch (1000:20): [True: 22, False: 3.01k]
  ------------------
 1001|  3.18k|         }
 1002|  1.18M|         if (src[0] == '.' && src[1] == '.' && src[2] == '.') {
  ------------------
  |  Branch (1002:14): [True: 67.8k, False: 1.11M]
  |  Branch (1002:31): [True: 63.5k, False: 4.27k]
  |  Branch (1002:48): [True: 59.8k, False: 3.67k]
  ------------------
 1003|  59.8k|            const auto* after = src + 3;
 1004|  59.8k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (1004:20): [True: 34, False: 59.8k]
  |  Branch (1004:40): [True: 32, False: 59.7k]
  |  Branch (1004:57): [True: 34, False: 59.7k]
  |  Branch (1004:75): [True: 30, False: 59.7k]
  |  Branch (1004:93): [True: 30, False: 59.7k]
  ------------------
 1005|  59.7k|                   *after == '#';
  ------------------
  |  Branch (1005:20): [True: 10, False: 59.6k]
  ------------------
 1006|  59.8k|         }
 1007|  1.18M|      }
 1008|  1.14M|      return false;
 1009|  1.20M|   }
_ZN3glz4yaml19tag_valid_for_floatENS0_8yaml_tagE:
  870|  4.64M|   {
  871|  4.64M|      return tag == yaml_tag::none || tag == yaml_tag::float_tag || tag == yaml_tag::int_tag;
  ------------------
  |  Branch (871:14): [True: 4.64M, False: 6.61k]
  |  Branch (871:39): [True: 2.68k, False: 3.92k]
  |  Branch (871:69): [True: 2.11k, False: 1.81k]
  ------------------
  872|  4.64M|   }
_ZN3glz4yaml18tag_valid_for_boolENS0_8yaml_tagE:
  876|   329k|   {
  877|   329k|      return tag == yaml_tag::none || tag == yaml_tag::bool_tag;
  ------------------
  |  Branch (877:14): [True: 324k, False: 5.54k]
  |  Branch (877:39): [True: 5.51k, False: 28]
  ------------------
  878|   329k|   }
_ZN3glz4yaml12is_yaml_nullENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1568|   106k|   {
 1569|   106k|      return s == "null" || s == "Null" || s == "NULL" || s == "~" || s.empty();
  ------------------
  |  Branch (1569:14): [True: 44.5k, False: 62.0k]
  |  Branch (1569:29): [True: 16.1k, False: 45.9k]
  |  Branch (1569:44): [True: 40.0k, False: 5.95k]
  |  Branch (1569:59): [True: 0, False: 5.95k]
  |  Branch (1569:71): [True: 5.70k, False: 244]
  ------------------
 1570|   106k|   }
_ZN3glz4yaml14measure_indentILb1ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1444|  2.04M|   {
 1445|  2.04M|      int32_t indent = 0;
 1446|  5.33M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1446:14): [True: 5.08M, False: 256k]
  |  Branch (1446:27): [True: 3.28M, False: 1.79M]
  ------------------
 1447|  3.28M|         ++indent;
 1448|  3.28M|         ++it;
 1449|  3.28M|      }
 1450|       |      // YAML spec: "Tab characters must not be used for indentation"
 1451|  2.04M|      if constexpr (error_on_tab) {
 1452|  2.04M|         if (it != end && *it == '\t') {
  ------------------
  |  Branch (1452:14): [True: 1.79M, False: 256k]
  |  Branch (1452:27): [True: 122, False: 1.79M]
  ------------------
 1453|    122|            ctx.error = error_code::syntax_error;
 1454|    122|         }
 1455|       |      }
 1456|       |      else {
 1457|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1458|       |         // Only error when tab is the first character (pure tab indentation).
 1459|       |         if (indent == 0 && it != end && *it == '\t') {
 1460|       |            ctx.error = error_code::syntax_error;
 1461|       |         }
 1462|       |      }
 1463|  2.04M|      return indent;
 1464|  2.04M|   }
_ZNK3glz4yaml12yaml_context13line_begin_ofEPKc:
  306|  12.6M|      {
  307|  12.6M|         if (!stream_begin || p < stream_begin) {
  ------------------
  |  Branch (307:14): [True: 0, False: 12.6M]
  |  Branch (307:31): [True: 0, False: 12.6M]
  ------------------
  308|      0|            return p;
  309|      0|         }
  310|  12.6M|         memoize_line(p);
  311|  12.6M|         return memo_line_begin;
  312|  12.6M|      }
_ZNK3glz4yaml12yaml_context12memoize_lineEPKc:
  270|  12.6M|      {
  271|  12.6M|         if (memo_line_begin && p >= memo_line_begin && p <= memo_verified_end) {
  ------------------
  |  Branch (271:14): [True: 12.1M, False: 454k]
  |  Branch (271:33): [True: 10.9M, False: 1.21M]
  |  Branch (271:57): [True: 4.58M, False: 6.39M]
  ------------------
  272|  4.58M|            return;
  273|  4.58M|         }
  274|       |         // A query past the memoized span only has to walk the new bytes; one before it (or with
  275|       |         // no memo yet) walks all the way back.
  276|  8.05M|         const bool extends = memo_line_begin && p > memo_verified_end;
  ------------------
  |  Branch (276:31): [True: 7.60M, False: 454k]
  |  Branch (276:50): [True: 6.39M, False: 1.21M]
  ------------------
  277|  8.05M|         const char* const floor = extends ? memo_verified_end : stream_begin;
  ------------------
  |  Branch (277:36): [True: 6.39M, False: 1.66M]
  ------------------
  278|  8.05M|         const char* first_tab = nullptr;
  279|  8.05M|         const char* first_content = nullptr;
  280|  8.05M|         const char* q = p;
  281|  1.84G|         while (q > floor) {
  ------------------
  |  Branch (281:17): [True: 1.83G, False: 3.19M]
  ------------------
  282|  1.83G|            const char c = *(q - 1);
  283|  1.83G|            if (c == '\n' || c == '\r') break;
  ------------------
  |  Branch (283:17): [True: 2.28M, False: 1.83G]
  |  Branch (283:30): [True: 2.57M, False: 1.83G]
  ------------------
  284|  1.83G|            --q;
  285|       |            // Walking backward, the last one seen is the earliest one on the line.
  286|  1.83G|            if (c == '\t')
  ------------------
  |  Branch (286:17): [True: 323k, False: 1.83G]
  ------------------
  287|   323k|               first_tab = q;
  288|  1.83G|            else if (c != ' ')
  ------------------
  |  Branch (288:22): [True: 1.80G, False: 22.3M]
  ------------------
  289|  1.80G|               first_content = q;
  290|  1.83G|         }
  291|  8.05M|         if (extends && q == floor) {
  ------------------
  |  Branch (291:14): [True: 6.39M, False: 1.66M]
  |  Branch (291:25): [True: 2.68M, False: 3.70M]
  ------------------
  292|       |            // The new bytes continue the memoized line, so anything it already found is earlier.
  293|  2.68M|            if (memo_first_tab) first_tab = memo_first_tab;
  ------------------
  |  Branch (293:17): [True: 36.5k, False: 2.65M]
  ------------------
  294|  2.68M|            if (memo_first_content) first_content = memo_first_content;
  ------------------
  |  Branch (294:17): [True: 1.53M, False: 1.15M]
  ------------------
  295|  2.68M|         }
  296|  5.37M|         else {
  297|  5.37M|            memo_line_begin = q;
  298|  5.37M|         }
  299|  8.05M|         memo_verified_end = p;
  300|  8.05M|         memo_first_tab = first_tab;
  301|  8.05M|         memo_first_content = first_content;
  302|  8.05M|      }
_ZN3glz4yaml12yaml_context10pop_indentEv:
  120|  4.52M|      {
  121|  4.52M|         if (!indent_stack.empty()) {
  ------------------
  |  Branch (121:14): [True: 4.52M, False: 0]
  ------------------
  122|  4.52M|            indent_stack.pop_back();
  123|  4.52M|         }
  124|  4.52M|      }
_ZN3glz4yaml17tag_valid_for_seqENS0_8yaml_tagE:
  888|  1.43M|   {
  889|  1.43M|      return tag == yaml_tag::none || tag == yaml_tag::seq;
  ------------------
  |  Branch (889:14): [True: 1.41M, False: 17.3k]
  |  Branch (889:39): [True: 17.2k, False: 32]
  ------------------
  890|  1.43M|   }
_ZN3glz4yaml12yaml_context20charge_key_expansionEm:
  198|  4.66M|      {
  199|  4.66M|         if (key_expansion_budget == 0) {
  ------------------
  |  Branch (199:14): [True: 0, False: 4.66M]
  ------------------
  200|      0|            return true; // unbudgeted
  201|      0|         }
  202|  4.66M|         if (bytes >= key_expansion_budget) {
  ------------------
  |  Branch (202:14): [True: 424, False: 4.66M]
  ------------------
  203|    424|            key_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  204|    424|            return false;
  205|    424|         }
  206|  4.66M|         key_expansion_budget -= bytes;
  207|  4.66M|         return true;
  208|  4.66M|      }
_ZN3glz4yaml14measure_indentILb0ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1444|  7.30M|   {
 1445|  7.30M|      int32_t indent = 0;
 1446|  13.1M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1446:14): [True: 13.0M, False: 113k]
  |  Branch (1446:27): [True: 5.83M, False: 7.18M]
  ------------------
 1447|  5.83M|         ++indent;
 1448|  5.83M|         ++it;
 1449|  5.83M|      }
 1450|       |      // YAML spec: "Tab characters must not be used for indentation"
 1451|       |      if constexpr (error_on_tab) {
 1452|       |         if (it != end && *it == '\t') {
 1453|       |            ctx.error = error_code::syntax_error;
 1454|       |         }
 1455|       |      }
 1456|  7.30M|      else {
 1457|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1458|       |         // Only error when tab is the first character (pure tab indentation).
 1459|  7.30M|         if (indent == 0 && it != end && *it == '\t') {
  ------------------
  |  Branch (1459:14): [True: 6.47M, False: 825k]
  |  Branch (1459:29): [True: 6.36M, False: 113k]
  |  Branch (1459:42): [True: 280, False: 6.36M]
  ------------------
 1460|    280|            ctx.error = error_code::syntax_error;
 1461|    280|         }
 1462|  7.30M|      }
 1463|  7.30M|      return indent;
 1464|  7.30M|   }
_ZNK3glz4yaml12yaml_context16make_speculativeEv:
  362|  8.24M|      {
  363|  8.24M|         yaml_context c{};
  364|  8.24M|         c.indent_stack = indent_stack;
  365|  8.24M|         c.anchors = anchors;
  366|  8.24M|         c.active_alias_spans = active_alias_spans;
  367|       |         // Speculative work is real work: a probe that expands aliases spends the same budget,
  368|       |         // and the sites that adopt a probe's anchors adopt what it spent along with them.
  369|  8.24M|         c.alias_expansion_budget = alias_expansion_budget;
  370|       |         // Likewise for key text: a probe that built a complex key did the work whether or not
  371|       |         // its alternative is adopted, and an attempt that is never billed can be repeated free.
  372|  8.24M|         c.key_expansion_budget = key_expansion_budget;
  373|  8.24M|         c.sequence_item_value_context = sequence_item_value_context;
  374|  8.24M|         c.sequence_dash_indent = sequence_dash_indent;
  375|  8.24M|         c.explicit_mapping_key_context = explicit_mapping_key_context;
  376|  8.24M|         c.allow_indentless_sequence = allow_indentless_sequence;
  377|  8.24M|         c.stream_begin = stream_begin;
  378|       |         // The line memo only records what the buffer says, so a probe may keep using it.
  379|  8.24M|         c.memo_line_begin = memo_line_begin;
  380|  8.24M|         c.memo_verified_end = memo_verified_end;
  381|  8.24M|         c.memo_first_tab = memo_first_tab;
  382|  8.24M|         c.memo_first_content = memo_first_content;
  383|  8.24M|         c.secondary_tag_handle_overridden = secondary_tag_handle_overridden;
  384|       |         // Carry the recursion depth so a speculative type-probe shares the parent's budget
  385|       |         // and can't reset the stack-overflow guard partway down a deeply nested value.
  386|  8.24M|         c.depth = depth;
  387|  8.24M|         return c;
  388|  8.24M|      }
_ZNK3glz4yaml12yaml_context14current_indentEv:
  107|  71.8M|      int32_t current_indent() const noexcept { return indent_stack.empty() ? int32_t(-1) : indent_stack.back(); }
  ------------------
  |  Branch (107:56): [True: 48.8M, False: 22.9M]
  ------------------
_ZNK3glz4yaml12yaml_context18line_prefix_beforeEPKc:
  315|  9.41M|      {
  316|  9.41M|         const char* const begin = line_begin_of(p);
  317|  9.41M|         if (begin >= p) {
  ------------------
  |  Branch (317:14): [True: 2.51M, False: 6.89M]
  ------------------
  318|  2.51M|            return {};
  319|  2.51M|         }
  320|  6.89M|         return {int32_t(p - begin), memo_first_tab && memo_first_tab < p,
  ------------------
  |  Branch (320:38): [True: 306k, False: 6.58M]
  |  Branch (320:56): [True: 289k, False: 16.3k]
  ------------------
  321|  6.89M|                 memo_first_content && memo_first_content < p};
  ------------------
  |  Branch (321:18): [True: 5.95M, False: 938k]
  |  Branch (321:40): [True: 5.94M, False: 4.46k]
  ------------------
  322|  9.41M|      }
_ZN3glz4yaml12skip_newlineIRPKcS3_EEbOT_T0_:
  931|   109M|   {
  932|   109M|      if (it == end) return false;
  ------------------
  |  Branch (932:11): [True: 96.9k, False: 109M]
  ------------------
  933|       |
  934|   109M|      if (*it == '\r') {
  ------------------
  |  Branch (934:11): [True: 77.9M, False: 31.7M]
  ------------------
  935|  77.9M|         ++it;
  936|  77.9M|         if (it != end && *it == '\n') {
  ------------------
  |  Branch (936:14): [True: 77.1M, False: 796k]
  |  Branch (936:27): [True: 1.67M, False: 75.4M]
  ------------------
  937|  1.67M|            ++it;
  938|  1.67M|         }
  939|  77.9M|         return true;
  940|  77.9M|      }
  941|  31.7M|      else if (*it == '\n') {
  ------------------
  |  Branch (941:16): [True: 31.7M, False: 2.66k]
  ------------------
  942|  31.7M|         ++it;
  943|  31.7M|         return true;
  944|  31.7M|      }
  945|  2.66k|      return false;
  946|   109M|   }

_ZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  40.6k|      {
   70|  40.6k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  40.6k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 40.6k, False: 0]
  |  Branch (71:38): [True: 40.6k, False: 0]
  ------------------
   72|  40.6k|               ctx.stream_begin = &*it;
   73|       |               // Anchors and the line memo hold pointers into whatever buffer filled them, so a
   74|       |               // reused context must not carry a previous read's into this one.
   75|  40.6k|               if constexpr (requires { ctx.reset_read_state(); }) {
   76|  40.6k|                  ctx.reset_read_state();
   77|  40.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|  40.6k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  40.6k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  40.6k|                  ctx.alias_expansion_budget =
   84|  40.6k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 285, False: 40.4k]
  ------------------
   85|  40.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|  40.6k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  40.6k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  40.6k|                  ctx.key_expansion_budget =
   91|  40.6k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 285, False: 40.4k]
  ------------------
   92|  40.6k|               }
   93|  40.6k|            }
   94|  40.6k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  40.6k|         yaml::skip_document_start(it, end, ctx);
   97|  40.6k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 271, False: 40.4k]
  ------------------
   98|    271|            return;
   99|    271|         }
  100|       |
  101|  40.4k|         using V = std::remove_cvref_t<T>;
  102|  40.4k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 69, False: 40.3k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     69|            if constexpr (requires { value = nullptr; }) {
  105|     69|               value = nullptr;
  106|     69|               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|     69|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  40.4k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 75, False: 40.3k]
  |  Branch (120:50): [True: 20, False: 40.3k]
  ------------------
  121|     26|            if constexpr (requires { value = nullptr; }) {
  122|     26|               value = nullptr;
  123|     26|               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|     26|         }
  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|  40.4k|         if constexpr (!check_partial_read(Opts)) {
  144|  40.4k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 8.92k, False: 31.5k]
  |  Branch (144:37): [True: 8.92k, False: 0]
  ------------------
  145|  8.92k|               auto is_document_start = [&](auto pos) {
  146|  8.92k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  8.92k|                     auto after = pos + 3;
  148|  8.92k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  8.92k|                            *after == '#';
  150|  8.92k|                  }
  151|  8.92k|                  return false;
  152|  8.92k|               };
  153|       |
  154|       |               // The scan below reads the tail a line at a time, which only means anything if the
  155|       |               // tail starts at one. A root node can stop mid-line -- a plain scalar ends at a
  156|       |               // ':' it is not allowed to take as a separator, a flow collection ends at its
  157|       |               // bracket -- and what sits after it there is leftover content on that line, not
  158|       |               // the opening of a new one. Only inline whitespace and a comment may follow. Let
  159|       |               // the line scan see anything else and it misreads it: a leftover ':' passes as an
  160|       |               // explicit-key continuation and the remainder of the document falls on the floor.
  161|  8.92k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  8.92k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.47k, False: 7.45k]
  |  Branch (162:23): [True: 1.00k, False: 7.92k]
  |  Branch (162:36): [True: 1.00k, False: 475]
  ------------------
  163|  1.00k|                     auto rest = it;
  164|  2.78k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 2.73k, False: 49]
  |  Branch (164:45): [True: 1.43k, False: 1.29k]
  |  Branch (164:61): [True: 345, False: 951]
  ------------------
  165|  1.00k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 951, False: 49]
  |  Branch (165:41): [True: 721, False: 230]
  |  Branch (165:58): [True: 409, False: 312]
  |  Branch (165:75): [True: 321, False: 88]
  ------------------
  166|    321|                        ctx.error = error_code::syntax_error;
  167|    321|                        return;
  168|    321|                     }
  169|  1.00k|                  }
  170|  8.92k|               }
  171|       |
  172|  8.60k|               auto tail_scan = it;
  173|  8.92k|               bool seen_document_end_marker = false;
  174|  42.6k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 34.3k, False: 8.23k]
  ------------------
  175|  34.3k|                  auto line = tail_scan;
  176|  52.9k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 52.8k, False: 84]
  |  Branch (176:42): [True: 18.0k, False: 34.8k]
  |  Branch (176:58): [True: 511, False: 34.3k]
  ------------------
  177|  34.3k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 1.29k, False: 33.0k]
  |  Branch (177:44): [True: 1.21k, False: 84]
  |  Branch (177:59): [True: 874, False: 337]
  |  Branch (177:76): [True: 581, False: 293]
  |  Branch (177:93): [True: 132, False: 449]
  ------------------
  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|    132|                     const char first = *line;
  182|    132|                     const bool explicit_or_structural_start =
  183|    132|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 12, False: 120]
  |  Branch (183:42): [True: 2, False: 118]
  |  Branch (183:58): [True: 4, False: 114]
  |  Branch (183:74): [True: 2, False: 112]
  |  Branch (183:90): [True: 3, False: 109]
  |  Branch (183:106): [True: 5, False: 104]
  ------------------
  184|    104|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 2, False: 102]
  |  Branch (184:42): [True: 3, False: 99]
  |  Branch (184:58): [True: 2, False: 97]
  |  Branch (184:75): [True: 14, False: 83]
  ------------------
  185|    132|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 83, False: 49]
  ------------------
  186|     83|                        auto scan = line;
  187|  1.26k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 1.21k, False: 48]
  |  Branch (187:47): [True: 1.21k, False: 6]
  |  Branch (187:64): [True: 1.21k, False: 3]
  ------------------
  188|  1.21k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 315, False: 895]
  ------------------
  189|    315|                              auto after = scan + 1;
  190|    315|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 18, False: 297]
  |  Branch (190:51): [True: 3, False: 294]
  |  Branch (190:68): [True: 2, False: 292]
  |  Branch (190:86): [True: 2, False: 290]
  |  Branch (190:104): [True: 1, False: 289]
  ------------------
  191|     26|                                 ctx.error = error_code::syntax_error;
  192|     26|                                 return;
  193|     26|                              }
  194|    315|                           }
  195|  1.18k|                           ++scan;
  196|  1.18k|                        }
  197|     83|                     }
  198|    106|                     return;
  199|    132|                  }
  200|  34.2k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 84, False: 34.1k]
  ------------------
  201|     84|                     return;
  202|     84|                  }
  203|  34.1k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 28, False: 34.1k]
  |  Branch (203:39): [True: 17, False: 34.1k]
  ------------------
  204|     45|                     return; // Explicit key/value continuation.
  205|     45|                  }
  206|  34.1k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 1.11k, False: 33.0k]
  |  Branch (206:40): [True: 11.7k, False: 21.2k]
  ------------------
  207|  12.8k|                     tail_scan = line;
  208|  12.8k|                     yaml::skip_newline(tail_scan, end);
  209|  12.8k|                     continue;
  210|  12.8k|                  }
  211|  21.2k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 16.4k, False: 4.83k]
  ------------------
  212|   128k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 128k, False: 135]
  |  Branch (212:49): [True: 124k, False: 3.53k]
  |  Branch (212:71): [True: 111k, False: 12.7k]
  ------------------
  213|  16.4k|                     yaml::skip_newline(tail_scan, end);
  214|  16.4k|                     continue;
  215|  16.4k|                  }
  216|  4.83k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 4.39k, False: 431]
  ------------------
  217|  4.39k|                     seen_document_end_marker = true;
  218|  27.7k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 27.6k, False: 81]
  |  Branch (218:49): [True: 24.4k, False: 3.14k]
  |  Branch (218:71): [True: 23.3k, False: 1.17k]
  ------------------
  219|  4.39k|                     yaml::skip_newline(tail_scan, end);
  220|  4.39k|                     continue;
  221|  4.39k|                  }
  222|    431|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 133, False: 298]
  ------------------
  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|    133|                     auto header = line + 3;
  228|    864|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 836, False: 28]
  |  Branch (228:47): [True: 433, False: 403]
  |  Branch (228:65): [True: 298, False: 105]
  ------------------
  229|    133|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 105, False: 28]
  |  Branch (229:43): [True: 58, False: 47]
  ------------------
  230|     58|                        auto tag_end = header + 1;
  231|  3.07M|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 3.07M, False: 20]
  |  Branch (231:50): [True: 3.07M, False: 30]
  |  Branch (231:69): [True: 3.07M, False: 2]
  |  Branch (231:89): [True: 3.07M, False: 1]
  ------------------
  232|  3.07M|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 3.07M, False: 2]
  |  Branch (232:52): [True: 3.07M, False: 3]
  ------------------
  233|  3.07M|                           ++tag_end;
  234|  3.07M|                        }
  235|     58|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     58|                        const auto second_bang = tag_token.find('!', 1);
  237|     58|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 43, False: 15]
  ------------------
  238|     43|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     43|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 43, False: 0]
  |  Branch (239:49): [True: 41, False: 2]
  ------------------
  240|     41|                              ctx.error = error_code::syntax_error;
  241|     41|                              return;
  242|     41|                           }
  243|     43|                        }
  244|     58|                     }
  245|     92|                     return; // Additional documents are allowed in the stream tail.
  246|    133|                  }
  247|    298|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 298, False: 0]
  |  Branch (247:38): [True: 6, False: 292]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|      6|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 4, False: 2]
  ------------------
  251|      4|                        ctx.error = error_code::syntax_error;
  252|      4|                        return;
  253|      4|                     }
  254|      2|                     return;
  255|      6|                  }
  256|    292|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 45, False: 247]
  ------------------
  257|     45|                     return; // Implicit next document after explicit document end marker.
  258|     45|                  }
  259|    247|                  ctx.error = error_code::syntax_error;
  260|    247|                  return;
  261|    292|               }
  262|  8.92k|            }
  263|  40.4k|         }
  264|  40.4k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   547k|      {
  275|   547k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   547k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   547k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   547k|      }
_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_:
 5752|   719k|      {
 5753|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5754|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5755|   719k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|   719k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|   719k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|   719k|                       "the internally tagged shape, so it is rejected here instead.");
 5759|   719k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 719k]
  ------------------
 5760|      0|            return;
 5761|       |
 5762|       |         // No depth is taken here: the sequence and mapping readers this dispatches to count the
 5763|       |         // levels, so a scalar at the bottom of a document costs nothing, as in JSON. The one way
 5764|       |         // back into this reader that opens no collection is `redispatch`, which counts itself.
 5765|       |
 5766|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5767|       |         // For nested values, only skip inline whitespace to preserve block structure
 5768|   719k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 120k, False: 598k]
  ------------------
 5769|   120k|            yaml::skip_ws_newlines_comments(it, end);
 5770|   120k|         }
 5771|   598k|         else {
 5772|   598k|            yaml::skip_inline_ws(it, end);
 5773|   598k|         }
 5774|       |
 5775|   719k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 114, False: 719k]
  ------------------
 5776|    114|            ctx.error = error_code::unexpected_end;
 5777|    114|            return;
 5778|    114|         }
 5779|       |
 5780|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5781|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5782|       |         // same variant definitions round-trip across both formats.
 5783|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5784|       |            using V = std::remove_cvref_t<T>;
 5785|       |            const bool value_is_mapping =
 5786|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5787|       |            if (value_is_mapping) {
 5788|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5789|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5790|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5791|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5792|       |               auto tag_ctx = ctx.make_speculative();
 5793|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5794|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5795|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5796|       |               if (index < ids_v<V>.size()) {
 5797|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5798|       |                  emplace_runtime_variant(value, index);
 5799|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5800|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5801|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5802|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5803|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5804|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5805|       |                     return;
 5806|       |                  }
 5807|       |                  std::visit(
 5808|       |                     [&](auto&& alt) {
 5809|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5810|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5811|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5812|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5813|       |                        }
 5814|       |                        else if constexpr (custom_read<Alt>) {
 5815|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5816|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5817|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5818|       |                           // entry, then hand the remaining mapping to the custom handler.
 5819|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5820|       |                              ctx.error = error_code::feature_not_supported;
 5821|       |                              ctx.custom_error_message =
 5822|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5823|       |                           }
 5824|       |                           else {
 5825|       |                              ctx.scratch.clear();
 5826|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5827|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5828|       |                                    ctx.error = error_code::feature_not_supported;
 5829|       |                                    ctx.custom_error_message =
 5830|       |                                       "the tag must be the first key for a custom variant alternative";
 5831|       |                                 }
 5832|       |                                 else {
 5833|       |                                    yaml::skip_inline_ws(it, end);
 5834|       |                                    if (it == end || *it != ':') {
 5835|       |                                       ctx.error = error_code::syntax_error;
 5836|       |                                    }
 5837|       |                                    else {
 5838|       |                                       ++it;
 5839|       |                                       yaml::skip_inline_ws(it, end);
 5840|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5841|       |                                       if (!bool(ctx.error)) {
 5842|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5843|       |                                          // was the whole mapping: leave the alternative default.
 5844|       |                                          auto probe = it;
 5845|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5846|       |                                          if (probe == end) {
 5847|       |                                             it = probe;
 5848|       |                                          }
 5849|       |                                          else {
 5850|       |                                             // Publish the mapping's column so the custom handler's block
 5851|       |                                             // mapping (which would otherwise discover its own indent) reads
 5852|       |                                             // the remaining entries at the variant's indent and dedents
 5853|       |                                             // correctly in every context (root, sequence, nested).
 5854|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5855|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5856|       |                                             ctx.forced_block_mapping_indent = -1;
 5857|       |                                          }
 5858|       |                                       }
 5859|       |                                    }
 5860|       |                                 }
 5861|       |                              }
 5862|       |                           }
 5863|       |                        }
 5864|       |                        else {
 5865|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5866|       |                           // the value, but the mapping must still be consumed.
 5867|       |                           walk_tagged_mapping<Opts>(
 5868|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5869|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5870|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5871|       |                              });
 5872|       |                        }
 5873|       |                     },
 5874|       |                     value);
 5875|       |                  ctx.pop_indent();
 5876|       |                  return;
 5877|       |               }
 5878|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5879|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5880|       |               // otherwise the deduction path reports no_matching_variant_type.
 5881|       |            }
 5882|       |         }
 5883|       |
 5884|   719k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|   719k|            using V = std::remove_cvref_t<T>;
 5886|   719k|            using counts = yaml_variant_type_count<V>;
 5887|   719k|            const char c = *it;
 5888|   719k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|   719k|               switch (ch) {
 5890|   719k|               case ' ':
 5891|   719k|               case '\t':
 5892|   719k|               case '\n':
 5893|   719k|               case '\r':
 5894|   719k|               case ',':
 5895|   719k|               case ']':
 5896|   719k|               case '}':
 5897|   719k|                  return true;
 5898|   719k|               default:
 5899|   719k|                  return false;
 5900|   719k|               }
 5901|   719k|            };
 5902|       |
 5903|   719k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|   719k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|   719k|                  return false;
 5906|   719k|               }
 5907|   719k|               if (ctx.current_indent() < 0) {
 5908|   719k|                  return false;
 5909|   719k|               }
 5910|   719k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|   719k|                  return false;
 5912|   719k|               }
 5913|       |
 5914|   719k|               auto look = word_end;
 5915|   719k|               yaml::skip_newline(look, end);
 5916|   719k|               while (look != end) {
 5917|   719k|                  int32_t line_indent = 0;
 5918|   719k|                  while (look != end && *look == ' ') {
 5919|   719k|                     ++line_indent;
 5920|   719k|                     ++look;
 5921|   719k|                  }
 5922|   719k|                  if (look != end && *look == '\t') {
 5923|   719k|                     return false;
 5924|   719k|                  }
 5925|   719k|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|   719k|                     if (look != end) {
 5927|   719k|                        yaml::skip_newline(look, end);
 5928|   719k|                        continue;
 5929|   719k|                     }
 5930|   719k|                     return false;
 5931|   719k|                  }
 5932|   719k|                  if (*look == '#') {
 5933|   719k|                     yaml::skip_comment(look, end);
 5934|   719k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|   719k|                        yaml::skip_newline(look, end);
 5936|   719k|                        continue;
 5937|   719k|                     }
 5938|   719k|                     return false;
 5939|   719k|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|   719k|                  {
 5945|   719k|                     auto scan = look;
 5946|   719k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|   719k|                        if (*scan == ':') {
 5948|   719k|                           auto after_colon = scan + 1;
 5949|   719k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|   719k|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|   719k|                              return false;
 5952|   719k|                           }
 5953|   719k|                        }
 5954|   719k|                        ++scan;
 5955|   719k|                     }
 5956|   719k|                  }
 5957|       |
 5958|   719k|                  return line_indent > ctx.current_indent();
 5959|   719k|               }
 5960|   719k|               return false;
 5961|   719k|            };
 5962|   719k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   719k|               if (ptr == end) {
 5964|   719k|                  return true;
 5965|   719k|               }
 5966|   719k|               if (*ptr == ':') {
 5967|   719k|                  auto next = ptr + 1;
 5968|   719k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|   719k|               }
 5970|   719k|               return is_plain_scalar_boundary(*ptr);
 5971|   719k|            };
 5972|       |
 5973|   719k|            switch (c) {
 5974|   128k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 128k, False: 590k]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   128k|               ++it;
 5977|   128k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   128k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 171, False: 128k]
  ------------------
 5979|    171|                  ctx.error = error_code::syntax_error;
 5980|    171|                  return;
 5981|    171|               }
 5982|   128k|               yaml::skip_inline_ws(it, end);
 5983|   128k|               bool anchor_on_same_line = true;
 5984|   128k|               bool value_is_indentless_sequence = false;
 5985|   128k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 1.45k, False: 127k]
  |  Branch (5985:33): [True: 7.85k, False: 119k]
  |  Branch (5985:48): [True: 12.4k, False: 106k]
  |  Branch (5985:63): [True: 7.75k, False: 99.1k]
  ------------------
 5986|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5987|       |                  // next line (indented past current context) or if this is an empty node.
 5988|  29.4k|                  bool value_on_next_line = false;
 5989|  29.4k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 28.0k, False: 1.45k]
  ------------------
 5990|  28.0k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|  28.0k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 7.75k, False: 20.2k]
  ------------------
 5993|   106k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 106k, False: 518]
  |  Branch (5993:47): [True: 103k, False: 2.52k]
  |  Branch (5993:64): [True: 99.2k, False: 4.71k]
  ------------------
 5994|  7.75k|                     }
 5995|       |                     // Skip newline
 5996|  28.0k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 27.5k, False: 518]
  |  Branch (5996:42): [True: 10.3k, False: 17.1k]
  |  Branch (5996:59): [True: 17.1k, False: 0]
  ------------------
 5997|  27.5k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|  46.3k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 44.4k, False: 1.94k]
  |  Branch (5999:48): [True: 11.4k, False: 32.9k]
  |  Branch (5999:65): [True: 7.38k, False: 25.5k]
  ------------------
 6000|  18.8k|                           yaml::skip_newline(peek, end);
 6001|  18.8k|                        }
 6002|       |                        // Measure indent of next content line
 6003|  27.5k|                        int32_t next_indent = 0;
 6004|  92.2k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 89.8k, False: 2.33k]
  |  Branch (6004:47): [True: 64.7k, False: 25.1k]
  ------------------
 6005|  64.7k|                           ++next_indent;
 6006|  64.7k|                           ++peek;
 6007|  64.7k|                        }
 6008|  27.5k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 25.1k, False: 2.33k]
  |  Branch (6008:44): [True: 24.6k, False: 483]
  |  Branch (6008:61): [True: 24.0k, False: 619]
  ------------------
 6009|  24.0k|                           const bool indentless_sequence =
 6010|  24.0k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 21.1k, False: 2.93k]
  |  Branch (6010:69): [True: 9.60k, False: 11.5k]
  ------------------
 6011|  9.60k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 320, False: 9.28k]
  ------------------
 6012|  9.28k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 8.75k, False: 528]
  ------------------
 6013|  9.07k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 4.24k, False: 4.82k]
  ------------------
 6014|  4.82k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 3.51k, False: 1.30k]
  |  Branch (6014:61): [True: 1.84k, False: 1.67k]
  ------------------
 6015|  24.0k|                           value_is_indentless_sequence = indentless_sequence;
 6016|  24.0k|                           const bool same_indent_property_node =
 6017|  24.0k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 8.68k, False: 15.3k]
  ------------------
 6018|  8.68k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 910, False: 7.77k]
  |  Branch (6018:48): [True: 1.53k, False: 6.23k]
  |  Branch (6018:64): [True: 266, False: 5.97k]
  |  Branch (6018:80): [True: 228, False: 5.74k]
  |  Branch (6018:96): [True: 405, False: 5.33k]
  ------------------
 6019|  5.33k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 253, False: 5.08k]
  |  Branch (6019:48): [True: 331, False: 4.75k]
  |  Branch (6019:65): [True: 254, False: 4.50k]
  |  Branch (6019:81): [True: 70, False: 4.43k]
  ------------------
 6020|  24.0k|                           value_on_next_line =
 6021|  24.0k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 8.95k, False: 15.1k]
  |  Branch (6021:71): [True: 6.08k, False: 9.02k]
  |  Branch (6021:94): [True: 4.25k, False: 4.77k]
  ------------------
 6022|  24.0k|                        }
 6023|  27.5k|                     }
 6024|  28.0k|                  }
 6025|  29.4k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 10.1k, False: 19.2k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  10.1k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  10.1k|                     return;
 6029|  10.1k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|  19.2k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 5.46k, False: 13.8k]
  ------------------
 6032|  72.0k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 72.0k, False: 0]
  |  Branch (6032:42): [True: 70.1k, False: 1.85k]
  |  Branch (6032:57): [True: 66.5k, False: 3.61k]
  ------------------
 6033|  5.46k|                  }
 6034|  19.2k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 19.2k, False: 0]
  ------------------
 6035|  32.8k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 32.8k, False: 0]
  |  Branch (6035:40): [True: 11.0k, False: 21.7k]
  |  Branch (6035:55): [True: 2.48k, False: 19.2k]
  ------------------
 6036|  13.5k|                     yaml::skip_newline(it, end);
 6037|  13.5k|                  }
 6038|  19.2k|                  yaml::skip_inline_ws(it, end);
 6039|  19.2k|                  anchor_on_same_line = false;
 6040|  19.2k|               }
 6041|       |
 6042|   118k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|   118k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6043:23): [True: 99.1k, False: 19.2k]
  |  Branch (6043:46): [True: 5.37k, False: 93.8k]
  ------------------
 6044|  5.37k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6044:24): [True: 4, False: 5.37k]
  |  Branch (6044:43): [True: 10, False: 5.36k]
  ------------------
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|     14|                     ctx.error = error_code::syntax_error;
 6047|     14|                     return;
 6048|     14|                  }
 6049|   118k|               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   118k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 118k, False: 29]
  |  Branch (6053:33): [True: 962, False: 117k]
  |  Branch (6053:47): [True: 86, False: 876]
  ------------------
 6054|     86|                  ctx.error = error_code::syntax_error;
 6055|     86|                  return;
 6056|     86|               }
 6057|       |
 6058|   118k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|   118k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6059:23): [True: 19.2k, False: 99.1k]
  |  Branch (6059:47): [True: 19.2k, False: 15]
  |  Branch (6059:60): [True: 2.22k, False: 17.0k]
  ------------------
 6060|  2.22k|                     auto probe = it + 1;
 6061|  2.22k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|  2.22k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6062:26): [True: 23, False: 2.19k]
  ------------------
 6063|     23|                        ctx.error = error_code::syntax_error;
 6064|     23|                        return;
 6065|     23|                     }
 6066|  2.19k|                     yaml::skip_inline_ws(probe, end);
 6067|       |                     // Allow nested anchor usage only when it clearly starts a
 6068|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6069|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6070|  2.19k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6070:26): [True: 45, False: 2.15k]
  ------------------
 6071|     45|                        ctx.error = error_code::syntax_error;
 6072|     45|                        return;
 6073|     45|                     }
 6074|  2.19k|                  }
 6075|   118k|               }
 6076|       |
 6077|   118k|               const char* anchor_start = &*it;
 6078|   118k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|   118k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6081|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6082|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6083|       |                  // next line, the anchor applies to the entire next-line content.
 6084|   118k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6084:23): [True: 99.1k, False: 19.2k]
  |  Branch (6084:46): [True: 48.7k, False: 50.4k]
  ------------------
 6085|  48.7k|                     auto key_start = it;
 6086|  48.7k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6086:26): [True: 808, False: 47.9k]
  ------------------
 6087|    808|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|    808|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6088:29): [True: 2, False: 806]
  |  Branch (6088:67): [True: 6, False: 800]
  ------------------
 6089|      8|                           ctx.error = error_code::syntax_error;
 6090|      8|                           return;
 6091|      8|                        }
 6092|    800|                        yaml::skip_inline_ws(key_start, end);
 6093|    800|                        if (key_start == end) {
  ------------------
  |  Branch (6093:29): [True: 4, False: 796]
  ------------------
 6094|      4|                           ctx.error = error_code::unexpected_end;
 6095|      4|                           return;
 6096|      4|                        }
 6097|    796|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6097:29): [True: 1, False: 795]
  |  Branch (6097:51): [True: 1, False: 794]
  ------------------
 6098|      2|                           ctx.error = error_code::syntax_error;
 6099|      2|                           return;
 6100|      2|                        }
 6101|       |
 6102|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6103|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6104|       |                        // key-span registration below while the untagged spelling was rejected;
 6105|       |                        // an alias node carries no other properties either way.
 6106|    794|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6106:29): [True: 169, False: 625]
  |  Branch (6106:50): [True: 6, False: 163]
  ------------------
 6107|      6|                           ctx.error = error_code::syntax_error;
 6108|      6|                           return;
 6109|      6|                        }
 6110|    794|                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|  48.6k|                     auto key_scan = key_start;
 6114|  48.6k|                     auto key_end = key_start;
 6115|  48.6k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6115:26): [True: 652, False: 48.0k]
  |  Branch (6115:46): [True: 384, False: 47.6k]
  ------------------
 6116|       |                        // Quoted key: skip to closing quote
 6117|  1.03k|                        const char quote = *key_scan;
 6118|  1.03k|                        ++key_scan;
 6119|  8.05k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6119:32): [True: 8.05k, False: 4]
  |  Branch (6119:51): [True: 7.01k, False: 1.03k]
  ------------------
 6120|  7.01k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6120:32): [True: 623, False: 6.39k]
  |  Branch (6120:53): [True: 271, False: 352]
  ------------------
 6121|    271|                              ++key_scan;
 6122|    271|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6122:35): [True: 271, False: 0]
  ------------------
 6123|    271|                           }
 6124|  6.74k|                           else {
 6125|  6.74k|                              ++key_scan;
 6126|  6.74k|                           }
 6127|  7.01k|                        }
 6128|  1.03k|                        if (key_scan == end) {
  ------------------
  |  Branch (6128:29): [True: 4, False: 1.03k]
  ------------------
 6129|      4|                           ctx.error = error_code::syntax_error;
 6130|      4|                           return;
 6131|      4|                        }
 6132|  1.03k|                        ++key_scan; // past closing quote
 6133|  1.03k|                        key_end = key_scan;
 6134|  1.03k|                        yaml::skip_inline_ws(key_scan, end);
 6135|  1.03k|                     }
 6136|  47.6k|                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|   784k|                        while (key_scan != end) {
  ------------------
  |  Branch (6138:32): [True: 784k, False: 1]
  ------------------
 6139|   784k|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6139:32): [True: 91.4k, False: 693k]
  ------------------
 6140|  91.4k|                              auto next = key_scan + 1;
 6141|  91.4k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6141:35): [True: 5.72k, False: 85.7k]
  |  Branch (6141:50): [True: 34.3k, False: 51.3k]
  |  Branch (6141:66): [True: 1.60k, False: 49.7k]
  |  Branch (6141:83): [True: 3.66k, False: 46.1k]
  |  Branch (6141:100): [True: 2.34k, False: 43.7k]
  ------------------
 6142|  47.6k|                                 break;
 6143|  47.6k|                              }
 6144|  91.4k|                           }
 6145|   737k|                           ++key_scan;
 6146|   737k|                        }
 6147|  47.6k|                        key_end = key_scan;
 6148|  56.2k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6148:32): [True: 52.5k, False: 3.72k]
  |  Branch (6148:57): [True: 8.08k, False: 44.4k]
  |  Branch (6148:82): [True: 513, False: 43.9k]
  ------------------
 6149|  8.60k|                           --key_end;
 6150|  8.60k|                        }
 6151|  47.6k|                     }
 6152|  48.6k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6152:26): [True: 2, False: 48.6k]
  |  Branch (6152:45): [True: 29, False: 48.6k]
  ------------------
 6153|     31|                        ctx.error = error_code::syntax_error;
 6154|     31|                        return;
 6155|     31|                     }
 6156|       |                     // Store anchor with just the key text span
 6157|  48.6k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|  48.6k|                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|  48.6k|                     if constexpr (counts::n_object > 0) {
 6161|  48.6k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|  48.6k|                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|  48.6k|                     return;
 6168|  48.6k|                  }
 6169|   118k|               }
 6170|       |
 6171|  69.6k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   118k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   118k|               redispatch<Opts>(value, ctx, it, end);
 6174|   118k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   118k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 65.5k, False: 52.8k]
  ------------------
 6176|  65.5k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|  65.5k|               }
 6178|   118k|               return;
 6179|   118k|            }
 6180|  92.9k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 92.9k, False: 626k]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|  92.9k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|  92.9k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6183:23): [True: 7.66k, False: 85.2k]
  ------------------
 6184|  7.66k|                     if constexpr (counts::n_object > 0) {
 6185|  7.66k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|  7.66k|                                                                                                        end);
 6187|  7.66k|                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|  7.66k|                  }
 6194|  92.9k|               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|  92.9k|               return;
 6199|   118k|            }
 6200|  75.0k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 75.0k, False: 644k]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|  75.0k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|  75.0k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 84, False: 75.0k]
  ------------------
 6204|     84|                  ctx.error = error_code::syntax_error;
 6205|     84|                  return;
 6206|     84|               }
 6207|  75.0k|               yaml::skip_inline_ws(it, end);
 6208|  75.0k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 74.4k, False: 564]
  |  Branch (6208:33): [True: 8.72k, False: 65.7k]
  ------------------
 6209|  8.72k|                  yaml::skip_comment(it, end);
 6210|  8.72k|               }
 6211|  75.0k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 74.1k, False: 889]
  |  Branch (6211:34): [True: 13.5k, False: 60.6k]
  |  Branch (6211:49): [True: 10.0k, False: 50.5k]
  ------------------
 6212|  23.5k|                  auto content = it;
 6213|  23.5k|                  yaml::skip_newline(content, end);
 6214|  23.5k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|  23.5k|                  bool consume_following_content = false;
 6217|  23.5k|                  auto content_token = content;
 6218|  23.5k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 21.9k, False: 1.58k]
  ------------------
 6219|  21.9k|                     auto indent_probe = content;
 6220|  21.9k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  21.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 4, False: 21.9k]
  ------------------
 6222|      4|                        return;
 6223|  21.9k|                     content_token = indent_probe;
 6224|       |
 6225|       |                     // A tag at the end of a sequence/map entry has an empty value
 6226|       |                     // unless the next non-empty content is nested under the current node.
 6227|  21.9k|                     bool tagged_indentless_sequence = false;
 6228|  21.9k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 2.46k, False: 19.4k]
  |  Branch (6228:56): [True: 2.46k, False: 0]
  |  Branch (6228:79): [True: 2.07k, False: 395]
  ------------------
 6229|  2.07k|                        const auto after_dash = indent_probe + 1;
 6230|  2.07k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 252, False: 1.81k]
  ------------------
 6231|  1.82k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 1.57k, False: 241]
  ------------------
 6232|  1.82k|                           tagged_indentless_sequence =
 6233|  1.82k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 610, False: 1.21k]
  ------------------
 6234|  1.21k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 588, False: 631]
  |  Branch (6234:60): [True: 489, False: 99]
  ------------------
 6235|  1.82k|                        }
 6236|  2.07k|                     }
 6237|       |
 6238|  21.9k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 1.80k, False: 20.1k]
  ------------------
 6239|  20.1k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 4.76k, False: 15.3k]
  |  Branch (6239:93): [True: 1.09k, False: 14.2k]
  ------------------
 6240|  21.9k|                  }
 6241|       |
 6242|  23.5k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 7.66k, False: 15.8k]
  ------------------
 6243|  7.66k|                     it = content_token;
 6244|  7.66k|                  }
 6245|  15.8k|                  else {
 6246|  15.8k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 2.95k, False: 12.8k]
  ------------------
 6247|  2.95k|                        if constexpr (counts::n_str > 0) {
 6248|  2.95k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  2.95k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  2.95k|                           value = StrType{};
 6251|  2.95k|                           return;
 6252|  2.95k|                        }
 6253|  2.95k|                     }
 6254|  15.8k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 260, False: 15.5k]
  ------------------
 6255|    260|                        if constexpr (counts::n_null > 0) {
 6256|    260|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    260|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    260|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 260]
  ------------------
 6259|    260|                           return;
 6260|    260|                        }
 6261|    260|                     }
 6262|  15.8k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 11.9k, False: 3.92k]
  ------------------
 6263|  11.9k|                        if constexpr (counts::n_null > 0) {
 6264|  11.9k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  11.9k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  11.9k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 11.9k]
  ------------------
 6267|  11.9k|                           return;
 6268|  11.9k|                        }
 6269|  11.9k|                     }
 6270|  15.8k|                  }
 6271|  23.5k|               }
 6272|  74.9k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6273|       |                  // In block context, a comma immediately after a tag token is malformed
 6274|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6275|  74.9k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6275:23): [True: 58.9k, False: 16.0k]
  |  Branch (6275:36): [True: 14, False: 58.9k]
  ------------------
 6276|     14|                     ctx.error = error_code::syntax_error;
 6277|     14|                     return;
 6278|     14|                  }
 6279|  74.9k|                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|  74.9k|                     const bool starts_block_sequence_entry =
 6282|  74.9k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6282:26): [True: 58.9k, False: 16.0k]
  |  Branch (6282:39): [True: 3.61k, False: 55.3k]
  ------------------
 6283|  3.61k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6283:26): [True: 529, False: 3.09k]
  |  Branch (6283:45): [True: 2.41k, False: 675]
  ------------------
 6284|  74.9k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6284:26): [True: 56.8k, False: 18.0k]
  |  Branch (6284:58): [True: 15.5k, False: 41.3k]
  ------------------
 6285|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6286|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6287|  15.5k|                        redispatch<Opts>(value, ctx, it, end);
 6288|  15.5k|                        return;
 6289|  15.5k|                     }
 6290|  74.9k|                  }
 6291|  74.9k|               }
 6292|  74.9k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 889, False: 74.1k]
  ------------------
 6293|    889|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 268, False: 621]
  ------------------
 6294|    268|                     if constexpr (counts::n_str > 0) {
 6295|    268|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|    268|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|    268|                        value = StrType{};
 6298|    268|                        return;
 6299|    268|                     }
 6300|    268|                  }
 6301|    889|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 593, False: 296]
  ------------------
 6302|    593|                     if constexpr (counts::n_null > 0) {
 6303|    593|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|    593|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|    593|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 593]
  ------------------
 6306|    593|                        return;
 6307|    593|                     }
 6308|    593|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|    889|                  return;
 6311|    889|               }
 6312|  74.1k|               switch (tag) {
 6313|  1.17k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 1.17k, False: 72.9k]
  ------------------
 6314|  1.17k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  1.17k|                  return;
 6316|  1.27k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 1.27k, False: 72.8k]
  ------------------
 6317|  1.41k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 143, False: 73.9k]
  ------------------
 6318|  1.41k|                  if constexpr (counts::n_num > 0) {
 6319|  1.41k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  1.41k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  10.8k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 9.40k, False: 64.7k]
  ------------------
 6327|  10.8k|                  if constexpr (counts::n_bool > 0) {
 6328|  10.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  10.8k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  11.1k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 312, False: 73.7k]
  ------------------
 6336|  11.1k|                  if constexpr (counts::n_null > 0) {
 6337|  11.1k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  11.1k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  11.1k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 11.1k]
  ------------------
 6340|  11.1k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  11.1k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  16.0k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 4.93k, False: 69.1k]
  ------------------
 6348|  16.0k|                  if constexpr (counts::n_object > 0) {
 6349|  16.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  16.0k|                                                                                                     end);
 6351|  16.0k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  22.5k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 6.48k, False: 67.6k]
  ------------------
 6358|  22.5k|                  if constexpr (counts::n_array > 0) {
 6359|  22.5k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|  22.5k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|  22.5k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6361:29): [True: 6.48k, False: 16.0k]
  |  Branch (6361:42): [True: 1.87k, False: 4.60k]
  ------------------
 6362|  1.87k|                           ctx.allow_indentless_sequence = true;
 6363|  1.87k|                        }
 6364|  22.5k|                     }
 6365|  22.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  22.5k|                                                                                                    end);
 6367|  22.5k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  22.5k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|  42.2k|               default: {
  ------------------
  |  Branch (6374:16): [True: 19.6k, False: 54.4k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|  42.2k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 19.6k, False: 22.5k]
  |  Branch (6377:36): [True: 3.92k, False: 15.7k]
  ------------------
 6378|  3.92k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  3.92k|                     return;
 6380|  3.92k|                  }
 6381|       |
 6382|  38.3k|                  if constexpr (counts::n_array > 0) {
 6383|  38.3k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 15.7k, False: 22.5k]
  |  Branch (6383:39): [True: 349, False: 15.4k]
  ------------------
 6384|    349|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|    349|                                                                                                       end);
 6386|    349|                        return;
 6387|    349|                     }
 6388|  38.3k|                  }
 6389|  38.3k|                  if constexpr (counts::n_object > 0) {
 6390|  38.3k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 15.4k, False: 22.8k]
  |  Branch (6390:39): [True: 482, False: 14.9k]
  ------------------
 6391|    482|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|    482|                                                                                                        end);
 6393|    482|                        return;
 6394|    482|                     }
 6395|  38.3k|                  }
 6396|       |
 6397|  38.3k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|  38.3k|                     if constexpr (counts::n_array > 0) {
 6399|  38.3k|                        const bool starts_block_sequence_entry =
 6400|  38.3k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6400:29): [True: 14.9k, False: 23.3k]
  |  Branch (6400:42): [True: 1.36k, False: 13.5k]
  ------------------
 6401|  1.36k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6401:29): [True: 277, False: 1.08k]
  |  Branch (6401:48): [True: 812, False: 275]
  ------------------
 6402|  38.3k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6402:29): [True: 1.08k, False: 37.2k]
  ------------------
 6403|  1.08k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|  1.08k|                                                                                                          it, end);
 6405|  1.08k|                           return;
 6406|  1.08k|                        }
 6407|  38.3k|                     }
 6408|  38.3k|                     if constexpr (counts::n_object > 0) {
 6409|  38.3k|                        const bool starts_explicit_mapping_indicator =
 6410|  38.3k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6410:29): [True: 13.8k, False: 24.4k]
  |  Branch (6410:43): [True: 1.50k, False: 12.3k]
  |  Branch (6410:57): [True: 567, False: 11.7k]
  ------------------
 6411|  2.06k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6411:29): [True: 333, False: 1.73k]
  |  Branch (6411:48): [True: 1.09k, False: 637]
  ------------------
 6412|  38.3k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6412:29): [True: 1.43k, False: 36.8k]
  ------------------
 6413|  1.43k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|  1.43k|                                                                                                           it, end);
 6415|  1.43k|                           return;
 6416|  1.43k|                        }
 6417|  36.8k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6417:29): [True: 0, False: 36.8k]
  ------------------
 6418|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6419|      0|                                                                                                           it, end);
 6420|      0|                           return;
 6421|      0|                        }
 6422|  36.8k|                     }
 6423|  38.3k|                  }
 6424|       |
 6425|  38.3k|                  if constexpr (counts::n_str > 0) {
 6426|  38.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|  38.3k|                     return;
 6428|  38.3k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|  38.3k|                  return;
 6433|  42.2k|               }
 6434|  74.1k|               }
 6435|      0|               return;
 6436|  74.1k|            }
 6437|  21.2k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 21.2k, False: 698k]
  ------------------
 6438|  21.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|  21.2k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6440:23): [True: 9.27k, False: 11.9k]
  |  Branch (6440:51): [True: 846, False: 8.43k]
  ------------------
 6441|    846|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|    846|                                                                                                     end);
 6443|    846|                     return;
 6444|    846|                  }
 6445|  21.2k|               }
 6446|       |               // Flow mapping - object type
 6447|  20.3k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  21.2k|               return;
 6449|  29.8k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 29.8k, False: 689k]
  ------------------
 6450|  29.8k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|  29.8k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6452:23): [True: 19.4k, False: 10.3k]
  |  Branch (6452:51): [True: 714, False: 18.7k]
  ------------------
 6453|    714|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|    714|                                                                                                     end);
 6455|    714|                     return;
 6456|    714|                  }
 6457|  29.8k|               }
 6458|       |               // Flow sequence - array type
 6459|  29.0k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  29.8k|               return;
 6461|  77.3k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 77.3k, False: 642k]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|  77.3k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 76.9k, False: 347]
  |  Branch (6463:39): [True: 3, False: 76.9k]
  ------------------
 6464|      3|                  ctx.error = error_code::syntax_error;
 6465|      3|                  return;
 6466|      3|               }
 6467|  77.3k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 76.9k, False: 347]
  |  Branch (6467:40): [True: 29.8k, False: 47.1k]
  |  Branch (6467:56): [True: 26.6k, False: 20.5k]
  |  Branch (6467:73): [True: 16.2k, False: 4.30k]
  ------------------
 6468|  72.6k|                  if constexpr (counts::n_object > 0) {
 6469|  72.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|  72.6k|                                                                                                     end);
 6471|  72.6k|                     return;
 6472|  72.6k|                  }
 6473|  72.6k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|  77.3k|               return;
 6476|     10|            case '%':
  ------------------
  |  Branch (6476:13): [True: 10, False: 719k]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     10|               ctx.error = error_code::syntax_error;
 6479|     10|               return;
 6480|  1.82k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 1.82k, False: 717k]
  ------------------
 6481|  2.83k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 1.00k, False: 718k]
  ------------------
 6482|       |               // Could be a quoted string OR a quoted key in a block mapping
 6483|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6484|  2.83k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  2.83k|               return;
 6486|  10.7k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 10.7k, False: 708k]
  ------------------
 6487|  15.2k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 4.49k, False: 715k]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  15.2k|               if constexpr (counts::n_bool > 0) {
 6490|  15.2k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 14.6k, False: 602]
  |  Branch (6490:44): [True: 12.1k, False: 2.42k]
  |  Branch (6490:60): [True: 11.2k, False: 973]
  |  Branch (6490:76): [True: 10.3k, False: 827]
  ------------------
 6491|  11.2k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 1.42k, False: 2.79k]
  |  Branch (6491:60): [True: 1.14k, False: 278]
  |  Branch (6491:76): [True: 860, False: 288]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  11.2k|                     const auto after_true = it + 4;
 6494|  11.2k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  11.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 10.7k, False: 545]
  ------------------
 6497|  10.7k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 233, False: 10.4k]
  ------------------
 6498|    233|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|    233|                           return;
 6500|    233|                        }
 6501|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6502|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6503|  10.4k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 8.70k, False: 1.76k]
  |  Branch (6503:47): [True: 4.07k, False: 4.63k]
  ------------------
 6504|  4.07k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 2.65k, False: 1.41k]
  |  Branch (6504:47): [True: 579, False: 840]
  |  Branch (6504:63): [True: 259, False: 581]
  |  Branch (6504:80): [True: 266, False: 315]
  |  Branch (6504:97): [True: 315, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  4.07k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  4.07k|                           return;
 6508|  4.07k|                        }
 6509|  6.39k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  6.39k|                                                                                                      end);
 6511|  6.39k|                        return;
 6512|  10.4k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  11.2k|                  }
 6515|  15.2k|               }
 6516|  4.51k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  15.2k|               return;
 6518|  10.1k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 10.1k, False: 709k]
  ------------------
 6519|  17.8k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 7.62k, False: 711k]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  17.8k|               if constexpr (counts::n_bool > 0) {
 6522|  17.8k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 17.4k, False: 321]
  |  Branch (6522:44): [True: 12.7k, False: 4.77k]
  |  Branch (6522:60): [True: 12.0k, False: 692]
  |  Branch (6522:76): [True: 9.17k, False: 2.86k]
  |  Branch (6522:92): [True: 8.40k, False: 762]
  ------------------
 6523|  9.23k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 1.94k, False: 7.14k]
  |  Branch (6523:60): [True: 1.53k, False: 409]
  |  Branch (6523:76): [True: 1.12k, False: 416]
  |  Branch (6523:92): [True: 827, False: 295]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  9.23k|                     const auto after_false = it + 5;
 6526|  9.23k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  9.23k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 8.25k, False: 976]
  ------------------
 6529|  8.25k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 444, False: 7.81k]
  ------------------
 6530|    444|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|    444|                           return;
 6532|    444|                        }
 6533|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6534|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6535|  7.81k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 7.68k, False: 131]
  |  Branch (6535:47): [True: 1.82k, False: 5.85k]
  ------------------
 6536|  1.82k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 259, False: 1.56k]
  |  Branch (6536:47): [True: 219, False: 1.34k]
  |  Branch (6536:63): [True: 436, False: 912]
  |  Branch (6536:80): [True: 272, False: 640]
  |  Branch (6536:97): [True: 640, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  1.82k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  1.82k|                           return;
 6540|  1.82k|                        }
 6541|  5.98k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  5.98k|                                                                                                      end);
 6543|  5.98k|                        return;
 6544|  7.81k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  9.23k|                  }
 6547|  17.8k|               }
 6548|  9.55k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  17.8k|               return;
 6550|  4.34k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 4.34k, False: 715k]
  ------------------
 6551|  16.8k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 12.5k, False: 706k]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  16.8k|               if constexpr (counts::n_null > 0) {
 6554|  16.8k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 16.5k, False: 314]
  |  Branch (6554:44): [True: 5.99k, False: 10.5k]
  |  Branch (6554:60): [True: 5.43k, False: 569]
  |  Branch (6554:76): [True: 5.14k, False: 285]
  ------------------
 6555|  13.9k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 9.55k, False: 1.86k]
  |  Branch (6555:60): [True: 9.09k, False: 460]
  |  Branch (6555:76): [True: 8.83k, False: 262]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  13.9k|                     const auto after_null = it + 4;
 6558|  13.9k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  13.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 11.6k, False: 2.37k]
  ------------------
 6561|  11.6k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 247, False: 11.3k]
  ------------------
 6562|    247|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|    247|                           return;
 6564|    247|                        }
 6565|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6566|       |                        // "null: value" should parse as {null: value}, not as the null type
 6567|  11.3k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 10.9k, False: 429]
  |  Branch (6567:47): [True: 1.72k, False: 9.20k]
  ------------------
 6568|  1.72k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 263, False: 1.45k]
  |  Branch (6568:47): [True: 368, False: 1.08k]
  |  Branch (6568:63): [True: 442, False: 647]
  |  Branch (6568:80): [True: 376, False: 271]
  |  Branch (6568:97): [True: 271, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  1.72k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  1.72k|                           return;
 6572|  1.72k|                        }
 6573|  9.63k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  9.63k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  9.63k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 9.63k]
  ------------------
 6576|  9.63k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  9.63k|                        return;
 6578|  11.3k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  13.9k|                  }
 6581|  16.8k|               }
 6582|  5.28k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  16.8k|               return;
 6584|  1.37k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 1.37k, False: 718k]
  ------------------
 6585|       |               // Null indicator
 6586|  1.37k|               if constexpr (counts::n_null > 0) {
 6587|  1.37k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  1.37k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  1.37k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 1.37k]
  ------------------
 6590|  1.37k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  1.37k|                  return;
 6592|  1.37k|               }
 6593|      0|               break; // Fall through to try other types
 6594|  44.9k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 44.9k, False: 674k]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|  44.9k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 674, False: 44.2k]
  |  Branch (6596:41): [True: 35.1k, False: 9.10k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|  35.8k|                  if constexpr (counts::n_array > 0) {
 6599|  35.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|  35.8k|                                                                                                    end);
 6601|  35.8k|                     return;
 6602|  35.8k|                  }
 6603|  35.8k|               }
 6604|  44.9k|               if constexpr (counts::n_num > 0) {
 6605|  44.9k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 9.10k, False: 35.8k]
  |  Branch (6605:43): [True: 757, False: 8.34k]
  |  Branch (6605:94): [True: 882, False: 7.46k]
  ------------------
 6606|  1.63k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  1.63k|                     return;
 6608|  1.63k|                  }
 6609|  44.9k|               }
 6610|  43.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|  44.9k|               return;
 6612|  2.83k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 2.83k, False: 716k]
  ------------------
 6613|  10.5k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 7.74k, False: 711k]
  ------------------
 6614|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6615|       |               // Try parsing as number speculatively, fall back to string on failure
 6616|  10.5k|               if constexpr (counts::n_num > 0) {
 6617|  10.5k|                  auto start_it = it;
 6618|  10.5k|                  auto temp_ctx = ctx.make_speculative();
 6619|  10.5k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  10.5k|                                                                                               end);
 6621|  10.5k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  10.5k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  10.5k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 3.64k, False: 6.93k]
  ------------------
 6624|  3.64k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  3.64k|                     return; // Successfully parsed as number
 6626|  3.64k|                  }
 6627|  6.93k|                  it = start_it; // Restore and fall through to string
 6628|  6.93k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  10.5k|               return;
 6631|   184k|            default:
  ------------------
  |  Branch (6631:13): [True: 184k, False: 534k]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|   184k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 107k, False: 76.8k]
  |  Branch (6633:32): [True: 27.5k, False: 80.2k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  27.5k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 8.44k, False: 19.1k]
  ------------------
 6636|  8.44k|                     return;
 6637|  8.44k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  19.1k|                  if constexpr (counts::n_num > 0) {
 6640|  19.1k|                     auto start_it = it;
 6641|  19.1k|                     auto temp_ctx = ctx.make_speculative();
 6642|  19.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  19.1k|                                                                                                  end);
 6644|  19.1k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  19.1k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  19.1k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 2.68k, False: 16.4k]
  ------------------
 6647|  2.68k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  2.68k|                        return; // Successfully parsed as number
 6649|  2.68k|                     }
 6650|  16.4k|                     it = start_it; // Restore and fall through to string
 6651|  16.4k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|  19.1k|                  return;
 6655|  27.5k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   157k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   157k|               return;
 6659|   719k|            }
 6660|   719k|         }
 6661|       |
 6662|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6663|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6664|       |
 6665|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6666|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6667|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6668|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6669|   719k|         error_code expansion_error{};
 6670|   719k|         std::string_view expansion_message{};
 6671|       |
 6672|   719k|         auto try_parse = [&]<size_t I>() -> bool {
 6673|   719k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|   719k|            auto start = it;
 6675|       |
 6676|   719k|            V v{};
 6677|   719k|            auto temp_ctx = ctx.make_speculative();
 6678|   719k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|   719k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|   719k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|   719k|            if (!bool(temp_ctx.error)) {
 6683|   719k|               value = std::move(v);
 6684|   719k|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|   719k|               return true;
 6686|   719k|            }
 6687|       |
 6688|   719k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|   719k|               expansion_error = temp_ctx.error;
 6690|   719k|               expansion_message = temp_ctx.custom_error_message;
 6691|   719k|            }
 6692|   719k|            it = start;
 6693|   719k|            return false;
 6694|   719k|         };
 6695|       |
 6696|   719k|         bool parsed = false;
 6697|   719k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|   719k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|   719k|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|   719k|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 719k]
  ------------------
 6702|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6702:17): [True: 0, False: 0]
  ------------------
 6703|      0|               ctx.error = expansion_error;
 6704|      0|               ctx.custom_error_message = expansion_message;
 6705|      0|            }
 6706|      0|            else {
 6707|      0|               ctx.error = error_code::no_matching_variant_type;
 6708|      0|            }
 6709|      0|         }
 6710|   719k|      }
_ZN3glz4yaml26alias_token_is_mapping_keyIPKcS3_EEbT_T0_:
  371|  9.10M|      {
  372|  9.10M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (372:14): [True: 0, False: 9.10M]
  |  Branch (372:27): [True: 8.52M, False: 584k]
  ------------------
  373|   584k|         ++it; // skip '*'
  374|   584k|         auto name = parse_anchor_name(it, end);
  375|   584k|         if (name.empty()) return false;
  ------------------
  |  Branch (375:14): [True: 1.01k, False: 583k]
  ------------------
  376|   583k|         skip_inline_ws(it, end);
  377|   583k|         return (it != end && *it == ':') &&
  ------------------
  |  Branch (377:18): [True: 560k, False: 22.7k]
  |  Branch (377:31): [True: 122k, False: 437k]
  ------------------
  378|   122k|                ((it + 1) == end || whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (378:18): [True: 16.3k, False: 106k]
  |  Branch (378:37): [True: 79.9k, False: 26.3k]
  ------------------
  379|   584k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   288k|      {
 5311|   288k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   288k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   288k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   288k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   288k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 288k, False: 0]
  ------------------
 5321|   288k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   288k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|   291k|      {
 4617|   291k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 291k]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|   291k|         yaml::node_preamble_state preamble{};
 4621|   291k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 3.74k, False: 287k]
  ------------------
 4622|   291k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  3.74k|            return;
 4624|       |
 4625|   287k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|   287k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 8, False: 287k]
  ------------------
 4627|      8|            return;
 4628|       |
 4629|   287k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|   287k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4631|       |
 4632|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4633|       |         // value of a key that existed before the read and adds new keys, while
 4634|       |         // pre-existing keys the document does not mention are preserved (like a
 4635|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4636|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4637|       |         // mappings disallow duplicate keys and the conformance suite expects
 4638|       |         // first-wins, which falls out of emplace into an empty map. Any
 4639|       |         // pre-existing entry the document leaves untouched is restored on scope
 4640|       |         // exit (including error paths). When the target starts empty (the common
 4641|       |         // case) this is a no-op with negligible cost.
 4642|   287k|         std::remove_cvref_t<T> preexisting_entries;
 4643|   287k|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 287k]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|   287k|         struct merge_restore_guard
 4648|   287k|         {
 4649|   287k|            std::remove_cvref_t<T>& target;
 4650|   287k|            std::remove_cvref_t<T>& saved;
 4651|   287k|            ~merge_restore_guard()
 4652|   287k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   287k|               for (auto& entry : saved) {
 4656|   287k|                  target.emplace(entry.first, std::move(entry.second));
 4657|   287k|               }
 4658|   287k|            }
 4659|   287k|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|   287k|         const bool treat_as_block_mapping =
 4662|   287k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [True: 287k, Folded]
  |  Branch (4662:48): [True: 25.6k, False: 262k]
  |  Branch (4662:62): [True: 479, False: 25.1k]
  ------------------
 4663|       |
 4664|   287k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 25.6k, False: 262k]
  |  Branch (4664:28): [True: 25.1k, False: 479]
  ------------------
 4665|       |            // Flow mapping
 4666|  25.1k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  25.1k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  25.1k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 24.5k, False: 633]
  |  Branch (4670:30): [True: 4.58k, False: 19.9k]
  ------------------
 4671|  4.58k|               ++it;
 4672|  4.58k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  4.58k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 12, False: 4.57k]
  ------------------
 4674|     12|                  return;
 4675|  4.57k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  4.57k|               return;
 4677|  4.58k|            }
 4678|       |
 4679|  73.5k|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 71.1k, False: 2.40k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  71.1k|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  71.1k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 71.1k, False: 0]
  |  Branch (4683:33): [True: 3.07k, False: 68.0k]
  ------------------
 4684|  3.07k|                  ++it;
 4685|  3.07k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  3.07k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 7, False: 3.06k]
  ------------------
 4687|      7|                     return;
 4688|  3.06k|                  break;
 4689|  3.07k|               }
 4690|       |
 4691|  68.0k|               bool explicit_flow_key = false;
 4692|  68.0k|               auto explicit_probe = it;
 4693|  68.0k|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  68.0k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 68.0k, False: 0]
  |  Branch (4694:45): [True: 2.34k, False: 65.7k]
  ------------------
 4695|  2.34k|                  const auto after_q = explicit_probe + 1;
 4696|  2.34k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 6, False: 2.33k]
  |  Branch (4696:41): [True: 962, False: 1.37k]
  ------------------
 4697|  1.76k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 391, False: 986]
  |  Branch (4697:42): [True: 404, False: 582]
  ------------------
 4698|  1.76k|                     explicit_flow_key = true;
 4699|  1.76k|                     it = explicit_probe + 1;
 4700|  1.76k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  1.76k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 2, False: 1.76k]
  ------------------
 4702|      2|                        return;
 4703|  1.76k|                  }
 4704|  2.34k|               }
 4705|       |               // Parse key
 4706|  68.0k|               key_t key{};
 4707|  68.0k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  68.0k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 1.76k, False: 66.2k]
  |  Branch (4708:44): [True: 1.74k, False: 16]
  |  Branch (4708:58): [True: 247, False: 1.49k]
  |  Branch (4708:72): [True: 607, False: 891]
  |  Branch (4708:86): [True: 484, False: 407]
  ------------------
 4709|  1.33k|                     key.clear();
 4710|  1.33k|                  }
 4711|  66.7k|                  else {
 4712|  66.7k|                     auto key_probe = it;
 4713|  66.7k|                     yaml::skip_inline_ws(key_probe, end);
 4714|       |
 4715|       |                     // Use full node parsing only for structurally complex flow keys.
 4716|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4717|  66.7k|                     bool parse_complex_flow_key = false;
 4718|  66.7k|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 66.7k, False: 16]
  ------------------
 4719|  66.7k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 632, False: 66.0k]
  |  Branch (4719:50): [True: 2.67k, False: 63.3k]
  ------------------
 4720|  3.30k|                           parse_complex_flow_key = true;
 4721|  3.30k|                        }
 4722|  63.3k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 6.26k, False: 57.1k]
  ------------------
 4723|  6.26k|                           ++key_probe;
 4724|  6.26k|                           yaml::parse_anchor_name(key_probe, end);
 4725|  6.26k|                           yaml::skip_inline_ws(key_probe, end);
 4726|  6.26k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 6.20k, False: 64]
  |  Branch (4726:53): [True: 387, False: 5.81k]
  |  Branch (4726:74): [True: 555, False: 5.26k]
  ------------------
 4727|    942|                              parse_complex_flow_key = true;
 4728|    942|                           }
 4729|  6.26k|                        }
 4730|  66.7k|                     }
 4731|       |
 4732|  66.7k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 4.24k, False: 62.4k]
  ------------------
 4733|  4.24k|                        glz::generic key_node{};
 4734|  4.24k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  4.24k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 881, False: 3.36k]
  ------------------
 4736|    881|                           return;
 4737|  3.36k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 3, False: 3.36k]
  ------------------
 4738|      3|                           return;
 4739|  3.36k|                     }
 4740|  62.4k|                     else {
 4741|  62.4k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 1.40k, False: 61.0k]
  ------------------
 4742|  1.40k|                           return;
 4743|  1.40k|                        }
 4744|  62.4k|                     }
 4745|  66.7k|                  }
 4746|       |               }
 4747|       |               else {
 4748|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4749|       |                     ctx.error = error_code::syntax_error;
 4750|       |                     return;
 4751|       |                  }
 4752|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4753|       |                  if (bool(ctx.error)) [[unlikely]]
 4754|       |                     return;
 4755|       |               }
 4756|       |
 4757|       |               // Separation between flow key and ':' may include comments/newlines.
 4758|       |               // In flow context, newlines are allowed between key and ':'.
 4759|  65.7k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  68.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 5, False: 68.0k]
  ------------------
 4761|      5|                  return;
 4762|       |
 4763|  68.0k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  68.0k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  68.0k|                     val = {};
 4766|  68.0k|                     return true;
 4767|  68.0k|                  }
 4768|  68.0k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  68.0k|                     val = glz::generic{};
 4770|  68.0k|                     return true;
 4771|  68.0k|                  }
 4772|  68.0k|                  else {
 4773|  68.0k|                     static constexpr std::string_view null_value{"null"};
 4774|  68.0k|                     auto null_it = null_value.data();
 4775|  68.0k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  68.0k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  68.0k|                     return !bool(ctx.error);
 4778|  68.0k|                  }
 4779|  68.0k|               };
 4780|       |
 4781|  68.0k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 64.6k, False: 3.39k]
  |  Branch (4781:34): [True: 41.6k, False: 22.9k]
  |  Branch (4781:48): [True: 5.75k, False: 17.2k]
  ------------------
 4782|  47.4k|                  val_t val{};
 4783|  47.4k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 47.4k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|  47.4k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|  47.4k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 5.75k, False: 41.6k]
  ------------------
 4789|  5.75k|                     ++it;
 4790|  5.75k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  5.75k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 20, False: 5.73k]
  ------------------
 4792|     20|                        return;
 4793|  5.73k|                     break;
 4794|  5.75k|                  }
 4795|       |
 4796|  41.6k|                  ++it; // skip comma
 4797|  41.6k|                  yaml::skip_ws_and_newlines(it, end);
 4798|  41.6k|                  continue;
 4799|  47.4k|               }
 4800|       |
 4801|  20.5k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 3.39k, False: 17.2k]
  |  Branch (4801:33): [True: 221, False: 16.9k]
  ------------------
 4802|  1.32k|                  ctx.error = error_code::syntax_error;
 4803|  1.32k|                  return;
 4804|  1.32k|               }
 4805|  19.2k|               ++it;
 4806|       |
 4807|  19.2k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  19.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 5, False: 19.2k]
  ------------------
 4809|      5|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  19.2k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 16.8k, False: 2.37k]
  |  Branch (4812:34): [True: 3.14k, False: 13.7k]
  |  Branch (4812:48): [True: 3.18k, False: 10.5k]
  ------------------
 4813|  6.32k|                  val_t val{};
 4814|  6.32k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 6.32k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  6.32k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  6.32k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 3.18k, False: 3.14k]
  ------------------
 4820|  3.18k|                     ++it;
 4821|  3.18k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  3.18k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 4, False: 3.17k]
  ------------------
 4823|      4|                        return;
 4824|  3.17k|                     break;
 4825|  3.18k|                  }
 4826|       |
 4827|  3.14k|                  ++it; // skip comma
 4828|  3.14k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  3.14k|                  continue;
 4830|  6.32k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  12.9k|               val_t val{};
 4834|  12.9k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  12.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 345, False: 12.5k]
  ------------------
 4836|    345|                  return;
 4837|       |
 4838|  12.5k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  12.5k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  12.5k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 10.0k, False: 2.52k]
  |  Branch (4842:33): [True: 1.55k, False: 8.51k]
  ------------------
 4843|  1.55k|                  ++it;
 4844|  1.55k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|  1.55k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 9, False: 1.54k]
  ------------------
 4846|      9|                     return;
 4847|  1.54k|                  break;
 4848|  1.55k|               }
 4849|  11.0k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 8.51k, False: 2.52k]
  |  Branch (4849:38): [True: 7.17k, False: 1.34k]
  ------------------
 4850|  7.17k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  7.17k|                  yaml::skip_ws_and_newlines(it, end);
 4853|  7.17k|               }
 4854|  3.86k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 1.34k, False: 2.52k]
  |  Branch (4854:39): [True: 496, False: 849]
  |  Branch (4854:54): [True: 794, False: 55]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  1.29k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  1.29k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 1.22k, False: 64]
  |  Branch (4858:36): [True: 280, False: 946]
  ------------------
 4859|    280|                     ++it;
 4860|    280|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|    280|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 2, False: 278]
  ------------------
 4862|      2|                        return;
 4863|    278|                     break;
 4864|    280|                  }
 4865|  1.01k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 946, False: 64]
  |  Branch (4865:36): [True: 919, False: 27]
  ------------------
 4866|    919|                     ++it;
 4867|    919|                     yaml::skip_ws_and_newlines(it, end);
 4868|    919|                     continue;
 4869|    919|                  }
 4870|     91|                  ctx.error = error_code::syntax_error;
 4871|     91|                  return;
 4872|  1.01k|               }
 4873|  2.57k|               else {
 4874|  2.57k|                  ctx.error = error_code::syntax_error;
 4875|  2.57k|                  return;
 4876|  2.57k|               }
 4877|  12.5k|            }
 4878|  20.5k|         }
 4879|   262k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   262k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   262k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   262k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   262k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   262k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   262k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   262k|                           if (ctx.stream_begin) {
 4893|   262k|                              auto is_line_content_start = [&](auto pos) {
 4894|   262k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   262k|                              };
 4896|       |
 4897|   262k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   262k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   262k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   262k|                                 return line != end && *line == ':';
 4901|   262k|                              };
 4902|       |
 4903|   262k|                              if (!is_line_content_start(it) &&
 4904|   262k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   262k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   262k|                                 ctx.error = error_code::syntax_error;
 4907|   262k|                                 return false;
 4908|   262k|                              }
 4909|   262k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   262k|                           }
 4911|   262k|                        }
 4912|       |
 4913|   262k|                        if (*it == '-' &&
 4914|   262k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   262k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   262k|                           ctx.error = error_code::syntax_error;
 4918|   262k|                           return false;
 4919|   262k|                        }
 4920|       |
 4921|   262k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   262k|                           return false;
 4923|   262k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   262k|                        ctx.pop_indent();
 4925|   262k|                     }
 4926|   262k|                     else {
 4927|   262k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   262k|                        if (nested_indent >= 0) {
 4929|   262k|                           yaml::skip_to_content(it, end);
 4930|   262k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   262k|                              ctx.error = error_code::syntax_error;
 4932|   262k|                              return false;
 4933|   262k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   262k|                           const int32_t value_indent =
 4937|   262k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   262k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   262k|                              return false;
 4940|   262k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   262k|                           ctx.pop_indent();
 4942|   262k|                        }
 4943|   262k|                     }
 4944|   262k|                     return !bool(ctx.error);
 4945|   262k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   262k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   262k|                     ctx.error = error_code::syntax_error;
 4952|   262k|                     return false;
 4953|   262k|                  }
 4954|   262k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   262k|                     ++it; // skip '?'
 4956|   262k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   262k|                     const int32_t explicit_value_indicator_indent =
 4959|   262k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   262k|                     key_t key{};
 4962|   262k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   262k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   262k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   262k|                        };
 4966|       |
 4967|   262k|                        auto key_it = it;
 4968|   262k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   262k|                        auto content = key_it;
 4971|   262k|                        yaml::skip_to_content(content, end);
 4972|   262k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   262k|                        if (content != end && *content == '&') {
 4978|   262k|                           auto anchor_probe = content + 1;
 4979|   262k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   262k|                           if (!anchor_name.empty()) {
 4981|   262k|                              auto after_anchor = anchor_probe;
 4982|   262k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   262k|                              auto value_indicator = after_anchor;
 4985|   262k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   262k|                                 key.clear();
 4987|   262k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   262k|                                 it = value_indicator;
 4989|   262k|                                 handled_anchor_only_empty_key = true;
 4990|   262k|                              }
 4991|   262k|                              else {
 4992|   262k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   262k|                                    yaml::skip_comment(value_indicator, end);
 4994|   262k|                                 }
 4995|   262k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   262k|                                    yaml::skip_newline(value_indicator, end);
 4997|   262k|                                    auto value_line = value_indicator;
 4998|   262k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   262k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   262k|                                       return false;
 5001|   262k|                                    if (value_line != end && *value_line == ':' &&
 5002|   262k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   262k|                                       key.clear();
 5004|   262k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   262k|                                       it = value_line;
 5006|   262k|                                       handled_anchor_only_empty_key = true;
 5007|   262k|                                    }
 5008|   262k|                                    else if (value_line != end && *value_line == ':') {
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|   262k|                                       ctx.error = error_code::syntax_error;
 5013|   262k|                                       return false;
 5014|   262k|                                    }
 5015|   262k|                                 }
 5016|   262k|                              }
 5017|   262k|                           }
 5018|   262k|                        }
 5019|       |
 5020|   262k|                        const bool key_content_spans_lines = [&] {
 5021|   262k|                           auto scan = key_it;
 5022|   262k|                           while (scan != content && scan != end) {
 5023|   262k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   262k|                              ++scan;
 5025|   262k|                           }
 5026|   262k|                           return false;
 5027|   262k|                        }();
 5028|       |
 5029|   262k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   262k|                        }
 5032|   262k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   262k|                           key.clear();
 5034|   262k|                           it = content;
 5035|   262k|                        }
 5036|   262k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   262k|                           auto key_node_it = content;
 5042|   262k|                           auto key_node_end = end;
 5043|   262k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   262k|                              auto scan = content;
 5048|   262k|                              while (scan != end) {
 5049|   262k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   262k|                                    ++scan;
 5051|   262k|                                 }
 5052|   262k|                                 if (scan == end) {
 5053|   262k|                                    break;
 5054|   262k|                                 }
 5055|       |
 5056|   262k|                                 yaml::skip_newline(scan, end);
 5057|   262k|                                 auto line_start = scan;
 5058|       |
 5059|   262k|                                 int32_t indicator_indent = 0;
 5060|   262k|                                 while (scan != end && *scan == ' ') {
 5061|   262k|                                    ++indicator_indent;
 5062|   262k|                                    ++scan;
 5063|   262k|                                 }
 5064|       |
 5065|   262k|                                 if (scan != end && *scan == ':') {
 5066|   262k|                                    const auto after_colon = scan + 1;
 5067|   262k|                                    if ((after_colon == end ||
 5068|   262k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   262k|                                        indicator_indent <= line_indent) {
 5070|   262k|                                       key_node_end = line_start;
 5071|   262k|                                       break;
 5072|   262k|                                    }
 5073|   262k|                                 }
 5074|   262k|                              }
 5075|   262k|                           }
 5076|       |
 5077|   262k|                           glz::generic key_node{};
 5078|   262k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   262k|                           ctx.explicit_mapping_key_context = true;
 5080|   262k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   262k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   262k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   262k|                              return false;
 5084|   262k|                           it = key_node_it;
 5085|   262k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   262k|                              return false;
 5087|   262k|                        }
 5088|   262k|                     }
 5089|   262k|                     else {
 5090|   262k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   262k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   262k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   262k|                              return false;
 5094|   262k|                        }
 5095|   262k|                     }
 5096|       |
 5097|   262k|                     yaml::skip_inline_ws(it, end);
 5098|   262k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   262k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   262k|                        auto probe = it;
 5103|   262k|                        bool found_value_indicator = false;
 5104|       |
 5105|   262k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   262k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   262k|                           auto value_line = probe;
 5109|   262k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   262k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   262k|                              return false;
 5112|       |
 5113|   262k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   262k|                              probe = value_line;
 5115|   262k|                              continue; // blank line
 5116|   262k|                           }
 5117|   262k|                           if (*value_line == '#') {
 5118|   262k|                              yaml::skip_comment(value_line, end);
 5119|   262k|                              probe = value_line;
 5120|   262k|                              continue; // comment-only line
 5121|   262k|                           }
 5122|   262k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   262k|                              it = value_line;
 5124|   262k|                              found_value_indicator = true;
 5125|   262k|                           }
 5126|   262k|                           break;
 5127|   262k|                        }
 5128|       |
 5129|   262k|                        if (found_value_indicator) {
 5130|   262k|                           yaml::skip_inline_ws(it, end);
 5131|   262k|                        }
 5132|   262k|                     }
 5133|       |
 5134|   262k|                     val_t val{};
 5135|   262k|                     if (it != end && *it == ':') {
 5136|   262k|                        ++it;
 5137|   262k|                        if (it != end && *it == '\t') {
 5138|   262k|                           ctx.error = error_code::syntax_error;
 5139|   262k|                           return false;
 5140|   262k|                        }
 5141|   262k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   262k|                           auto probe = it;
 5143|   262k|                           yaml::skip_newline(probe, end);
 5144|   262k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   262k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   262k|                              ctx.error = error_code::syntax_error;
 5147|   262k|                              return false;
 5148|   262k|                           }
 5149|   262k|                        }
 5150|   262k|                        yaml::skip_inline_ws(it, end);
 5151|   262k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   262k|                           return false;
 5153|   262k|                     }
 5154|       |
 5155|   262k|                     value.emplace(std::move(key), std::move(val));
 5156|   262k|                     return true;
 5157|   262k|                  }
 5158|       |
 5159|   262k|                  key_t key{};
 5160|   262k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   262k|                     auto key_probe = it;
 5162|   262k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   262k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   262k|                     if (complex_flow_key) {
 5165|   262k|                        glz::generic key_node{};
 5166|   262k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   262k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   262k|                           return false;
 5169|   262k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   262k|                           return false;
 5171|   262k|                     }
 5172|   262k|                     else {
 5173|   262k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   262k|                           return false;
 5175|   262k|                        }
 5176|   262k|                     }
 5177|   262k|                  }
 5178|   262k|                  else {
 5179|   262k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   262k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   262k|                        return false;
 5182|   262k|                  }
 5183|       |
 5184|   262k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   262k|                  if (it == end || *it != ':') {
 5187|   262k|                     ctx.error = error_code::syntax_error;
 5188|   262k|                     return false;
 5189|   262k|                  }
 5190|   262k|                  ++it;
 5191|   262k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   262k|                  val_t val{};
 5194|   262k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   262k|                     return false;
 5196|       |
 5197|   262k|                  value.emplace(std::move(key), std::move(val));
 5198|   262k|                  return true;
 5199|   262k|               });
 5200|   262k|         }
 5201|       |
 5202|   278k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|   278k|      }
_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|   291k|      {
  466|   291k|         skip_inline_ws(it, end);
  467|       |
  468|   291k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 291k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|   291k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   291k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 4, False: 291k]
  ------------------
  477|      4|            ctx.error = error_code::syntax_error;
  478|      4|            return true;
  479|      4|         }
  480|   291k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 291k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   291k|         skip_inline_ws(it, end);
  486|       |
  487|   291k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 291k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   291k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.73k, False: 287k]
  ------------------
  495|  3.73k|            return true;
  496|  3.73k|         }
  497|       |
  498|   287k|         return false;
  499|   291k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|   291k|                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|   291k|      {
  409|   291k|         state.has_anchor = false;
  410|   291k|         state.anchor_name.clear();
  411|   291k|         state.anchor_start = nullptr;
  412|   291k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   291k|         if constexpr (Policy.allow_alias) {
  415|   291k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   291k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 283k, False: 8.44k]
  ------------------
  417|   283k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 3.70k, False: 279k]
  ------------------
  418|   283k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   291k|         }
  424|       |
  425|   291k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 287k, False: 3.70k]
  |  Branch (425:27): [True: 20.5k, False: 267k]
  ------------------
  426|  20.5k|            ++it;
  427|  20.5k|            auto name = parse_anchor_name(it, end);
  428|  20.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 18, False: 20.5k]
  ------------------
  429|     18|               ctx.error = error_code::syntax_error;
  430|     18|               return true;
  431|     18|            }
  432|  20.5k|            skip_inline_ws(it, end);
  433|  20.5k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 5, False: 20.5k]
  ------------------
  434|      5|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      5|                  ctx.error = error_code::unexpected_end;
  436|      5|               }
  437|      5|               return true;
  438|      5|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  20.5k|            state.has_anchor = true;
  446|  20.5k|            state.anchor_name = std::string(name);
  447|  20.5k|            state.anchor_start = &*it;
  448|  20.5k|         }
  449|       |
  450|   291k|         return false;
  451|   291k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   283k|      {
  301|   283k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 283k]
  |  Branch (301:27): [True: 279k, False: 3.70k]
  ------------------
  302|       |
  303|  3.70k|         ++it; // skip '*'
  304|  3.70k|         auto name = parse_anchor_name(it, end);
  305|  3.70k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 3.69k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  3.69k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.69k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 28, False: 3.66k]
  ------------------
  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|  3.66k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.66k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 909, False: 2.75k]
  ------------------
  322|    909|            return true;
  323|    909|         }
  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.75k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 19, False: 2.74k]
  ------------------
  329|     19|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     19|            return true;
  331|     19|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  2.74k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.74k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 2.73k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  2.73k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.73k]
  ------------------
  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.73k|         auto replay_it = span.begin;
  348|  2.73k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.73k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.73k|         ctx.indent_stack.clear();
  353|  2.73k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.97k, False: 760]
  ------------------
  354|  1.97k|            ctx.push_indent(span.base_indent - 1);
  355|  1.97k|         }
  356|       |
  357|  2.73k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.73k|         using V = std::remove_cvref_t<T>;
  360|  2.73k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.73k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.73k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.73k|         return true;
  367|  2.73k|      }
_ZN3glz4yaml40inline_value_has_plain_mapping_indicatorIPKcS3_EEbT_T0_:
 3104|  3.24M|      {
 3105|  3.24M|         const auto stop = yaml::implicit_key_scan_end(pos, end);
 3106|       |         // See `line_could_be_block_mapping` for why a quote is an indicator only where a node can
 3107|       |         // begin. The value segment is itself a node position, so the scan starts at one.
 3108|  3.24M|         bool at_node_start = true;
 3109|  3.24M|         int flow_depth = 0;
 3110|  28.0M|         while (pos != stop) {
  ------------------
  |  Branch (3110:17): [True: 27.7M, False: 255k]
  ------------------
 3111|  27.7M|            const char c = *pos;
 3112|  27.7M|            if (c == '\n' || c == '\r' || c == '#') return false;
  ------------------
  |  Branch (3112:17): [True: 630k, False: 27.1M]
  |  Branch (3112:30): [True: 507k, False: 26.6M]
  |  Branch (3112:43): [True: 1.30M, False: 25.3M]
  ------------------
 3113|  25.3M|            if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (3113:17): [True: 5.17M, False: 20.1M]
  |  Branch (3113:29): [True: 684k, False: 19.4M]
  ------------------
 3114|  5.86M|               ++pos;
 3115|  5.86M|               continue;
 3116|  5.86M|            }
 3117|  19.4M|            const bool node_start = std::exchange(at_node_start, false);
 3118|       |
 3119|  19.4M|            if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (3119:18): [True: 195k, False: 19.2M]
  |  Branch (3119:30): [True: 36.8k, False: 19.2M]
  |  Branch (3119:44): [True: 89.8k, False: 142k]
  ------------------
 3120|       |               // A quote in a plain scalar must not make the probe scan a later line, and the
 3121|       |               // '' escape must not be mistaken for the end of a single-quoted scalar.
 3122|  89.8k|               if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (3122:20): [True: 5.01k, False: 84.8k]
  ------------------
 3123|  84.8k|               continue;
 3124|  89.8k|            }
 3125|  19.3M|            if ((c == '[' || c == '{') && (node_start || flow_depth > 0)) {
  ------------------
  |  Branch (3125:18): [True: 253k, False: 19.1M]
  |  Branch (3125:30): [True: 540k, False: 18.5M]
  |  Branch (3125:44): [True: 633k, False: 160k]
  |  Branch (3125:58): [True: 80.8k, False: 79.2k]
  ------------------
 3126|   714k|               ++flow_depth;
 3127|   714k|               at_node_start = true;
 3128|   714k|               ++pos;
 3129|   714k|               continue;
 3130|   714k|            }
 3131|  18.6M|            if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (3131:18): [True: 124k, False: 18.5M]
  |  Branch (3131:30): [True: 287k, False: 18.2M]
  |  Branch (3131:43): [True: 191k, False: 220k]
  ------------------
 3132|   191k|               --flow_depth;
 3133|   191k|               ++pos;
 3134|   191k|               continue;
 3135|   191k|            }
 3136|  18.4M|            if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (3136:17): [True: 912k, False: 17.5M]
  |  Branch (3136:29): [True: 541k, False: 370k]
  ------------------
 3137|   541k|               const auto next = pos + 1;
 3138|   541k|               return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (3138:23): [True: 6.84k, False: 534k]
  |  Branch (3138:40): [True: 196k, False: 338k]
  |  Branch (3138:56): [True: 14.6k, False: 323k]
  |  Branch (3138:73): [True: 8.83k, False: 314k]
  |  Branch (3138:90): [True: 30.1k, False: 284k]
  ------------------
 3139|   541k|            }
 3140|  17.9M|            if (flow_depth > 0 && (c == ',' || c == ':')) {
  ------------------
  |  Branch (3140:17): [True: 3.78M, False: 14.1M]
  |  Branch (3140:36): [True: 205k, False: 3.57M]
  |  Branch (3140:48): [True: 370k, False: 3.20M]
  ------------------
 3141|   576k|               at_node_start = true;
 3142|   576k|               ++pos;
 3143|   576k|               continue;
 3144|   576k|            }
 3145|  17.3M|            if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (3145:17): [True: 5.15M, False: 12.2M]
  |  Branch (3145:31): [True: 2.38M, False: 2.76M]
  ------------------
 3146|  2.38M|               at_node_start = true;
 3147|  2.38M|               continue;
 3148|  2.38M|            }
 3149|  14.9M|            ++pos;
 3150|  14.9M|         }
 3151|   255k|         return false;
 3152|  3.24M|      }
_ZN3glz4yaml32validate_flow_node_adjacent_tailINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  947|  4.65M|      {
  948|  4.65M|         if (it == end) return;
  ------------------
  |  Branch (948:14): [True: 1.72M, False: 2.92M]
  ------------------
  949|  2.92M|         const char c = *it;
  950|       |         // After a flow collection closes, the next character must be a structural
  951|       |         // separator or whitespace/comment. Adjacent plain content is malformed.
  952|  2.92M|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}' ||
  ------------------
  |  Branch (952:14): [True: 335k, False: 2.59M]
  |  Branch (952:26): [True: 71.7k, False: 2.52M]
  |  Branch (952:39): [True: 48.3k, False: 2.47M]
  |  Branch (952:52): [True: 111k, False: 2.36M]
  |  Branch (952:65): [True: 71.5k, False: 2.28M]
  |  Branch (952:77): [True: 1.73M, False: 558k]
  |  Branch (952:89): [True: 30.9k, False: 527k]
  |  Branch (952:101): [True: 74.5k, False: 452k]
  ------------------
  953|  2.92M|             c == ':') {
  ------------------
  |  Branch (953:14): [True: 450k, False: 2.87k]
  ------------------
  954|  2.92M|            return;
  955|  2.92M|         }
  956|  2.87k|         ctx.error = error_code::syntax_error;
  957|  2.87k|      }
_ZN3glz4yaml20finalize_node_anchorINS0_12yaml_contextEPKcEEvRNS0_19node_property_stateERT_T0_:
  455|  18.2M|      {
  456|  18.2M|         if (state.has_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (456:14): [True: 438k, False: 17.7M]
  |  Branch (456:34): [True: 408k, False: 30.4k]
  ------------------
  457|   408k|            ctx.anchors[std::move(state.anchor_name)] = {state.anchor_start, &*it, state.anchor_indent};
  458|   408k|         }
  459|  18.2M|      }
_ZN3glz4yaml25skip_flow_ws_and_newlinesINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_Pb:
  869|  30.4M|      {
  870|  30.4M|         bool at_line_start = false;
  871|  30.4M|         bool saw_separation_ws = false;
  872|  30.4M|         bool line_has_indent = false;
  873|  44.4M|         while (it != end) {
  ------------------
  |  Branch (873:17): [True: 43.9M, False: 477k]
  ------------------
  874|  43.9M|            if (*it == ' ') {
  ------------------
  |  Branch (874:17): [True: 8.93M, False: 35.0M]
  ------------------
  875|  8.93M|               ++it;
  876|  8.93M|               saw_separation_ws = true;
  877|  8.93M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (877:20): [True: 2.70M, False: 6.22M]
  ------------------
  878|  8.93M|               continue;
  879|  8.93M|            }
  880|  35.0M|            if (*it == '\t') {
  ------------------
  |  Branch (880:17): [True: 534k, False: 34.4M]
  ------------------
  881|   534k|               if (at_line_start && !line_has_indent) {
  ------------------
  |  Branch (881:20): [True: 160k, False: 374k]
  |  Branch (881:37): [True: 107k, False: 52.5k]
  ------------------
  882|   107k|                  auto probe = it;
  883|   266k|                  while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (883:26): [True: 263k, False: 2.74k]
  |  Branch (883:43): [True: 23.9k, False: 239k]
  |  Branch (883:60): [True: 134k, False: 104k]
  ------------------
  884|   107k|                  if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (884:23): [True: 104k, False: 2.74k]
  |  Branch (884:39): [True: 94.8k, False: 10.0k]
  |  Branch (884:57): [True: 17.7k, False: 77.0k]
  |  Branch (884:75): [True: 15.8k, False: 1.92k]
  ------------------
  885|  15.8k|                     const char c = *probe;
  886|  15.8k|                     const bool allowed_flow_delim = (c == ']' || c == '}' || c == '[' || c == '{' || c == ',');
  ------------------
  |  Branch (886:55): [True: 650, False: 15.1k]
  |  Branch (886:67): [True: 4.41k, False: 10.7k]
  |  Branch (886:79): [True: 290, False: 10.4k]
  |  Branch (886:91): [True: 350, False: 10.1k]
  |  Branch (886:103): [True: 9.90k, False: 202]
  ------------------
  887|  15.8k|                     if (!allowed_flow_delim) {
  ------------------
  |  Branch (887:26): [True: 202, False: 15.6k]
  ------------------
  888|    202|                        ctx.error = error_code::syntax_error;
  889|    202|                        return;
  890|    202|                     }
  891|  15.8k|                  }
  892|   107k|               }
  893|   534k|               ++it;
  894|   534k|               saw_separation_ws = true;
  895|   534k|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (895:20): [True: 159k, False: 374k]
  ------------------
  896|   534k|               continue;
  897|   534k|            }
  898|  34.4M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (898:17): [True: 953k, False: 33.5M]
  |  Branch (898:32): [True: 3.35M, False: 30.1M]
  ------------------
  899|  4.30M|               skip_newline(it, end);
  900|  4.30M|               if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (900:20): [True: 13.4k, False: 4.29M]
  ------------------
  901|  4.30M|               at_line_start = true;
  902|  4.30M|               saw_separation_ws = true;
  903|  4.30M|               line_has_indent = false;
  904|  4.30M|               continue;
  905|  4.30M|            }
  906|  30.1M|            if (*it == '#') {
  ------------------
  |  Branch (906:17): [True: 273k, False: 29.8M]
  ------------------
  907|       |               // In flow style, comments require separation from the previous token.
  908|       |               // Allow comment-only lines and comments after inline whitespace, but
  909|       |               // reject adjacency forms like ",#comment" (CVW2).
  910|   273k|               bool separated_by_prev_ws = false;
  911|   273k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
  912|   273k|                  if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (912:23): [True: 273k, False: 0]
  |  Branch (912:43): [True: 273k, False: 0]
  ------------------
  913|   273k|                     const char prev = *(it - 1);
  914|   273k|                     separated_by_prev_ws = (prev == ' ' || prev == '\t');
  ------------------
  |  Branch (914:46): [True: 122k, False: 151k]
  |  Branch (914:61): [True: 21.8k, False: 129k]
  ------------------
  915|   273k|                  }
  916|   273k|               }
  917|   273k|               if (!(at_line_start || saw_separation_ws || separated_by_prev_ws)) {
  ------------------
  |  Branch (917:22): [True: 130k, False: 143k]
  |  Branch (917:39): [True: 50.4k, False: 93.2k]
  |  Branch (917:60): [True: 62.4k, False: 30.8k]
  ------------------
  918|  30.8k|                  break;
  919|  30.8k|               }
  920|   243k|               skip_comment(it, end);
  921|   243k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (921:20): [True: 239k, False: 3.23k]
  |  Branch (921:34): [True: 129k, False: 109k]
  |  Branch (921:49): [True: 109k, False: 626]
  ------------------
  922|   239k|                  skip_newline(it, end);
  923|   239k|                  if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (923:23): [True: 3.59k, False: 235k]
  ------------------
  924|   239k|                  at_line_start = true;
  925|   239k|                  saw_separation_ws = true;
  926|   239k|                  continue;
  927|   239k|               }
  928|  3.86k|               continue;
  929|   243k|            }
  930|       |
  931|       |            // In block context, multiline flow nodes require indentation on content
  932|       |            // continuation lines (except structural tokens).
  933|  29.8M|            if (at_line_start && ctx.current_indent() >= 0 && !line_has_indent) {
  ------------------
  |  Branch (933:17): [True: 2.87M, False: 27.0M]
  |  Branch (933:34): [True: 143k, False: 2.73M]
  |  Branch (933:63): [True: 58.8k, False: 84.6k]
  ------------------
  934|  58.8k|               const char c = *it;
  935|  58.8k|               const bool structural = (c == ']' || c == '}' || c == ',');
  ------------------
  |  Branch (935:41): [True: 1.91k, False: 56.9k]
  |  Branch (935:53): [True: 20.0k, False: 36.9k]
  |  Branch (935:65): [True: 36.3k, False: 568]
  ------------------
  936|  58.8k|               if (!structural) {
  ------------------
  |  Branch (936:20): [True: 568, False: 58.2k]
  ------------------
  937|    568|                  ctx.error = error_code::syntax_error;
  938|    568|                  return;
  939|    568|               }
  940|  58.8k|            }
  941|  29.8M|            break;
  942|  29.8M|         }
  943|  30.4M|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.94M|      {
  275|  1.94M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.94M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.94M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.94M|      }
_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_:
 5752|  2.66M|      {
 5753|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5754|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5755|  2.66M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  2.66M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  2.66M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  2.66M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  2.66M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 2.66M]
  ------------------
 5760|      0|            return;
 5761|       |
 5762|       |         // No depth is taken here: the sequence and mapping readers this dispatches to count the
 5763|       |         // levels, so a scalar at the bottom of a document costs nothing, as in JSON. The one way
 5764|       |         // back into this reader that opens no collection is `redispatch`, which counts itself.
 5765|       |
 5766|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5767|       |         // For nested values, only skip inline whitespace to preserve block structure
 5768|  2.66M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 2.17M, False: 485k]
  ------------------
 5769|  2.17M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  2.17M|         }
 5771|   485k|         else {
 5772|   485k|            yaml::skip_inline_ws(it, end);
 5773|   485k|         }
 5774|       |
 5775|  2.66M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 418, False: 2.66M]
  ------------------
 5776|    418|            ctx.error = error_code::unexpected_end;
 5777|    418|            return;
 5778|    418|         }
 5779|       |
 5780|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5781|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5782|       |         // same variant definitions round-trip across both formats.
 5783|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5784|       |            using V = std::remove_cvref_t<T>;
 5785|       |            const bool value_is_mapping =
 5786|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5787|       |            if (value_is_mapping) {
 5788|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5789|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5790|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5791|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5792|       |               auto tag_ctx = ctx.make_speculative();
 5793|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5794|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5795|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5796|       |               if (index < ids_v<V>.size()) {
 5797|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5798|       |                  emplace_runtime_variant(value, index);
 5799|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5800|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5801|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5802|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5803|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5804|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5805|       |                     return;
 5806|       |                  }
 5807|       |                  std::visit(
 5808|       |                     [&](auto&& alt) {
 5809|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5810|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5811|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5812|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5813|       |                        }
 5814|       |                        else if constexpr (custom_read<Alt>) {
 5815|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5816|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5817|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5818|       |                           // entry, then hand the remaining mapping to the custom handler.
 5819|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5820|       |                              ctx.error = error_code::feature_not_supported;
 5821|       |                              ctx.custom_error_message =
 5822|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5823|       |                           }
 5824|       |                           else {
 5825|       |                              ctx.scratch.clear();
 5826|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5827|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5828|       |                                    ctx.error = error_code::feature_not_supported;
 5829|       |                                    ctx.custom_error_message =
 5830|       |                                       "the tag must be the first key for a custom variant alternative";
 5831|       |                                 }
 5832|       |                                 else {
 5833|       |                                    yaml::skip_inline_ws(it, end);
 5834|       |                                    if (it == end || *it != ':') {
 5835|       |                                       ctx.error = error_code::syntax_error;
 5836|       |                                    }
 5837|       |                                    else {
 5838|       |                                       ++it;
 5839|       |                                       yaml::skip_inline_ws(it, end);
 5840|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5841|       |                                       if (!bool(ctx.error)) {
 5842|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5843|       |                                          // was the whole mapping: leave the alternative default.
 5844|       |                                          auto probe = it;
 5845|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5846|       |                                          if (probe == end) {
 5847|       |                                             it = probe;
 5848|       |                                          }
 5849|       |                                          else {
 5850|       |                                             // Publish the mapping's column so the custom handler's block
 5851|       |                                             // mapping (which would otherwise discover its own indent) reads
 5852|       |                                             // the remaining entries at the variant's indent and dedents
 5853|       |                                             // correctly in every context (root, sequence, nested).
 5854|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5855|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5856|       |                                             ctx.forced_block_mapping_indent = -1;
 5857|       |                                          }
 5858|       |                                       }
 5859|       |                                    }
 5860|       |                                 }
 5861|       |                              }
 5862|       |                           }
 5863|       |                        }
 5864|       |                        else {
 5865|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5866|       |                           // the value, but the mapping must still be consumed.
 5867|       |                           walk_tagged_mapping<Opts>(
 5868|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5869|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5870|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5871|       |                              });
 5872|       |                        }
 5873|       |                     },
 5874|       |                     value);
 5875|       |                  ctx.pop_indent();
 5876|       |                  return;
 5877|       |               }
 5878|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5879|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5880|       |               // otherwise the deduction path reports no_matching_variant_type.
 5881|       |            }
 5882|       |         }
 5883|       |
 5884|  2.66M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  2.66M|            using V = std::remove_cvref_t<T>;
 5886|  2.66M|            using counts = yaml_variant_type_count<V>;
 5887|  2.66M|            const char c = *it;
 5888|  2.66M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  2.66M|               switch (ch) {
 5890|  2.66M|               case ' ':
 5891|  2.66M|               case '\t':
 5892|  2.66M|               case '\n':
 5893|  2.66M|               case '\r':
 5894|  2.66M|               case ',':
 5895|  2.66M|               case ']':
 5896|  2.66M|               case '}':
 5897|  2.66M|                  return true;
 5898|  2.66M|               default:
 5899|  2.66M|                  return false;
 5900|  2.66M|               }
 5901|  2.66M|            };
 5902|       |
 5903|  2.66M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  2.66M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  2.66M|                  return false;
 5906|  2.66M|               }
 5907|  2.66M|               if (ctx.current_indent() < 0) {
 5908|  2.66M|                  return false;
 5909|  2.66M|               }
 5910|  2.66M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  2.66M|                  return false;
 5912|  2.66M|               }
 5913|       |
 5914|  2.66M|               auto look = word_end;
 5915|  2.66M|               yaml::skip_newline(look, end);
 5916|  2.66M|               while (look != end) {
 5917|  2.66M|                  int32_t line_indent = 0;
 5918|  2.66M|                  while (look != end && *look == ' ') {
 5919|  2.66M|                     ++line_indent;
 5920|  2.66M|                     ++look;
 5921|  2.66M|                  }
 5922|  2.66M|                  if (look != end && *look == '\t') {
 5923|  2.66M|                     return false;
 5924|  2.66M|                  }
 5925|  2.66M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  2.66M|                     if (look != end) {
 5927|  2.66M|                        yaml::skip_newline(look, end);
 5928|  2.66M|                        continue;
 5929|  2.66M|                     }
 5930|  2.66M|                     return false;
 5931|  2.66M|                  }
 5932|  2.66M|                  if (*look == '#') {
 5933|  2.66M|                     yaml::skip_comment(look, end);
 5934|  2.66M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  2.66M|                        yaml::skip_newline(look, end);
 5936|  2.66M|                        continue;
 5937|  2.66M|                     }
 5938|  2.66M|                     return false;
 5939|  2.66M|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  2.66M|                  {
 5945|  2.66M|                     auto scan = look;
 5946|  2.66M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  2.66M|                        if (*scan == ':') {
 5948|  2.66M|                           auto after_colon = scan + 1;
 5949|  2.66M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  2.66M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  2.66M|                              return false;
 5952|  2.66M|                           }
 5953|  2.66M|                        }
 5954|  2.66M|                        ++scan;
 5955|  2.66M|                     }
 5956|  2.66M|                  }
 5957|       |
 5958|  2.66M|                  return line_indent > ctx.current_indent();
 5959|  2.66M|               }
 5960|  2.66M|               return false;
 5961|  2.66M|            };
 5962|  2.66M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  2.66M|               if (ptr == end) {
 5964|  2.66M|                  return true;
 5965|  2.66M|               }
 5966|  2.66M|               if (*ptr == ':') {
 5967|  2.66M|                  auto next = ptr + 1;
 5968|  2.66M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  2.66M|               }
 5970|  2.66M|               return is_plain_scalar_boundary(*ptr);
 5971|  2.66M|            };
 5972|       |
 5973|  2.66M|            switch (c) {
 5974|   537k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 537k, False: 2.12M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   537k|               ++it;
 5977|   537k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   537k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 184, False: 537k]
  ------------------
 5979|    184|                  ctx.error = error_code::syntax_error;
 5980|    184|                  return;
 5981|    184|               }
 5982|   537k|               yaml::skip_inline_ws(it, end);
 5983|   537k|               bool anchor_on_same_line = true;
 5984|   537k|               bool value_is_indentless_sequence = false;
 5985|   537k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 5.30k, False: 531k]
  |  Branch (5985:33): [True: 23.5k, False: 508k]
  |  Branch (5985:48): [True: 39.6k, False: 468k]
  |  Branch (5985:63): [True: 4.89k, False: 463k]
  ------------------
 5986|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5987|       |                  // next line (indented past current context) or if this is an empty node.
 5988|  73.3k|                  bool value_on_next_line = false;
 5989|  73.3k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 68.0k, False: 5.30k]
  ------------------
 5990|  68.0k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|  68.0k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 4.89k, False: 63.1k]
  ------------------
 5993|  37.6k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 37.3k, False: 253]
  |  Branch (5993:47): [True: 35.4k, False: 1.94k]
  |  Branch (5993:64): [True: 32.7k, False: 2.69k]
  ------------------
 5994|  4.89k|                     }
 5995|       |                     // Skip newline
 5996|  68.0k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 67.8k, False: 253]
  |  Branch (5996:42): [True: 25.5k, False: 42.3k]
  |  Branch (5996:59): [True: 42.3k, False: 0]
  ------------------
 5997|  67.8k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   120k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 118k, False: 2.03k]
  |  Branch (5999:48): [True: 26.8k, False: 91.9k]
  |  Branch (5999:65): [True: 26.1k, False: 65.7k]
  ------------------
 6000|  53.0k|                           yaml::skip_newline(peek, end);
 6001|  53.0k|                        }
 6002|       |                        // Measure indent of next content line
 6003|  67.8k|                        int32_t next_indent = 0;
 6004|   179k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 176k, False: 2.86k]
  |  Branch (6004:47): [True: 112k, False: 64.9k]
  ------------------
 6005|   112k|                           ++next_indent;
 6006|   112k|                           ++peek;
 6007|   112k|                        }
 6008|  67.8k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 64.9k, False: 2.86k]
  |  Branch (6008:44): [True: 62.7k, False: 2.16k]
  |  Branch (6008:61): [True: 62.4k, False: 376]
  ------------------
 6009|  62.4k|                           const bool indentless_sequence =
 6010|  62.4k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 60.6k, False: 1.71k]
  |  Branch (6010:69): [True: 15.4k, False: 45.2k]
  ------------------
 6011|  15.4k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 526, False: 14.8k]
  ------------------
 6012|  14.8k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 14.2k, False: 677]
  ------------------
 6013|  14.7k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 1.01k, False: 13.7k]
  ------------------
 6014|  13.7k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 8.39k, False: 5.33k]
  |  Branch (6014:61): [True: 7.65k, False: 741]
  ------------------
 6015|  62.4k|                           value_is_indentless_sequence = indentless_sequence;
 6016|  62.4k|                           const bool same_indent_property_node =
 6017|  62.4k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 8.26k, False: 54.1k]
  ------------------
 6018|  8.26k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 403, False: 7.86k]
  |  Branch (6018:48): [True: 1.48k, False: 6.37k]
  |  Branch (6018:64): [True: 321, False: 6.05k]
  |  Branch (6018:80): [True: 340, False: 5.71k]
  |  Branch (6018:96): [True: 291, False: 5.42k]
  ------------------
 6019|  5.42k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 399, False: 5.02k]
  |  Branch (6019:48): [True: 661, False: 4.36k]
  |  Branch (6019:65): [True: 223, False: 4.14k]
  |  Branch (6019:81): [True: 547, False: 3.59k]
  ------------------
 6020|  62.4k|                           value_on_next_line =
 6021|  62.4k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 38.2k, False: 24.1k]
  |  Branch (6021:71): [True: 8.67k, False: 15.4k]
  |  Branch (6021:94): [True: 4.67k, False: 10.7k]
  ------------------
 6022|  62.4k|                        }
 6023|  67.8k|                     }
 6024|  68.0k|                  }
 6025|  73.3k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 21.7k, False: 51.6k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  21.7k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  21.7k|                     return;
 6029|  21.7k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|  51.6k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 2.62k, False: 48.9k]
  ------------------
 6032|  19.7k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 19.7k, False: 0]
  |  Branch (6032:42): [True: 18.0k, False: 1.74k]
  |  Branch (6032:57): [True: 17.1k, False: 886]
  ------------------
 6033|  2.62k|                  }
 6034|  51.6k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 51.6k, False: 0]
  ------------------
 6035|  84.2k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 84.2k, False: 0]
  |  Branch (6035:40): [True: 11.5k, False: 72.7k]
  |  Branch (6035:55): [True: 21.1k, False: 51.6k]
  ------------------
 6036|  32.6k|                     yaml::skip_newline(it, end);
 6037|  32.6k|                  }
 6038|  51.6k|                  yaml::skip_inline_ws(it, end);
 6039|  51.6k|                  anchor_on_same_line = false;
 6040|  51.6k|               }
 6041|       |
 6042|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|       |                  if (anchor_on_same_line && *it == '-' &&
 6044|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|       |                     ctx.error = error_code::syntax_error;
 6047|       |                     return;
 6048|       |                  }
 6049|       |               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   515k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 515k, False: 14]
  |  Branch (6053:33): [True: 506, False: 514k]
  |  Branch (6053:47): [True: 69, False: 437]
  ------------------
 6054|     69|                  ctx.error = error_code::syntax_error;
 6055|     69|                  return;
 6056|     69|               }
 6057|       |
 6058|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 6060|       |                     auto probe = it + 1;
 6061|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|       |                     if (nested_anchor_name.empty()) {
 6063|       |                        ctx.error = error_code::syntax_error;
 6064|       |                        return;
 6065|       |                     }
 6066|       |                     yaml::skip_inline_ws(probe, end);
 6067|       |                     // Allow nested anchor usage only when it clearly starts a
 6068|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6069|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6070|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 6071|       |                        ctx.error = error_code::syntax_error;
 6072|       |                        return;
 6073|       |                     }
 6074|       |                  }
 6075|       |               }
 6076|       |
 6077|   515k|               const char* anchor_start = &*it;
 6078|   515k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6081|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6082|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6083|       |                  // next line, the anchor applies to the entire next-line content.
 6084|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 6085|       |                     auto key_start = it;
 6086|       |                     if (*key_start == '!') {
 6087|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 6089|       |                           ctx.error = error_code::syntax_error;
 6090|       |                           return;
 6091|       |                        }
 6092|       |                        yaml::skip_inline_ws(key_start, end);
 6093|       |                        if (key_start == end) {
 6094|       |                           ctx.error = error_code::unexpected_end;
 6095|       |                           return;
 6096|       |                        }
 6097|       |                        if (*key_start == '\n' || *key_start == '\r') {
 6098|       |                           ctx.error = error_code::syntax_error;
 6099|       |                           return;
 6100|       |                        }
 6101|       |
 6102|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6103|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6104|       |                        // key-span registration below while the untagged spelling was rejected;
 6105|       |                        // an alias node carries no other properties either way.
 6106|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 6107|       |                           ctx.error = error_code::syntax_error;
 6108|       |                           return;
 6109|       |                        }
 6110|       |                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|       |                     auto key_scan = key_start;
 6114|       |                     auto key_end = key_start;
 6115|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6116|       |                        // Quoted key: skip to closing quote
 6117|       |                        const char quote = *key_scan;
 6118|       |                        ++key_scan;
 6119|       |                        while (key_scan != end && *key_scan != quote) {
 6120|       |                           if (*key_scan == '\\' && quote == '"') {
 6121|       |                              ++key_scan;
 6122|       |                              if (key_scan != end) ++key_scan;
 6123|       |                           }
 6124|       |                           else {
 6125|       |                              ++key_scan;
 6126|       |                           }
 6127|       |                        }
 6128|       |                        if (key_scan == end) {
 6129|       |                           ctx.error = error_code::syntax_error;
 6130|       |                           return;
 6131|       |                        }
 6132|       |                        ++key_scan; // past closing quote
 6133|       |                        key_end = key_scan;
 6134|       |                        yaml::skip_inline_ws(key_scan, end);
 6135|       |                     }
 6136|       |                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|       |                        while (key_scan != end) {
 6139|       |                           if (*key_scan == ':') {
 6140|       |                              auto next = key_scan + 1;
 6141|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6142|       |                                 break;
 6143|       |                              }
 6144|       |                           }
 6145|       |                           ++key_scan;
 6146|       |                        }
 6147|       |                        key_end = key_scan;
 6148|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6149|       |                           --key_end;
 6150|       |                        }
 6151|       |                     }
 6152|       |                     if (key_scan == end || *key_scan != ':') {
 6153|       |                        ctx.error = error_code::syntax_error;
 6154|       |                        return;
 6155|       |                     }
 6156|       |                     // Store anchor with just the key text span
 6157|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|       |                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|       |                     if constexpr (counts::n_object > 0) {
 6161|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|       |                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|       |                     return;
 6168|       |                  }
 6169|       |               }
 6170|       |
 6171|   515k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   515k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   515k|               redispatch<Opts>(value, ctx, it, end);
 6174|   515k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   515k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 504k, False: 11.1k]
  ------------------
 6176|   504k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|   504k|               }
 6178|   515k|               return;
 6179|   515k|            }
 6180|   175k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 175k, False: 2.48M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6184|       |                     if constexpr (counts::n_object > 0) {
 6185|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|       |                                                                                                        end);
 6187|       |                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|       |                  }
 6194|       |               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|   175k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   175k|               return;
 6199|   515k|            }
 6200|   181k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 181k, False: 2.47M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   181k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   181k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 38, False: 181k]
  ------------------
 6204|     38|                  ctx.error = error_code::syntax_error;
 6205|     38|                  return;
 6206|     38|               }
 6207|   181k|               yaml::skip_inline_ws(it, end);
 6208|   181k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 180k, False: 1.04k]
  |  Branch (6208:33): [True: 9.81k, False: 170k]
  ------------------
 6209|  9.81k|                  yaml::skip_comment(it, end);
 6210|  9.81k|               }
 6211|   181k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 180k, False: 1.63k]
  |  Branch (6211:34): [True: 13.9k, False: 166k]
  |  Branch (6211:49): [True: 24.7k, False: 141k]
  ------------------
 6212|  38.6k|                  auto content = it;
 6213|  38.6k|                  yaml::skip_newline(content, end);
 6214|  38.6k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|  38.6k|                  bool consume_following_content = false;
 6217|  38.6k|                  auto content_token = content;
 6218|  38.6k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 35.1k, False: 3.53k]
  ------------------
 6219|  35.1k|                     auto indent_probe = content;
 6220|  35.1k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  35.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 2, False: 35.1k]
  ------------------
 6222|      2|                        return;
 6223|  35.1k|                     content_token = indent_probe;
 6224|       |
 6225|       |                     // A tag at the end of a sequence/map entry has an empty value
 6226|       |                     // unless the next non-empty content is nested under the current node.
 6227|  35.1k|                     bool tagged_indentless_sequence = false;
 6228|  35.1k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 6.29k, False: 28.8k]
  |  Branch (6228:56): [True: 6.29k, False: 0]
  |  Branch (6228:79): [True: 5.59k, False: 699]
  ------------------
 6229|  5.59k|                        const auto after_dash = indent_probe + 1;
 6230|  5.59k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 294, False: 5.29k]
  ------------------
 6231|  5.29k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 4.95k, False: 345]
  ------------------
 6232|  5.24k|                           tagged_indentless_sequence =
 6233|  5.24k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 410, False: 4.83k]
  ------------------
 6234|  4.83k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 2.45k, False: 2.38k]
  |  Branch (6234:60): [True: 435, False: 2.01k]
  ------------------
 6235|  5.24k|                        }
 6236|  5.59k|                     }
 6237|       |
 6238|  35.1k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 16.5k, False: 18.5k]
  ------------------
 6239|  18.5k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 8.82k, False: 9.72k]
  |  Branch (6239:93): [True: 845, False: 8.88k]
  ------------------
 6240|  35.1k|                  }
 6241|       |
 6242|  38.6k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 26.2k, False: 12.4k]
  ------------------
 6243|  26.2k|                     it = content_token;
 6244|  26.2k|                  }
 6245|  12.4k|                  else {
 6246|  12.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 391, False: 12.0k]
  ------------------
 6247|    391|                        if constexpr (counts::n_str > 0) {
 6248|    391|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|    391|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|    391|                           value = StrType{};
 6251|    391|                           return;
 6252|    391|                        }
 6253|    391|                     }
 6254|  12.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 316, False: 12.0k]
  ------------------
 6255|    316|                        if constexpr (counts::n_null > 0) {
 6256|    316|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    316|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    316|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 316]
  ------------------
 6259|    316|                           return;
 6260|    316|                        }
 6261|    316|                     }
 6262|  12.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 9.84k, False: 2.57k]
  ------------------
 6263|  9.84k|                        if constexpr (counts::n_null > 0) {
 6264|  9.84k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  9.84k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  9.84k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 9.84k]
  ------------------
 6267|  9.84k|                           return;
 6268|  9.84k|                        }
 6269|  9.84k|                     }
 6270|  12.4k|                  }
 6271|  38.6k|               }
 6272|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6273|       |                  // In block context, a comma immediately after a tag token is malformed
 6274|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6275|       |                  if (it != end && *it == ',') {
 6276|       |                     ctx.error = error_code::syntax_error;
 6277|       |                     return;
 6278|       |                  }
 6279|       |                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|       |                     const bool starts_block_sequence_entry =
 6282|       |                        (it != end && *it == '-') &&
 6283|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6284|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6285|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6286|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6287|       |                        redispatch<Opts>(value, ctx, it, end);
 6288|       |                        return;
 6289|       |                     }
 6290|       |                  }
 6291|       |               }
 6292|   181k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 1.63k, False: 180k]
  ------------------
 6293|  1.63k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 526, False: 1.10k]
  ------------------
 6294|    526|                     if constexpr (counts::n_str > 0) {
 6295|    526|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|    526|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|    526|                        value = StrType{};
 6298|    526|                        return;
 6299|    526|                     }
 6300|    526|                  }
 6301|  1.63k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 1.09k, False: 536]
  ------------------
 6302|  1.09k|                     if constexpr (counts::n_null > 0) {
 6303|  1.09k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  1.09k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  1.09k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 1.09k]
  ------------------
 6306|  1.09k|                        return;
 6307|  1.09k|                     }
 6308|  1.09k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  1.63k|                  return;
 6311|  1.63k|               }
 6312|   180k|               switch (tag) {
 6313|    358|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 358, False: 179k]
  ------------------
 6314|    358|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|    358|                  return;
 6316|  1.87k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 1.87k, False: 178k]
  ------------------
 6317|  4.81k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 2.93k, False: 177k]
  ------------------
 6318|  4.81k|                  if constexpr (counts::n_num > 0) {
 6319|  4.81k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  4.81k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  19.5k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 14.7k, False: 165k]
  ------------------
 6327|  19.5k|                  if constexpr (counts::n_bool > 0) {
 6328|  19.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  19.5k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  19.9k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 418, False: 179k]
  ------------------
 6336|  19.9k|                  if constexpr (counts::n_null > 0) {
 6337|  19.9k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  19.9k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  19.9k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 19.9k]
  ------------------
 6340|  19.9k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  19.9k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  38.1k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 18.2k, False: 161k]
  ------------------
 6348|  38.1k|                  if constexpr (counts::n_object > 0) {
 6349|  38.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  38.1k|                                                                                                     end);
 6351|  38.1k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  52.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 13.8k, False: 166k]
  ------------------
 6358|  52.0k|                  if constexpr (counts::n_array > 0) {
 6359|  52.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|       |                        if (it != end && *it == '-') {
 6362|       |                           ctx.allow_indentless_sequence = true;
 6363|       |                        }
 6364|       |                     }
 6365|  52.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  52.0k|                                                                                                    end);
 6367|  52.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  52.0k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   169k|               default: {
  ------------------
  |  Branch (6374:16): [True: 117k, False: 62.9k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   169k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 117k, False: 52.0k]
  |  Branch (6377:36): [True: 57.4k, False: 59.6k]
  ------------------
 6378|  57.4k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  57.4k|                     return;
 6380|  57.4k|                  }
 6381|       |
 6382|   111k|                  if constexpr (counts::n_array > 0) {
 6383|   111k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 59.6k, False: 52.0k]
  |  Branch (6383:39): [True: 848, False: 58.8k]
  ------------------
 6384|    848|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|    848|                                                                                                       end);
 6386|    848|                        return;
 6387|    848|                     }
 6388|   111k|                  }
 6389|   111k|                  if constexpr (counts::n_object > 0) {
 6390|   111k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 58.8k, False: 52.8k]
  |  Branch (6390:39): [True: 919, False: 57.9k]
  ------------------
 6391|    919|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|    919|                                                                                                        end);
 6393|    919|                        return;
 6394|    919|                     }
 6395|   111k|                  }
 6396|       |
 6397|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|       |                     if constexpr (counts::n_array > 0) {
 6399|       |                        const bool starts_block_sequence_entry =
 6400|       |                           (it != end && *it == '-') &&
 6401|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6402|       |                        if (starts_block_sequence_entry) {
 6403|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|       |                                                                                                          it, end);
 6405|       |                           return;
 6406|       |                        }
 6407|       |                     }
 6408|       |                     if constexpr (counts::n_object > 0) {
 6409|       |                        const bool starts_explicit_mapping_indicator =
 6410|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6411|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6412|       |                        if (starts_explicit_mapping_indicator) {
 6413|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|       |                                                                                                           it, end);
 6415|       |                           return;
 6416|       |                        }
 6417|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6418|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6419|       |                                                                                                           it, end);
 6420|       |                           return;
 6421|       |                        }
 6422|       |                     }
 6423|       |                  }
 6424|       |
 6425|   111k|                  if constexpr (counts::n_str > 0) {
 6426|   111k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   111k|                     return;
 6428|   111k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   111k|                  return;
 6433|   169k|               }
 6434|   180k|               }
 6435|      0|               return;
 6436|   180k|            }
 6437|   413k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 413k, False: 2.24M]
  ------------------
 6438|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6441|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|       |                                                                                                     end);
 6443|       |                     return;
 6444|       |                  }
 6445|       |               }
 6446|       |               // Flow mapping - object type
 6447|   413k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|   413k|               return;
 6449|  38.8k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 38.8k, False: 2.62M]
  ------------------
 6450|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6453|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|       |                                                                                                     end);
 6455|       |                     return;
 6456|       |                  }
 6457|       |               }
 6458|       |               // Flow sequence - array type
 6459|  38.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  38.8k|               return;
 6461|   111k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 111k, False: 2.54M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   111k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 111k, False: 649]
  |  Branch (6463:39): [True: 3, False: 111k]
  ------------------
 6464|      3|                  ctx.error = error_code::syntax_error;
 6465|      3|                  return;
 6466|      3|               }
 6467|   111k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 111k, False: 649]
  |  Branch (6467:40): [True: 35.2k, False: 76.0k]
  |  Branch (6467:56): [True: 56.1k, False: 19.9k]
  |  Branch (6467:73): [True: 9.25k, False: 10.6k]
  ------------------
 6468|   100k|                  if constexpr (counts::n_object > 0) {
 6469|   100k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   100k|                                                                                                     end);
 6471|   100k|                     return;
 6472|   100k|                  }
 6473|   100k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   111k|               return;
 6476|     14|            case '%':
  ------------------
  |  Branch (6476:13): [True: 14, False: 2.66M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     14|               ctx.error = error_code::syntax_error;
 6479|     14|               return;
 6480|  5.91k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 5.91k, False: 2.65M]
  ------------------
 6481|  8.40k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 2.48k, False: 2.65M]
  ------------------
 6482|       |               // Could be a quoted string OR a quoted key in a block mapping
 6483|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6484|  8.40k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  8.40k|               return;
 6486|  13.1k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 13.1k, False: 2.64M]
  ------------------
 6487|  23.2k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 10.0k, False: 2.65M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  23.2k|               if constexpr (counts::n_bool > 0) {
 6490|  23.2k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 22.5k, False: 656]
  |  Branch (6490:44): [True: 13.6k, False: 8.96k]
  |  Branch (6490:60): [True: 12.5k, False: 1.05k]
  |  Branch (6490:76): [True: 9.99k, False: 2.56k]
  ------------------
 6491|  12.5k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 2.00k, False: 10.5k]
  |  Branch (6491:60): [True: 1.31k, False: 695]
  |  Branch (6491:76): [True: 977, False: 335]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  10.9k|                     const auto after_true = it + 4;
 6494|  10.9k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  10.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 10.0k, False: 940]
  ------------------
 6497|  10.0k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 0, False: 10.0k]
  ------------------
 6498|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|      0|                           return;
 6500|      0|                        }
 6501|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6502|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6503|  10.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 9.66k, False: 369]
  |  Branch (6503:47): [True: 6.43k, False: 3.23k]
  ------------------
 6504|  6.43k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 292, False: 6.13k]
  |  Branch (6504:47): [True: 2.98k, False: 3.14k]
  |  Branch (6504:63): [True: 1.94k, False: 1.20k]
  |  Branch (6504:80): [True: 229, False: 975]
  |  Branch (6504:97): [True: 975, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  6.43k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  6.43k|                           return;
 6508|  6.43k|                        }
 6509|  3.59k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  3.59k|                                                                                                      end);
 6511|  3.59k|                        return;
 6512|  10.0k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  10.9k|                  }
 6515|  23.2k|               }
 6516|  13.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  23.2k|               return;
 6518|  19.5k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 19.5k, False: 2.64M]
  ------------------
 6519|  25.6k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 6.02k, False: 2.65M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  25.6k|               if constexpr (counts::n_bool > 0) {
 6522|  25.6k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 25.1k, False: 483]
  |  Branch (6522:44): [True: 13.0k, False: 12.1k]
  |  Branch (6522:60): [True: 9.29k, False: 3.72k]
  |  Branch (6522:76): [True: 8.21k, False: 1.07k]
  |  Branch (6522:92): [True: 7.59k, False: 624]
  ------------------
 6523|  17.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 2.27k, False: 15.2k]
  |  Branch (6523:60): [True: 1.82k, False: 451]
  |  Branch (6523:76): [True: 1.46k, False: 356]
  |  Branch (6523:92): [True: 405, False: 1.06k]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  7.99k|                     const auto after_false = it + 5;
 6526|  7.99k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  7.99k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 6.77k, False: 1.22k]
  ------------------
 6529|  6.77k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 0, False: 6.77k]
  ------------------
 6530|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|      0|                           return;
 6532|      0|                        }
 6533|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6534|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6535|  6.77k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 6.35k, False: 419]
  |  Branch (6535:47): [True: 4.83k, False: 1.52k]
  ------------------
 6536|  4.83k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 235, False: 4.59k]
  |  Branch (6536:47): [True: 562, False: 4.03k]
  |  Branch (6536:63): [True: 1.95k, False: 2.07k]
  |  Branch (6536:80): [True: 893, False: 1.18k]
  |  Branch (6536:97): [True: 1.18k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  4.83k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  4.83k|                           return;
 6540|  4.83k|                        }
 6541|  1.94k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  1.94k|                                                                                                      end);
 6543|  1.94k|                        return;
 6544|  6.77k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  7.99k|                  }
 6547|  25.6k|               }
 6548|  18.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  25.6k|               return;
 6550|  11.9k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 11.9k, False: 2.64M]
  ------------------
 6551|  21.6k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 9.75k, False: 2.65M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  21.6k|               if constexpr (counts::n_null > 0) {
 6554|  21.6k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 21.1k, False: 536]
  |  Branch (6554:44): [True: 12.2k, False: 8.89k]
  |  Branch (6554:60): [True: 10.5k, False: 1.68k]
  |  Branch (6554:76): [True: 9.74k, False: 809]
  ------------------
 6555|  11.3k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 2.48k, False: 8.90k]
  |  Branch (6555:60): [True: 1.86k, False: 621]
  |  Branch (6555:76): [True: 1.44k, False: 420]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  11.1k|                     const auto after_null = it + 4;
 6558|  11.1k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  11.1k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 8.50k, False: 2.68k]
  ------------------
 6561|  8.50k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 0, False: 8.50k]
  ------------------
 6562|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|      0|                           return;
 6564|      0|                        }
 6565|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6566|       |                        // "null: value" should parse as {null: value}, not as the null type
 6567|  8.50k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 8.17k, False: 330]
  |  Branch (6567:47): [True: 4.06k, False: 4.11k]
  ------------------
 6568|  4.06k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 362, False: 3.70k]
  |  Branch (6568:47): [True: 269, False: 3.43k]
  |  Branch (6568:63): [True: 2.76k, False: 666]
  |  Branch (6568:80): [True: 284, False: 382]
  |  Branch (6568:97): [True: 382, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  4.06k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  4.06k|                           return;
 6572|  4.06k|                        }
 6573|  4.44k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  4.44k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  4.44k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 4.44k]
  ------------------
 6576|  4.44k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  4.44k|                        return;
 6578|  8.50k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  11.1k|                  }
 6581|  21.6k|               }
 6582|  13.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  21.6k|               return;
 6584|  2.20k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 2.20k, False: 2.65M]
  ------------------
 6585|       |               // Null indicator
 6586|  2.20k|               if constexpr (counts::n_null > 0) {
 6587|  2.20k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  2.20k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  2.20k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 2.20k]
  ------------------
 6590|  2.20k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  2.20k|                  return;
 6592|  2.20k|               }
 6593|      0|               break; // Fall through to try other types
 6594|  78.6k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 78.6k, False: 2.58M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|  78.6k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 3.96k, False: 74.7k]
  |  Branch (6596:41): [True: 50.5k, False: 24.1k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|  54.5k|                  if constexpr (counts::n_array > 0) {
 6599|  54.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|  54.5k|                                                                                                    end);
 6601|  54.5k|                     return;
 6602|  54.5k|                  }
 6603|  54.5k|               }
 6604|  78.6k|               if constexpr (counts::n_num > 0) {
 6605|  78.6k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 24.1k, False: 54.5k]
  |  Branch (6605:43): [True: 1.64k, False: 22.5k]
  |  Branch (6605:94): [True: 1.07k, False: 21.4k]
  ------------------
 6606|  2.72k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  2.72k|                     return;
 6608|  2.72k|                  }
 6609|  78.6k|               }
 6610|  75.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|  78.6k|               return;
 6612|  8.58k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 8.58k, False: 2.65M]
  ------------------
 6613|  24.7k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 16.1k, False: 2.64M]
  ------------------
 6614|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6615|       |               // Try parsing as number speculatively, fall back to string on failure
 6616|  24.7k|               if constexpr (counts::n_num > 0) {
 6617|  24.7k|                  auto start_it = it;
 6618|  24.7k|                  auto temp_ctx = ctx.make_speculative();
 6619|  24.7k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  24.7k|                                                                                               end);
 6621|  24.7k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  24.7k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  24.7k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 2.49k, False: 22.2k]
  ------------------
 6624|  2.49k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  2.49k|                     return; // Successfully parsed as number
 6626|  2.49k|                  }
 6627|  22.2k|                  it = start_it; // Restore and fall through to string
 6628|  22.2k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  24.7k|               return;
 6631|  1.01M|            default:
  ------------------
  |  Branch (6631:13): [True: 1.01M, False: 1.64M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|  1.01M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 909k, False: 108k]
  |  Branch (6633:32): [True: 781k, False: 127k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|   781k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 6.74k, False: 774k]
  ------------------
 6636|  6.74k|                     return;
 6637|  6.74k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|   774k|                  if constexpr (counts::n_num > 0) {
 6640|   774k|                     auto start_it = it;
 6641|   774k|                     auto temp_ctx = ctx.make_speculative();
 6642|   774k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|   774k|                                                                                                  end);
 6644|   774k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|   774k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|   774k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 733k, False: 40.8k]
  ------------------
 6647|   733k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|   733k|                        return; // Successfully parsed as number
 6649|   733k|                     }
 6650|  40.8k|                     it = start_it; // Restore and fall through to string
 6651|  40.8k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|   774k|                  return;
 6655|   781k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   235k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   235k|               return;
 6659|  2.66M|            }
 6660|  2.66M|         }
 6661|       |
 6662|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6663|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6664|       |
 6665|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6666|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6667|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6668|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6669|  2.66M|         error_code expansion_error{};
 6670|  2.66M|         std::string_view expansion_message{};
 6671|       |
 6672|  2.66M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  2.66M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  2.66M|            auto start = it;
 6675|       |
 6676|  2.66M|            V v{};
 6677|  2.66M|            auto temp_ctx = ctx.make_speculative();
 6678|  2.66M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  2.66M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  2.66M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  2.66M|            if (!bool(temp_ctx.error)) {
 6683|  2.66M|               value = std::move(v);
 6684|  2.66M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  2.66M|               return true;
 6686|  2.66M|            }
 6687|       |
 6688|  2.66M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  2.66M|               expansion_error = temp_ctx.error;
 6690|  2.66M|               expansion_message = temp_ctx.custom_error_message;
 6691|  2.66M|            }
 6692|  2.66M|            it = start;
 6693|  2.66M|            return false;
 6694|  2.66M|         };
 6695|       |
 6696|  2.66M|         bool parsed = false;
 6697|  2.66M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  2.66M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  2.66M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  2.66M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 2.66M]
  ------------------
 6702|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6702:17): [True: 0, False: 0]
  ------------------
 6703|      0|               ctx.error = expansion_error;
 6704|      0|               ctx.custom_error_message = expansion_message;
 6705|      0|            }
 6706|      0|            else {
 6707|      0|               ctx.error = error_code::no_matching_variant_type;
 6708|      0|            }
 6709|      0|         }
 6710|  2.66M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE10redispatchITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 6717|   515k|      {
 6718|   515k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|   515k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 12, False: 515k]
  ------------------
 6720|     12|            return;
 6721|   515k|         op<Opts>(value, ctx, it, end);
 6722|   515k|      }
_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|   232k|      {
  301|   232k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 232k]
  |  Branch (301:27): [True: 0, False: 232k]
  ------------------
  302|       |
  303|   232k|         ++it; // skip '*'
  304|   232k|         auto name = parse_anchor_name(it, end);
  305|   232k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 151, False: 232k]
  ------------------
  306|    151|            ctx.error = error_code::syntax_error;
  307|    151|            return true;
  308|    151|         }
  309|       |
  310|   232k|         auto anchor_it = ctx.anchors.find(name);
  311|   232k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 468, False: 232k]
  ------------------
  312|    468|            ctx.error = error_code::syntax_error; // undefined alias
  313|    468|            return true;
  314|    468|         }
  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|   232k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   232k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 30.2k, False: 201k]
  ------------------
  322|  30.2k|            return true;
  323|  30.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|   201k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 201k]
  ------------------
  329|     14|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     14|            return true;
  331|     14|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|   201k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   201k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 201k]
  ------------------
  339|      2|            return true;
  340|       |
  341|   201k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 15, False: 201k]
  ------------------
  342|     15|            ctx.error = error_code::exceeded_max_expansion;
  343|     15|            ctx.custom_error_message = "alias expansion";
  344|     15|            return true;
  345|     15|         }
  346|       |
  347|   201k|         auto replay_it = span.begin;
  348|   201k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   201k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   201k|         ctx.indent_stack.clear();
  353|   201k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 16.6k, False: 185k]
  ------------------
  354|  16.6k|            ctx.push_indent(span.base_indent - 1);
  355|  16.6k|         }
  356|       |
  357|   201k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   201k|         using V = std::remove_cvref_t<T>;
  360|   201k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   201k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   201k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   201k|         return true;
  367|   201k|      }
_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_:
 5310|   322k|      {
 5311|   322k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   322k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   322k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   322k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   322k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 322k, False: 0]
  ------------------
 5321|   322k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   322k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   329k|      {
 1961|   329k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 5.58k, False: 323k]
  ------------------
 1962|  5.58k|            return;
 1963|       |
 1964|   323k|         yaml::node_preamble_state preamble{};
 1965|   323k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 8.67k, False: 315k]
  ------------------
 1966|   323k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  8.67k|            return;
 1968|       |
 1969|   315k|         std::string str;
 1970|   315k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   315k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 315k, False: 0]
  ------------------
 1973|  3.63k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 3.63k, False: 311k]
  ------------------
 1974|  3.63k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  3.63k|            break;
 1976|  1.99k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 1.99k, False: 313k]
  ------------------
 1977|  1.99k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  1.99k|            break;
 1979|    534|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 534, False: 314k]
  ------------------
 1980|  4.60k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 4.07k, False: 311k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  4.60k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  4.60k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 1.63k, False: 2.96k]
  ------------------
 1986|  4.60k|            break;
 1987|   304k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 304k, False: 10.2k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|       |               if (ctx.current_indent() >= 0) {
 1992|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|       |               }
 1994|       |               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|       |               }
 1998|       |            }
 1999|   304k|            else {
 2000|   304k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|   304k|            }
 2002|   304k|            break;
 2003|   315k|         }
 2004|       |
 2005|   315k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 313k, False: 1.25k]
  ------------------
 2006|   313k|            value = std::move(str);
 2007|   313k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   313k|         }
 2009|   315k|      }
_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|   323k|      {
  466|   323k|         skip_inline_ws(it, end);
  467|       |
  468|   323k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 13, False: 323k]
  ------------------
  469|     13|            if constexpr (!AllowEmptyInput) {
  470|     13|               ctx.error = error_code::unexpected_end;
  471|     13|            }
  472|     13|            return true;
  473|     13|         }
  474|       |
  475|   323k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   323k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 18, False: 323k]
  ------------------
  477|     18|            ctx.error = error_code::syntax_error;
  478|     18|            return true;
  479|     18|         }
  480|   323k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 323k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   323k|         skip_inline_ws(it, end);
  486|       |
  487|   323k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 8, False: 323k]
  ------------------
  488|      8|            if constexpr (!AllowEmptyInput) {
  489|      8|               ctx.error = error_code::unexpected_end;
  490|      8|            }
  491|      8|            return true;
  492|      8|         }
  493|       |
  494|   323k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 8.62k, False: 315k]
  ------------------
  495|  8.62k|            return true;
  496|  8.62k|         }
  497|       |
  498|   315k|         return false;
  499|   323k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   323k|                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|   323k|      {
  409|   323k|         state.has_anchor = false;
  410|   323k|         state.anchor_name.clear();
  411|   323k|         state.anchor_start = nullptr;
  412|   323k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   323k|         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|   323k|            else {
  421|   323k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 8.58k, False: 315k]
  ------------------
  422|   323k|            }
  423|   323k|         }
  424|       |
  425|   323k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 315k, False: 8.58k]
  |  Branch (425:27): [True: 9.19k, False: 306k]
  ------------------
  426|  9.19k|            ++it;
  427|  9.19k|            auto name = parse_anchor_name(it, end);
  428|  9.19k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 9.18k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  9.18k|            skip_inline_ws(it, end);
  433|  9.18k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 25, False: 9.15k]
  ------------------
  434|     25|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     25|                  ctx.error = error_code::unexpected_end;
  436|     25|               }
  437|     25|               return true;
  438|     25|            }
  439|  9.15k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  9.15k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 4, False: 9.15k]
  ------------------
  441|      4|                  ctx.error = error_code::syntax_error;
  442|      4|                  return true;
  443|      4|               }
  444|  9.15k|            }
  445|  9.15k|            state.has_anchor = true;
  446|  9.15k|            state.anchor_name = std::string(name);
  447|  9.15k|            state.anchor_start = &*it;
  448|  9.15k|         }
  449|       |
  450|   323k|         return false;
  451|   323k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   323k|      {
  301|   323k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 323k]
  |  Branch (301:27): [True: 315k, False: 8.58k]
  ------------------
  302|       |
  303|  8.58k|         ++it; // skip '*'
  304|  8.58k|         auto name = parse_anchor_name(it, end);
  305|  8.58k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 11, False: 8.57k]
  ------------------
  306|     11|            ctx.error = error_code::syntax_error;
  307|     11|            return true;
  308|     11|         }
  309|       |
  310|  8.57k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.57k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 36, False: 8.54k]
  ------------------
  312|     36|            ctx.error = error_code::syntax_error; // undefined alias
  313|     36|            return true;
  314|     36|         }
  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.54k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.54k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.60k, False: 6.93k]
  ------------------
  322|  1.60k|            return true;
  323|  1.60k|         }
  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.93k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 11, False: 6.92k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  6.92k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.92k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 6.92k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  6.92k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 6.91k]
  ------------------
  342|      7|            ctx.error = error_code::exceeded_max_expansion;
  343|      7|            ctx.custom_error_message = "alias expansion";
  344|      7|            return true;
  345|      7|         }
  346|       |
  347|  6.91k|         auto replay_it = span.begin;
  348|  6.91k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.91k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.91k|         ctx.indent_stack.clear();
  353|  6.91k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 782, False: 6.13k]
  ------------------
  354|    782|            ctx.push_indent(span.base_indent - 1);
  355|    782|         }
  356|       |
  357|  6.91k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.91k|         using V = std::remove_cvref_t<T>;
  360|  6.91k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.91k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.91k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.91k|         return true;
  367|  6.92k|      }
_ZN3glz4yaml26parse_double_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  505|  1.71M|      {
  506|  1.71M|         static constexpr size_t string_padding_bytes = 8;
  507|       |
  508|  1.71M|         if (it == end || *it != '"') [[unlikely]] {
  ------------------
  |  Branch (508:14): [True: 0, False: 1.71M]
  |  Branch (508:27): [True: 0, False: 1.71M]
  ------------------
  509|      0|            ctx.error = error_code::expected_quote;
  510|      0|            return;
  511|      0|         }
  512|       |
  513|  1.71M|         ++it; // skip opening quote
  514|  1.71M|         auto start = it;
  515|       |
  516|       |         // Pass 1: Find closing quote byte-by-byte (need to handle newlines and escapes)
  517|  8.30M|         while (it != end && *it != '"') {
  ------------------
  |  Branch (517:17): [True: 8.30M, False: 430]
  |  Branch (517:30): [True: 6.59M, False: 1.70M]
  ------------------
  518|  6.59M|            if (*it == '\\') {
  ------------------
  |  Branch (518:17): [True: 65.7k, False: 6.53M]
  ------------------
  519|  65.7k|               ++it;
  520|  65.7k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (520:20): [True: 40, False: 65.7k]
  ------------------
  521|     40|                  ctx.error = error_code::unexpected_end;
  522|     40|                  return;
  523|     40|               }
  524|  65.7k|            }
  525|  6.53M|            else if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (525:22): [True: 520, False: 6.53M]
  ------------------
  526|       |               // A raw control byte is invalid; the \xXX escape form above is how such a
  527|       |               // character is legitimately carried in a double-quoted scalar.
  528|    520|               ctx.error = error_code::invalid_control_character;
  529|    520|               return;
  530|    520|            }
  531|  6.59M|            ++it;
  532|  6.59M|         }
  533|       |
  534|  1.70M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (534:14): [True: 430, False: 1.70M]
  ------------------
  535|    430|            ctx.error = error_code::unexpected_end;
  536|    430|            return;
  537|    430|         }
  538|       |
  539|       |         // Allocate buffer with room for potential expansion and SWAR padding
  540|       |         // Some YAML escapes expand: \L, \P -> 3 bytes UTF-8
  541|  1.70M|         const auto input_len = static_cast<size_t>(it - start);
  542|  1.70M|         value.resize(input_len + (input_len / 2) + string_padding_bytes);
  543|  1.70M|         auto* dst = value.data();
  544|  1.70M|         auto* const dst_start = dst;
  545|       |
  546|       |         // Pass 2: Copy and process escapes and line folding
  547|  1.70M|         auto src = start;
  548|  1.70M|         const auto* const src_end = &*it;
  549|       |         // Track position past which we should not trim. Escape-produced characters
  550|       |         // (even whitespace like \t) are content and must not be trimmed by line folding.
  551|  1.70M|         auto* last_non_trimmable = dst;
  552|       |
  553|  8.00M|         while (src < src_end) {
  ------------------
  |  Branch (553:17): [True: 6.29M, False: 1.70M]
  ------------------
  554|       |            // Check for newline - needs line folding
  555|  6.29M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (555:17): [True: 36.2k, False: 6.26M]
  |  Branch (555:33): [True: 69.8k, False: 6.19M]
  ------------------
  556|       |               // Trim trailing LITERAL whitespace from output before processing newline.
  557|       |               // Escape-produced whitespace (e.g. from \t) is preserved.
  558|   106k|               dst = (std::max)(last_non_trimmable, dst_start);
  559|       |
  560|       |               // Skip the newline
  561|   106k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (561:20): [True: 69.8k, False: 36.2k]
  |  Branch (561:36): [True: 66.7k, False: 3.15k]
  |  Branch (561:59): [True: 1.27k, False: 65.4k]
  ------------------
  562|  1.27k|                  src += 2; // CRLF
  563|  1.27k|               }
  564|   104k|               else {
  565|   104k|                  ++src;
  566|   104k|               }
  567|       |
  568|       |               // Skip leading indentation on the next line.
  569|   106k|               int indent_count = 0;
  570|   106k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (570:20): [True: 48, False: 106k]
  ------------------
  571|   106k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (571:20): [True: 46.7k, False: 59.3k]
  |  Branch (571:41): [True: 66, False: 46.6k]
  ------------------
  572|     66|                  ctx.error = error_code::syntax_error;
  573|     66|                  return;
  574|     66|               }
  575|       |
  576|       |               // Check if this is a blank line (another newline follows)
  577|   106k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (577:20): [True: 102k, False: 4.02k]
  |  Branch (577:38): [True: 6.36k, False: 95.6k]
  |  Branch (577:54): [True: 9.83k, False: 85.8k]
  ------------------
  578|       |                  // Blank line(s) - output newlines for each blank line
  579|  84.1k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (579:26): [True: 81.8k, False: 2.27k]
  |  Branch (579:44): [True: 48.2k, False: 33.5k]
  |  Branch (579:60): [True: 19.7k, False: 13.8k]
  ------------------
  580|  68.0k|                     *dst++ = '\n';
  581|       |                     // Skip the newline
  582|  68.0k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (582:26): [True: 19.7k, False: 48.2k]
  |  Branch (582:42): [True: 19.4k, False: 300]
  |  Branch (582:65): [True: 2.68k, False: 16.7k]
  ------------------
  583|  2.68k|                        src += 2; // CRLF
  584|  2.68k|                     }
  585|  65.3k|                     else {
  586|  65.3k|                        ++src;
  587|  65.3k|                     }
  588|  68.0k|                     int blank_indent_count = 0;
  589|  68.0k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (589:26): [True: 44, False: 68.0k]
  ------------------
  590|  68.0k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (590:26): [True: 61.4k, False: 6.55k]
  |  Branch (590:53): [True: 68, False: 61.3k]
  ------------------
  591|     68|                        ctx.error = error_code::syntax_error;
  592|     68|                        return;
  593|     68|                     }
  594|  68.0k|                  }
  595|       |                  // Don't add space - we're now at content after blank line(s)
  596|  16.1k|               }
  597|  89.8k|               else {
  598|       |                  // Single newline - fold to space
  599|  89.8k|                  *dst++ = ' ';
  600|  89.8k|               }
  601|   105k|               last_non_trimmable = dst;
  602|   105k|               continue;
  603|   106k|            }
  604|       |
  605|  6.19M|            if (*src == '\\') {
  ------------------
  |  Branch (605:17): [True: 65.1k, False: 6.12M]
  ------------------
  606|  65.1k|               ++src;
  607|  65.1k|               if (src >= src_end) [[unlikely]] {
  ------------------
  |  Branch (607:20): [True: 0, False: 65.1k]
  ------------------
  608|       |                  // Shouldn't happen - we validated in pass 1
  609|      0|                  ctx.error = error_code::syntax_error;
  610|      0|                  return;
  611|      0|               }
  612|       |
  613|  65.1k|               const auto esc = uint8_t(*src);
  614|       |
  615|       |               // Check for escaped newline (line continuation - no space)
  616|  65.1k|               if (esc == '\n' || esc == '\r') {
  ------------------
  |  Branch (616:20): [True: 9.25k, False: 55.8k]
  |  Branch (616:35): [True: 11.1k, False: 44.7k]
  ------------------
  617|       |                  // Skip the newline
  618|  20.3k|                  if (esc == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (618:23): [True: 11.1k, False: 9.25k]
  |  Branch (618:38): [True: 3.35k, False: 7.77k]
  |  Branch (618:61): [True: 218, False: 3.13k]
  ------------------
  619|    218|                     src += 2; // CRLF
  620|    218|                  }
  621|  20.1k|                  else {
  622|  20.1k|                     ++src;
  623|  20.1k|                  }
  624|       |
  625|  20.3k|                  int indent_count = 0;
  626|  20.3k|                  if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (626:23): [True: 24, False: 20.3k]
  ------------------
  627|  20.3k|                  if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (627:23): [True: 17.7k, False: 2.61k]
  |  Branch (627:44): [True: 76, False: 17.6k]
  ------------------
  628|     76|                     ctx.error = error_code::syntax_error;
  629|     76|                     return;
  630|     76|                  }
  631|       |                  // No output - this is line continuation without space
  632|  20.2k|                  last_non_trimmable = dst;
  633|  20.2k|                  continue;
  634|  20.3k|               }
  635|       |
  636|       |               // Check simple escape table first
  637|  44.7k|               if (yaml_escape_is_simple[esc]) {
  ------------------
  |  Branch (637:20): [True: 25.4k, False: 19.3k]
  ------------------
  638|  25.4k|                  *dst++ = yaml_unescape_table[esc];
  639|  25.4k|                  ++src;
  640|  25.4k|               }
  641|       |               // Handle escapes requiring special processing
  642|  19.3k|               else if (yaml_escape_needs_special[esc]) {
  ------------------
  |  Branch (642:25): [True: 7.14k, False: 12.1k]
  ------------------
  643|  7.14k|                  ++src; // skip escape char
  644|  7.14k|                  switch (esc) {
  645|    696|                  case 'x': {
  ------------------
  |  Branch (645:19): [True: 696, False: 6.44k]
  ------------------
  646|       |                     // \xXX - 2 hex digits
  647|    696|                     if (static_cast<size_t>(src_end - src) < 2) [[unlikely]] {
  ------------------
  |  Branch (647:26): [True: 6, False: 690]
  ------------------
  648|      6|                        ctx.error = error_code::syntax_error;
  649|      6|                        return;
  650|      6|                     }
  651|    690|                     const uint32_t hi = digit_hex_table[uint8_t(src[0])];
  652|    690|                     const uint32_t lo = digit_hex_table[uint8_t(src[1])];
  653|    690|                     if ((hi | lo) & 0xF0) [[unlikely]] {
  ------------------
  |  Branch (653:26): [True: 18, False: 672]
  ------------------
  654|     18|                        ctx.error = error_code::syntax_error;
  655|     18|                        return;
  656|     18|                     }
  657|    672|                     const uint32_t codepoint = (hi << 4) | lo;
  658|    672|                     src += 2;
  659|    672|                     dst += code_point_to_utf8(codepoint, dst);
  660|    672|                     break;
  661|    690|                  }
  662|  1.02k|                  case 'u': {
  ------------------
  |  Branch (662:19): [True: 1.02k, False: 6.12k]
  ------------------
  663|       |                     // \uXXXX - 4 hex digits
  664|  1.02k|                     if (static_cast<size_t>(src_end - src) < 4) [[unlikely]] {
  ------------------
  |  Branch (664:26): [True: 10, False: 1.01k]
  ------------------
  665|     10|                        ctx.error = error_code::syntax_error;
  666|     10|                        return;
  667|     10|                     }
  668|  1.01k|                     const uint32_t codepoint = hex_to_u32(src);
  669|  1.01k|                     if (codepoint == 0xFFFFFFFFu || (codepoint >= 0xD800 && codepoint <= 0xDFFF)) [[unlikely]] {
  ------------------
  |  Branch (669:26): [True: 58, False: 954]
  |  Branch (669:55): [True: 264, False: 690]
  |  Branch (669:78): [True: 34, False: 230]
  ------------------
  670|     92|                        ctx.error = error_code::syntax_error;
  671|     92|                        return;
  672|     92|                     }
  673|    920|                     src += 4;
  674|    920|                     dst += code_point_to_utf8(codepoint, dst);
  675|    920|                     break;
  676|  1.01k|                  }
  677|  2.02k|                  case 'U': {
  ------------------
  |  Branch (677:19): [True: 2.02k, False: 5.11k]
  ------------------
  678|       |                     // \UXXXXXXXX - 8 hex digits
  679|  2.02k|                     if (static_cast<size_t>(src_end - src) < 8) [[unlikely]] {
  ------------------
  |  Branch (679:26): [True: 14, False: 2.01k]
  ------------------
  680|     14|                        ctx.error = error_code::syntax_error;
  681|     14|                        return;
  682|     14|                     }
  683|  2.01k|                     const uint32_t hi = hex_to_u32(src);
  684|  2.01k|                     const uint32_t lo = hex_to_u32(src + 4);
  685|  2.01k|                     if ((hi | lo) == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (685:26): [True: 26, False: 1.98k]
  ------------------
  686|     26|                        ctx.error = error_code::syntax_error;
  687|     26|                        return;
  688|     26|                     }
  689|  1.98k|                     const uint32_t codepoint = (hi << 16) | lo;
  690|  1.98k|                     src += 8;
  691|  1.98k|                     if (codepoint >= 0xD800 && codepoint <= 0xDFFF) [[unlikely]] {
  ------------------
  |  Branch (691:26): [True: 984, False: 1.00k]
  |  Branch (691:49): [True: 10, False: 974]
  ------------------
  692|     10|                        ctx.error = error_code::syntax_error;
  693|     10|                        return;
  694|     10|                     }
  695|  1.97k|                     if (codepoint <= 0x10FFFF) {
  ------------------
  |  Branch (695:26): [True: 1.21k, False: 760]
  ------------------
  696|  1.21k|                        dst += code_point_to_utf8(codepoint, dst);
  697|  1.21k|                     }
  698|  1.97k|                     break;
  699|  1.98k|                  }
  700|    308|                  case 'N': {
  ------------------
  |  Branch (700:19): [True: 308, False: 6.83k]
  ------------------
  701|       |                     // Next line U+0085
  702|    308|                     dst += code_point_to_utf8(0x0085, dst);
  703|    308|                     break;
  704|  1.98k|                  }
  705|    226|                  case '_': {
  ------------------
  |  Branch (705:19): [True: 226, False: 6.91k]
  ------------------
  706|       |                     // Non-breaking space U+00A0
  707|    226|                     dst += code_point_to_utf8(0x00A0, dst);
  708|    226|                     break;
  709|  1.98k|                  }
  710|  1.51k|                  case 'L': {
  ------------------
  |  Branch (710:19): [True: 1.51k, False: 5.62k]
  ------------------
  711|       |                     // Line separator U+2028
  712|  1.51k|                     dst += code_point_to_utf8(0x2028, dst);
  713|  1.51k|                     break;
  714|  1.98k|                  }
  715|  1.35k|                  case 'P': {
  ------------------
  |  Branch (715:19): [True: 1.35k, False: 5.79k]
  ------------------
  716|       |                     // Paragraph separator U+2029
  717|  1.35k|                     dst += code_point_to_utf8(0x2029, dst);
  718|  1.35k|                     break;
  719|  1.98k|                  }
  720|      0|                  default:
  ------------------
  |  Branch (720:19): [True: 0, False: 7.14k]
  ------------------
  721|      0|                     break;
  722|  7.14k|                  }
  723|  7.14k|               }
  724|  12.1k|               else {
  725|       |                  // Preserve unknown escapes for compatibility, but reject a subset that
  726|       |                  // YAML test-suite marks as malformed in double-quoted scalars.
  727|  12.1k|                  if (esc == '.' || esc == '\'') {
  ------------------
  |  Branch (727:23): [True: 20, False: 12.1k]
  |  Branch (727:37): [True: 8, False: 12.1k]
  ------------------
  728|     28|                     ctx.error = error_code::syntax_error;
  729|     28|                     return;
  730|     28|                  }
  731|  12.1k|                  *dst++ = '\\';
  732|  12.1k|                  *dst++ = static_cast<char>(esc);
  733|  12.1k|                  ++src;
  734|  12.1k|               }
  735|       |               // All escape-produced characters are content, not trimmable
  736|  44.5k|               last_non_trimmable = dst;
  737|  44.5k|            }
  738|  6.12M|            else {
  739|  6.12M|               const char ch = *src++;
  740|  6.12M|               *dst++ = ch;
  741|       |               // Only update non-trimmable for non-whitespace literal characters
  742|  6.12M|               if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (742:20): [True: 5.79M, False: 331k]
  |  Branch (742:33): [True: 5.73M, False: 62.2k]
  ------------------
  743|  5.73M|                  last_non_trimmable = dst;
  744|  5.73M|               }
  745|  6.12M|            }
  746|  6.19M|         }
  747|       |
  748|       |         // Resize to actual length
  749|  1.70M|         value.resize(static_cast<size_t>(dst - dst_start));
  750|  1.70M|         ++it; // skip closing quote
  751|  1.70M|      }
_ZN3glz4yaml26parse_single_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  758|  28.9k|      {
  759|  28.9k|         static constexpr size_t string_padding_bytes = 8;
  760|       |
  761|  28.9k|         if (it == end || *it != '\'') [[unlikely]] {
  ------------------
  |  Branch (761:14): [True: 0, False: 28.9k]
  |  Branch (761:27): [True: 0, False: 28.9k]
  ------------------
  762|      0|            ctx.error = error_code::expected_quote;
  763|      0|            return;
  764|      0|         }
  765|       |
  766|  28.9k|         ++it; // skip opening quote
  767|  28.9k|         auto start = it;
  768|       |
  769|       |         // Pass 1: Find closing quote (handling '' escapes)
  770|  16.3M|         while (it != end) {
  ------------------
  |  Branch (770:17): [True: 16.3M, False: 420]
  ------------------
  771|  16.3M|            if (*it == '\'') {
  ------------------
  |  Branch (771:17): [True: 32.3k, False: 16.3M]
  ------------------
  772|  32.3k|               if ((it + 1) != end && *(it + 1) == '\'') {
  ------------------
  |  Branch (772:20): [True: 27.5k, False: 4.81k]
  |  Branch (772:39): [True: 4.23k, False: 23.2k]
  ------------------
  773|  4.23k|                  it += 2; // Skip escaped quote
  774|  4.23k|               }
  775|  28.0k|               else {
  776|  28.0k|                  break; // Found closing quote
  777|  28.0k|               }
  778|  32.3k|            }
  779|  16.3M|            else {
  780|  16.3M|               if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (780:20): [True: 440, False: 16.3M]
  ------------------
  781|    440|                  ctx.error = error_code::invalid_control_character;
  782|    440|                  return;
  783|    440|               }
  784|  16.3M|               ++it;
  785|  16.3M|            }
  786|  16.3M|         }
  787|       |
  788|  28.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (788:14): [True: 420, False: 28.0k]
  ------------------
  789|    420|            ctx.error = error_code::unexpected_end;
  790|    420|            return;
  791|    420|         }
  792|       |
  793|  28.0k|         const auto input_len = static_cast<size_t>(it - start);
  794|  28.0k|         value.resize(input_len + string_padding_bytes);
  795|  28.0k|         auto* dst = value.data();
  796|  28.0k|         auto* const dst_start = dst;
  797|  28.0k|         auto src = start;
  798|  28.0k|         const auto* const src_end = &*it;
  799|       |
  800|       |         // Pass 2: Process content with line folding and '' escapes
  801|  15.6M|         while (src < src_end) {
  ------------------
  |  Branch (801:17): [True: 15.6M, False: 27.8k]
  ------------------
  802|       |            // Check for newline - needs line folding
  803|  15.6M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (803:17): [True: 477k, False: 15.1M]
  |  Branch (803:33): [True: 76.2k, False: 15.0M]
  ------------------
  804|       |               // Trim trailing whitespace from output before processing newline
  805|   565k|               while (dst > dst_start && (*(dst - 1) == ' ' || *(dst - 1) == '\t')) {
  ------------------
  |  Branch (805:23): [True: 562k, False: 3.02k]
  |  Branch (805:43): [True: 9.54k, False: 552k]
  |  Branch (805:64): [True: 2.39k, False: 550k]
  ------------------
  806|  11.9k|                  --dst;
  807|  11.9k|               }
  808|       |
  809|       |               // Skip the newline
  810|   553k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (810:20): [True: 76.2k, False: 477k]
  |  Branch (810:36): [True: 75.3k, False: 900]
  |  Branch (810:59): [True: 418, False: 74.8k]
  ------------------
  811|    418|                  src += 2; // CRLF
  812|    418|               }
  813|   552k|               else {
  814|   552k|                  ++src;
  815|   552k|               }
  816|       |
  817|       |               // Skip leading indentation on the next line.
  818|   553k|               int indent_count = 0;
  819|   553k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (819:20): [True: 64, False: 553k]
  ------------------
  820|   553k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (820:20): [True: 546k, False: 6.79k]
  |  Branch (820:41): [True: 64, False: 546k]
  ------------------
  821|     64|                  ctx.error = error_code::syntax_error;
  822|     64|                  return;
  823|     64|               }
  824|       |
  825|       |               // Check if this is a blank line (another newline follows)
  826|   553k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (826:20): [True: 550k, False: 3.02k]
  |  Branch (826:38): [True: 292k, False: 257k]
  |  Branch (826:54): [True: 65.8k, False: 191k]
  ------------------
  827|       |                  // Blank line(s) - output newlines for each blank line
  828|   911k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (828:26): [True: 908k, False: 3.25k]
  |  Branch (828:44): [True: 474k, False: 434k]
  |  Branch (828:60): [True: 79.0k, False: 355k]
  ------------------
  829|   553k|                     *dst++ = '\n';
  830|       |                     // Skip the newline
  831|   553k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (831:26): [True: 79.0k, False: 474k]
  |  Branch (831:42): [True: 76.6k, False: 2.49k]
  |  Branch (831:65): [True: 660, False: 75.9k]
  ------------------
  832|    660|                        src += 2; // CRLF
  833|    660|                     }
  834|   552k|                     else {
  835|   552k|                        ++src;
  836|   552k|                     }
  837|   553k|                     int blank_indent_count = 0;
  838|   553k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (838:26): [True: 64, False: 553k]
  ------------------
  839|   553k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (839:26): [True: 551k, False: 2.07k]
  |  Branch (839:53): [True: 68, False: 551k]
  ------------------
  840|     68|                        ctx.error = error_code::syntax_error;
  841|     68|                        return;
  842|     68|                     }
  843|   553k|                  }
  844|       |                  // Don't add space - we're now at content after blank line(s)
  845|   358k|               }
  846|   194k|               else {
  847|       |                  // Single newline - fold to space
  848|   194k|                  *dst++ = ' ';
  849|   194k|               }
  850|   552k|               continue;
  851|   553k|            }
  852|       |
  853|  15.0M|            if (*src == '\'') {
  ------------------
  |  Branch (853:17): [True: 3.43k, False: 15.0M]
  ------------------
  854|       |               // Must be '' (escaped quote) - we validated this in pass 1
  855|  3.43k|               *dst++ = '\'';
  856|  3.43k|               src += 2;
  857|  3.43k|            }
  858|  15.0M|            else {
  859|  15.0M|               *dst++ = *src++;
  860|  15.0M|            }
  861|  15.0M|         }
  862|       |
  863|  27.8k|         value.resize(static_cast<size_t>(dst - dst_start));
  864|  27.8k|         ++it; // skip closing quote
  865|  27.8k|      }
_ZN3glz4yaml18parse_block_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1362|  58.5k|      {
 1363|  58.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1363:14): [True: 0, False: 58.5k]
  ------------------
 1364|      0|            ctx.error = error_code::unexpected_end;
 1365|      0|            return;
 1366|      0|         }
 1367|       |
 1368|  58.5k|         const char indicator = *it;
 1369|  58.5k|         ++it;
 1370|  58.5k|         const auto header_start = it;
 1371|       |
 1372|       |         // Chomping indicator: - (strip), + (keep), or none (clip)
 1373|  58.5k|         char chomping = ' '; // default: clip
 1374|  58.5k|         int explicit_indent = 0;
 1375|  58.5k|         bool seen_chomping = false;
 1376|  58.5k|         bool seen_indent = false;
 1377|       |
 1378|  87.5k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1378:17): [True: 86.4k, False: 1.14k]
  |  Branch (1378:30): [True: 60.6k, False: 25.7k]
  |  Branch (1378:45): [True: 33.8k, False: 26.8k]
  ------------------
 1379|  33.8k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (1379:17): [True: 2.46k, False: 31.3k]
  |  Branch (1379:31): [True: 4.36k, False: 27.0k]
  ------------------
 1380|  6.82k|               if (seen_chomping) {
  ------------------
  |  Branch (1380:20): [True: 10, False: 6.81k]
  ------------------
 1381|     10|                  ctx.error = error_code::syntax_error;
 1382|     10|                  return;
 1383|     10|               }
 1384|  6.81k|               seen_chomping = true;
 1385|  6.81k|               chomping = *it;
 1386|  6.81k|            }
 1387|  27.0k|            else if (*it >= '1' && *it <= '9') {
  ------------------
  |  Branch (1387:22): [True: 4.22k, False: 22.7k]
  |  Branch (1387:36): [True: 4.08k, False: 134]
  ------------------
 1388|  4.08k|               if (seen_indent) {
  ------------------
  |  Branch (1388:20): [True: 6, False: 4.08k]
  ------------------
 1389|       |                  // YAML indentation indicator is a single digit [1-9].
 1390|      6|                  ctx.error = error_code::syntax_error;
 1391|      6|                  return;
 1392|      6|               }
 1393|  4.08k|               seen_indent = true;
 1394|  4.08k|               explicit_indent = *it - '0';
 1395|  4.08k|            }
 1396|  22.9k|            else if (*it == '0') {
  ------------------
  |  Branch (1396:22): [True: 22, False: 22.9k]
  ------------------
 1397|       |               // Indentation indicator 0 is invalid by spec.
 1398|     22|               ctx.error = error_code::syntax_error;
 1399|     22|               return;
 1400|     22|            }
 1401|  22.9k|            else if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (1401:22): [True: 14.1k, False: 8.79k]
  |  Branch (1401:36): [True: 4.01k, False: 4.78k]
  ------------------
 1402|       |               // Skip whitespace
 1403|  18.1k|            }
 1404|  4.78k|            else if (*it == '#') {
  ------------------
  |  Branch (1404:22): [True: 4.17k, False: 610]
  ------------------
 1405|       |               // Block scalar comments require separation whitespace.
 1406|  4.17k|               if (it == header_start || (*(it - 1) != ' ' && *(it - 1) != '\t')) {
  ------------------
  |  Branch (1406:20): [True: 8, False: 4.16k]
  |  Branch (1406:43): [True: 320, False: 3.84k]
  |  Branch (1406:63): [True: 6, False: 314]
  ------------------
 1407|     14|                  ctx.error = error_code::syntax_error;
 1408|     14|                  return;
 1409|     14|               }
 1410|       |               // Skip comment
 1411|  3.21M|               while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1411:23): [True: 3.21M, False: 304]
  |  Branch (1411:36): [True: 3.21M, False: 2.35k]
  |  Branch (1411:51): [True: 3.21M, False: 1.50k]
  ------------------
 1412|  3.21M|                  ++it;
 1413|  3.21M|               }
 1414|  4.16k|               break;
 1415|  4.17k|            }
 1416|    610|            else {
 1417|    610|               ctx.error = error_code::syntax_error;
 1418|    610|               return;
 1419|    610|            }
 1420|  29.0k|            ++it;
 1421|  29.0k|         }
 1422|       |
 1423|       |         // Skip newline after indicator
 1424|  57.8k|         if (!skip_newline(it, end)) {
  ------------------
  |  Branch (1424:14): [True: 1.44k, False: 56.4k]
  ------------------
 1425|       |            // Empty block scalar
 1426|  1.44k|            value.clear();
 1427|  1.44k|            return;
 1428|  1.44k|         }
 1429|       |
 1430|  56.4k|         value.clear();
 1431|       |
 1432|       |         // Determine content indentation
 1433|  56.4k|         int32_t content_indent = -1;
 1434|  56.4k|         int32_t leading_blank_indent_max = -1;
 1435|  56.4k|         bool first_line = true;
 1436|  56.4k|         bool previous_line_starts_with_tab = false;
 1437|  56.4k|         bool previous_line_more_indented = false;
 1438|  56.4k|         std::string trailing_newlines;
 1439|       |
 1440|  5.71M|         while (it != end) {
  ------------------
  |  Branch (1440:17): [True: 5.69M, False: 18.1k]
  ------------------
 1441|  5.69M|            auto line_start = it;
 1442|  5.69M|            int32_t line_indent = measure_indent<false>(it, end, ctx);
 1443|  5.69M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1443:17): [True: 10, False: 5.69M]
  ------------------
 1444|     10|               return;
 1445|       |
 1446|       |            // Check for blank line
 1447|  5.69M|            if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1447:17): [True: 262, False: 5.69M]
  |  Branch (1447:30): [True: 174k, False: 5.52M]
  |  Branch (1447:45): [True: 5.38M, False: 137k]
  ------------------
 1448|       |               // In literal mode, a line with more spaces than content_indent
 1449|       |               // has whitespace content that must be preserved.
 1450|  5.56M|               if (content_indent >= 0 && line_indent > content_indent && indicator == '|') {
  ------------------
  |  Branch (1450:20): [True: 5.33M, False: 230k]
  |  Branch (1450:43): [True: 2.85k, False: 5.32M]
  |  Branch (1450:75): [True: 1.37k, False: 1.48k]
  ------------------
 1451|  1.37k|                  it = line_start;
 1452|  2.00k|                  for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1452:39): [True: 630, False: 1.37k]
  |  Branch (1452:61): [True: 630, False: 0]
  |  Branch (1452:74): [True: 630, False: 0]
  ------------------
 1453|    630|                     ++it;
 1454|    630|                  }
 1455|       |                  // Fall through to content processing below
 1456|  1.37k|               }
 1457|  5.55M|               else {
 1458|  5.55M|                  if (content_indent < 0) {
  ------------------
  |  Branch (1458:23): [True: 230k, False: 5.32M]
  ------------------
 1459|   230k|                     leading_blank_indent_max = (std::max)(leading_blank_indent_max, line_indent);
 1460|   230k|                  }
 1461|  5.55M|                  trailing_newlines.push_back('\n');
 1462|  5.55M|                  skip_newline(it, end);
 1463|  5.55M|                  continue;
 1464|  5.55M|               }
 1465|  5.56M|            }
 1466|       |
 1467|       |            // Top-level zero-indented block scalars must stop at document boundary markers.
 1468|   138k|            if (base_indent < 0 && line_indent == 0 && (at_document_start(it, end) || at_document_end(it, end))) {
  ------------------
  |  Branch (1468:17): [True: 109k, False: 28.8k]
  |  Branch (1468:36): [True: 98.8k, False: 11.1k]
  |  Branch (1468:57): [True: 4.46k, False: 94.3k]
  |  Branch (1468:87): [True: 1.34k, False: 93.0k]
  ------------------
 1469|  5.80k|               it = line_start;
 1470|  5.80k|               break;
 1471|  5.80k|            }
 1472|       |
 1473|       |            // First content line determines indentation
 1474|   133k|            if (content_indent < 0) {
  ------------------
  |  Branch (1474:17): [True: 43.5k, False: 89.4k]
  ------------------
 1475|  43.5k|               if (explicit_indent > 0) {
  ------------------
  |  Branch (1475:20): [True: 2.08k, False: 41.5k]
  ------------------
 1476|  2.08k|                  content_indent = base_indent + explicit_indent;
 1477|  2.08k|               }
 1478|  41.5k|               else {
 1479|  41.5k|                  content_indent = line_indent;
 1480|  41.5k|               }
 1481|       |
 1482|  43.5k|               if (content_indent <= base_indent) {
  ------------------
  |  Branch (1482:20): [True: 26.2k, False: 17.3k]
  ------------------
 1483|  26.2k|                  it = line_start;
 1484|  26.2k|                  break;
 1485|  26.2k|               }
 1486|  17.3k|               if (leading_blank_indent_max > content_indent) {
  ------------------
  |  Branch (1486:20): [True: 48, False: 17.3k]
  ------------------
 1487|     48|                  ctx.error = error_code::syntax_error;
 1488|     48|                  return;
 1489|     48|               }
 1490|  17.3k|            }
 1491|       |
 1492|       |            // Check if we've dedented
 1493|   106k|            if (line_indent < content_indent) {
  ------------------
  |  Branch (1493:17): [True: 5.68k, False: 101k]
  ------------------
 1494|  5.68k|               it = line_start;
 1495|  5.68k|               break;
 1496|  5.68k|            }
 1497|       |
 1498|       |            // Skip to content_indent level
 1499|   101k|            it = line_start;
 1500|   807k|            for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1500:33): [True: 706k, False: 101k]
  |  Branch (1500:55): [True: 706k, False: 0]
  |  Branch (1500:68): [True: 706k, False: 0]
  ------------------
 1501|   706k|               ++it;
 1502|   706k|            }
 1503|       |
 1504|   101k|            const bool current_line_starts_with_tab = (it != end && *it == '\t');
  ------------------
  |  Branch (1504:56): [True: 101k, False: 0]
  |  Branch (1504:69): [True: 830, False: 100k]
  ------------------
 1505|   101k|            const bool current_line_more_indented = (line_indent > content_indent);
 1506|       |
 1507|       |            // Add previous newlines
 1508|   101k|            if (first_line) {
  ------------------
  |  Branch (1508:17): [True: 15.2k, False: 85.8k]
  ------------------
 1509|       |               // Leading blank lines are part of block scalar content
 1510|  15.2k|               value += trailing_newlines;
 1511|  15.2k|            }
 1512|  85.8k|            else {
 1513|  85.8k|               if (indicator == '|') {
  ------------------
  |  Branch (1513:20): [True: 38.6k, False: 47.1k]
  ------------------
 1514|       |                  // Literal: preserve newlines
 1515|  38.6k|                  value += trailing_newlines;
 1516|  38.6k|               }
 1517|  47.1k|               else {
 1518|       |                  // Folded: single newline becomes space, paragraph breaks keep one newline.
 1519|       |                  // Folding does not apply adjacent to "more indented" or tab-leading lines.
 1520|  47.1k|                  const size_t break_count = trailing_newlines.size();
 1521|  47.1k|                  const bool adjacent_special = previous_line_starts_with_tab || current_line_starts_with_tab ||
  ------------------
  |  Branch (1521:49): [True: 298, False: 46.8k]
  |  Branch (1521:82): [True: 382, False: 46.5k]
  ------------------
 1522|  46.5k|                                                previous_line_more_indented || current_line_more_indented;
  ------------------
  |  Branch (1522:49): [True: 1.75k, False: 44.7k]
  |  Branch (1522:80): [True: 2.11k, False: 42.6k]
  ------------------
 1523|  47.1k|                  if (break_count == 1) {
  ------------------
  |  Branch (1523:23): [True: 31.6k, False: 15.4k]
  ------------------
 1524|  31.6k|                     if (adjacent_special) {
  ------------------
  |  Branch (1524:26): [True: 3.63k, False: 28.0k]
  ------------------
 1525|  3.63k|                        value.push_back('\n');
 1526|  3.63k|                     }
 1527|  28.0k|                     else {
 1528|  28.0k|                        value.push_back(' ');
 1529|  28.0k|                     }
 1530|  31.6k|                  }
 1531|  15.4k|                  else if (break_count > 1) {
  ------------------
  |  Branch (1531:28): [True: 15.4k, False: 0]
  ------------------
 1532|  15.4k|                     const size_t preserve_count = adjacent_special ? break_count : (break_count - 1);
  ------------------
  |  Branch (1532:52): [True: 914, False: 14.5k]
  ------------------
 1533|  15.4k|                     value.append(preserve_count, '\n');
 1534|  15.4k|                  }
 1535|  47.1k|               }
 1536|  85.8k|            }
 1537|   101k|            trailing_newlines.clear();
 1538|   101k|            first_line = false;
 1539|   101k|            previous_line_starts_with_tab = current_line_starts_with_tab;
 1540|   101k|            previous_line_more_indented = current_line_more_indented;
 1541|       |
 1542|       |            // Read line content
 1543|  1.83M|            while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1543:20): [True: 1.83M, False: 1.04k]
  |  Branch (1543:33): [True: 1.76M, False: 71.8k]
  |  Branch (1543:48): [True: 1.73M, False: 27.7k]
  ------------------
 1544|  1.73M|               if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (1544:20): [True: 518, False: 1.73M]
  ------------------
 1545|       |                  // Block scalars have no escape mechanism, so the byte cannot be valid here.
 1546|    518|                  ctx.error = error_code::invalid_control_character;
 1547|    518|                  return;
 1548|    518|               }
 1549|  1.73M|               value.push_back(*it);
 1550|  1.73M|               ++it;
 1551|  1.73M|            }
 1552|       |
 1553|   100k|            trailing_newlines.push_back('\n');
 1554|   100k|            skip_newline(it, end);
 1555|   100k|         }
 1556|       |
 1557|       |         // Apply chomping
 1558|  55.8k|         if (chomping == '-') {
  ------------------
  |  Branch (1558:14): [True: 2.41k, False: 53.4k]
  ------------------
 1559|       |            // Strip: remove all trailing newlines
 1560|  2.41k|         }
 1561|  53.4k|         else if (chomping == '+') {
  ------------------
  |  Branch (1561:19): [True: 4.26k, False: 49.1k]
  ------------------
 1562|       |            // Keep: preserve all trailing newlines
 1563|  4.26k|            value += trailing_newlines;
 1564|  4.26k|         }
 1565|  49.1k|         else {
 1566|       |            // Clip: single trailing newline
 1567|  49.1k|            if (!value.empty()) {
  ------------------
  |  Branch (1567:17): [True: 10.5k, False: 38.6k]
  ------------------
 1568|  10.5k|               value.push_back('\n');
 1569|  10.5k|            }
 1570|  49.1k|         }
 1571|  55.8k|      }
_ZN3glz4yaml18parse_plain_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1019|  3.05M|      {
 1020|  3.05M|         value.clear();
 1021|       |
 1022|  26.7M|         while (it != end) {
  ------------------
  |  Branch (1022:17): [True: 26.6M, False: 158k]
  ------------------
 1023|       |            // Copy the run of ordinary content in bulk. Only a byte the table marks
 1024|       |            // needs the dispatch below, so the control-character rejection rides on a
 1025|       |            // lookup the scan already performs rather than costing a test per byte.
 1026|  26.6M|            {
 1027|  26.6M|               const auto run_start = it;
 1028|   168M|               while (it != end && !plain_scalar_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1028:23): [True: 168M, False: 298k]
  |  Branch (1028:36): [True: 142M, False: 26.3M]
  ------------------
 1029|   142M|                  ++it;
 1030|   142M|               }
 1031|  26.6M|               if (it != run_start) {
  ------------------
  |  Branch (1031:20): [True: 25.2M, False: 1.35M]
  ------------------
 1032|  25.2M|                  value.append(run_start, it);
 1033|  25.2M|               }
 1034|  26.6M|               if (it == end) break;
  ------------------
  |  Branch (1034:20): [True: 298k, False: 26.3M]
  ------------------
 1035|  26.6M|            }
 1036|       |
 1037|  26.3M|            const char c = *it;
 1038|       |
 1039|       |            // YAML's character stream excludes these outright, so reject rather than
 1040|       |            // carry the byte into the value.
 1041|  26.3M|            if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1041:17): [True: 11.1k, False: 26.2M]
  ------------------
 1042|  11.1k|               ctx.error = error_code::invalid_control_character;
 1043|  11.1k|               return;
 1044|  11.1k|            }
 1045|       |
 1046|       |            // End conditions
 1047|  26.2M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1047:17): [True: 596k, False: 25.6M]
  |  Branch (1047:30): [True: 1.91M, False: 23.7M]
  ------------------
 1048|  2.50M|               if (in_flow) {
  ------------------
  |  Branch (1048:20): [True: 2.42M, False: 85.4k]
  ------------------
 1049|  2.42M|                  auto continuation = it;
 1050|  2.42M|                  skip_newline(continuation, end);
 1051|  2.42M|                  bool continuation_is_comment = false;
 1052|       |
 1053|  2.42M|                  while (continuation != end) {
  ------------------
  |  Branch (1053:26): [True: 2.31M, False: 111k]
  ------------------
 1054|  5.67M|                     while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1054:29): [True: 5.66M, False: 11.4k]
  |  Branch (1054:53): [True: 3.30M, False: 2.35M]
  |  Branch (1054:77): [True: 54.2k, False: 2.30M]
  ------------------
 1055|  3.35M|                        ++continuation;
 1056|  3.35M|                     }
 1057|  2.31M|                     if (continuation != end && *continuation == '#') {
  ------------------
  |  Branch (1057:26): [True: 2.30M, False: 11.4k]
  |  Branch (1057:49): [True: 90.1k, False: 2.21M]
  ------------------
 1058|       |                        // Comment lines terminate plain flow scalars; the caller
 1059|       |                        // will consume comments/separators outside this scalar.
 1060|  90.1k|                        continuation_is_comment = true;
 1061|  90.1k|                        break;
 1062|  90.1k|                     }
 1063|  2.22M|                     break;
 1064|  2.31M|                  }
 1065|       |
 1066|  2.42M|                  if (continuation_is_comment || continuation == end || *continuation == ',' || *continuation == ']' ||
  ------------------
  |  Branch (1066:23): [True: 90.1k, False: 2.33M]
  |  Branch (1066:50): [True: 122k, False: 2.21M]
  |  Branch (1066:73): [True: 205k, False: 2.00M]
  |  Branch (1066:97): [True: 3.99k, False: 2.00M]
  ------------------
 1067|  2.00M|                      *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1067:23): [True: 19.8k, False: 1.98M]
  |  Branch (1067:47): [True: 43.0k, False: 1.93M]
  ------------------
 1068|   485k|                     break;
 1069|   485k|                  }
 1070|       |
 1071|  2.29M|                  while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1071:26): [True: 2.26M, False: 30.2k]
  |  Branch (1071:45): [True: 320k, False: 1.94M]
  |  Branch (1071:68): [True: 33.9k, False: 1.90M]
  ------------------
 1072|   354k|                     value.pop_back();
 1073|   354k|                  }
 1074|  1.93M|                  if (!value.empty()) {
  ------------------
  |  Branch (1074:23): [True: 1.90M, False: 30.2k]
  ------------------
 1075|  1.90M|                     value.push_back(' ');
 1076|  1.90M|                  }
 1077|  1.93M|                  it = continuation;
 1078|  1.93M|                  continue;
 1079|  2.42M|               }
 1080|  85.4k|               break;
 1081|  2.50M|            }
 1082|       |
 1083|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1084|       |            // "foo#bar" is a valid plain scalar, but "foo #bar" has a comment
 1085|  23.7M|            if (c == '#') {
  ------------------
  |  Branch (1085:17): [True: 1.05M, False: 22.7M]
  ------------------
 1086|       |               // Check if preceded by whitespace (comment indicator)
 1087|  1.05M|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1087:20): [True: 20.9k, False: 1.03M]
  |  Branch (1087:37): [True: 37.5k, False: 1.00M]
  |  Branch (1087:60): [True: 5.77k, False: 994k]
  ------------------
 1088|  64.2k|                  break; // This is a comment
 1089|  64.2k|               }
 1090|       |               // Otherwise # is part of the scalar value
 1091|  1.05M|            }
 1092|       |
 1093|       |            // Flow indicators end plain scalars in flow context
 1094|  23.7M|            if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1094:17): [True: 23.6M, False: 72.0k]
  |  Branch (1094:29): [True: 1.27M, False: 22.3M]
  |  Branch (1094:41): [True: 136k, False: 22.2M]
  |  Branch (1094:53): [True: 310k, False: 21.9M]
  ------------------
 1095|       |
 1096|       |            // Colon followed by space/newline ends plain scalar
 1097|  22.0M|            if (c == ':') {
  ------------------
  |  Branch (1097:17): [True: 20.9M, False: 1.00M]
  ------------------
 1098|  20.9M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1098:20): [True: 20.8k, False: 20.9M]
  |  Branch (1098:39): [True: 127k, False: 20.8M]
  |  Branch (1098:59): [True: 14.0k, False: 20.8M]
  |  Branch (1098:80): [True: 30.0k, False: 20.7M]
  |  Branch (1098:101): [True: 14.9k, False: 20.7M]
  ------------------
 1099|   207k|                  break;
 1100|   207k|               }
 1101|  20.7M|               if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1101:20): [True: 20.7M, False: 13.4k]
  |  Branch (1101:32): [True: 22.7k, False: 20.7M]
  |  Branch (1101:52): [True: 1.82k, False: 20.7M]
  |  Branch (1101:72): [True: 3.91k, False: 20.7M]
  ------------------
 1102|  28.5k|                  break;
 1103|  28.5k|               }
 1104|  20.7M|            }
 1105|       |
 1106|  21.7M|            value.push_back(c);
 1107|  21.7M|            ++it;
 1108|  21.7M|         }
 1109|       |
 1110|       |         // Trim trailing whitespace
 1111|  5.39M|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1111:17): [True: 4.87M, False: 518k]
  |  Branch (1111:36): [True: 2.00M, False: 2.87M]
  |  Branch (1111:59): [True: 351k, False: 2.52M]
  ------------------
 1112|  2.35M|            value.pop_back();
 1113|  2.35M|         }
 1114|       |
 1115|  3.04M|         if (in_flow && (value == "---" || value == "..." || value == "-")) {
  ------------------
  |  Branch (1115:14): [True: 2.81M, False: 230k]
  |  Branch (1115:26): [True: 14, False: 2.81M]
  |  Branch (1115:44): [True: 16, False: 2.81M]
  |  Branch (1115:62): [True: 26, False: 2.81M]
  ------------------
 1116|     56|            ctx.error = error_code::syntax_error;
 1117|     56|         }
 1118|  3.04M|      }
_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_:
 5310|   807k|      {
 5311|   807k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   807k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   807k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   807k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   807k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 807k, False: 0]
  ------------------
 5321|   807k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   807k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   810k|      {
 2116|   810k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 810k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   810k|         yaml::node_preamble_state preamble{};
 2120|   810k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 6.24k, False: 803k]
  ------------------
 2121|   810k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   810k|                   return yaml::tag_valid_for_float(tag);
 2123|   810k|                }
 2124|   810k|                else {
 2125|   810k|                   return yaml::tag_valid_for_int(tag);
 2126|   810k|                }
 2127|   810k|             }))
 2128|  6.24k|            return;
 2129|       |
 2130|   803k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   803k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   803k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   803k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 17.0k, False: 786k]
  ------------------
 2138|  17.0k|               ++it;
 2139|  17.0k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 15.7k, False: 1.35k]
  |  Branch (2139:38): [True: 647, False: 15.0k]
  |  Branch (2139:74): [True: 252, False: 14.8k]
  ------------------
 2140|  14.8k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 376, False: 14.4k]
  ------------------
 2141|  1.27k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  1.27k|                  it += 3;
 2143|  1.27k|                  finalize();
 2144|  1.27k|                  return;
 2145|  1.27k|               }
 2146|  15.8k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 14.4k, False: 1.35k]
  |  Branch (2146:38): [True: 313, False: 14.1k]
  |  Branch (2146:74): [True: 272, False: 13.8k]
  ------------------
 2147|  13.8k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 778, False: 13.0k]
  ------------------
 2148|  1.36k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  1.36k|                  it += 3;
 2150|  1.36k|                  finalize();
 2151|  1.36k|                  return;
 2152|  1.36k|               }
 2153|  14.4k|               it = start;
 2154|  14.4k|            }
 2155|       |
 2156|   801k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 3.02k, False: 798k]
  |  Branch (2156:31): [True: 8.59k, False: 789k]
  ------------------
 2157|  11.6k|               const char sign = *it;
 2158|  11.6k|               ++it;
 2159|  11.6k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 11.0k, False: 604]
  |  Branch (2159:33): [True: 2.31k, False: 8.70k]
  ------------------
 2160|  2.31k|                  ++it;
 2161|  2.31k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 2.04k, False: 264]
  |  Branch (2161:41): [True: 598, False: 1.45k]
  |  Branch (2161:77): [True: 373, False: 1.07k]
  ------------------
 2162|  1.31k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 340, False: 737]
  ------------------
 2163|  1.31k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 984, False: 327]
  ------------------
 2164|    984|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|    984|                     }
 2166|    327|                     else {
 2167|    327|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    327|                     }
 2169|  1.31k|                     it += 3;
 2170|  1.31k|                     finalize();
 2171|  1.31k|                     return;
 2172|  1.31k|                  }
 2173|  2.31k|               }
 2174|  10.3k|               it = start;
 2175|  10.3k|            }
 2176|   801k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   799k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  22.5M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 22.5M, False: 7.33k]
  ------------------
 2183|  22.5M|            const char c = *it;
 2184|  22.5M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 14.9k, False: 22.5M]
  |  Branch (2184:29): [True: 6.52k, False: 22.5M]
  |  Branch (2184:42): [True: 6.68k, False: 22.5M]
  |  Branch (2184:55): [True: 2.39k, False: 22.5M]
  |  Branch (2184:68): [True: 748k, False: 21.8M]
  |  Branch (2184:80): [True: 2.22k, False: 21.8M]
  |  Branch (2184:92): [True: 1.63k, False: 21.8M]
  |  Branch (2184:104): [True: 8.44k, False: 21.7M]
  ------------------
 2185|   791k|               break;
 2186|   791k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  21.7M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 470k, False: 21.3M]
  ------------------
 2189|   470k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 649, False: 469k]
  |  Branch (2189:39): [True: 2.40k, False: 467k]
  |  Branch (2189:59): [True: 596, False: 466k]
  |  Branch (2189:80): [True: 583, False: 466k]
  |  Branch (2189:101): [True: 1.15k, False: 465k]
  ------------------
 2190|  5.38k|                  break;
 2191|  5.38k|               }
 2192|   470k|            }
 2193|  21.7M|            ++it;
 2194|  21.7M|         }
 2195|       |
 2196|   803k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   803k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 1.19k, False: 802k]
  ------------------
 2199|  1.19k|            ctx.error = error_code::parse_number_failure;
 2200|  1.19k|            return;
 2201|  1.19k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|   802k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   802k|            bool negative = false;
 2254|   802k|            std::string_view digits = num_str;
 2255|       |
 2256|   802k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 798k, False: 3.94k]
  |  Branch (2256:37): [True: 8.26k, False: 790k]
  |  Branch (2256:62): [True: 2.04k, False: 788k]
  ------------------
 2257|  10.3k|               negative = (digits.front() == '-');
 2258|  10.3k|               digits.remove_prefix(1);
 2259|  10.3k|            }
 2260|       |
 2261|   802k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 116k, False: 686k]
  |  Branch (2261:38): [True: 18.3k, False: 98.2k]
  ------------------
 2262|  18.3k|               int base = 10;
 2263|  18.3k|               size_t offset = 0;
 2264|       |
 2265|  18.3k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 2.12k, False: 16.2k]
  |  Branch (2265:40): [True: 592, False: 15.6k]
  ------------------
 2266|  2.71k|                  base = 16;
 2267|  2.71k|                  offset = 2;
 2268|  2.71k|               }
 2269|  15.6k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 656, False: 14.9k]
  |  Branch (2269:45): [True: 472, False: 14.5k]
  ------------------
 2270|  1.12k|                  base = 8;
 2271|  1.12k|                  offset = 2;
 2272|  1.12k|               }
 2273|  14.5k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 503, False: 14.0k]
  |  Branch (2273:45): [True: 563, False: 13.4k]
  ------------------
 2274|  1.06k|                  base = 2;
 2275|  1.06k|                  offset = 2;
 2276|  1.06k|               }
 2277|       |
 2278|  18.3k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 4.90k, False: 13.4k]
  ------------------
 2279|  4.90k|                  auto raw_digits = digits.substr(offset);
 2280|  4.90k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  4.90k|                  std::string clean_storage;
 2283|  4.90k|                  std::string_view clean_view;
 2284|  4.90k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 1.26k, False: 3.64k]
  ------------------
 2285|  1.26k|                     clean_storage.reserve(raw_digits.size());
 2286|  3.12M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 3.12M, False: 1.26k]
  ------------------
 2287|  3.12M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 3.12M, False: 3.39k]
  ------------------
 2288|  3.12M|                           clean_storage.push_back(c);
 2289|  3.12M|                        }
 2290|  3.12M|                     }
 2291|  1.26k|                     clean_view = clean_storage;
 2292|  1.26k|                  }
 2293|  3.64k|                  else {
 2294|  3.64k|                     clean_view = raw_digits;
 2295|  3.64k|                  }
 2296|       |
 2297|  4.90k|                  uint64_t parsed_int{};
 2298|  4.90k|                  auto [ptr, ec] =
 2299|  4.90k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  4.90k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 2.16k, False: 2.74k]
  |  Branch (2300:44): [True: 966, False: 1.77k]
  ------------------
 2301|  3.13k|                     ctx.error = error_code::parse_number_failure;
 2302|  3.13k|                     finalize();
 2303|  3.13k|                     return;
 2304|  3.13k|                  }
 2305|       |
 2306|  1.77k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  1.77k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 968, False: 808]
  ------------------
 2308|  1.77k|                  finalize();
 2309|  1.77k|                  return;
 2310|  4.90k|               }
 2311|  18.3k|            }
 2312|   802k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|   797k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|   802k|         std::string clean_storage;
 2318|   802k|         std::string_view clean_view;
 2319|       |
 2320|   802k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 2.05k, False: 800k]
  ------------------
 2321|  2.05k|            clean_storage.reserve(num_str.size());
 2322|  9.74M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 9.74M, False: 2.05k]
  ------------------
 2323|  9.74M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 9.73M, False: 10.9k]
  ------------------
 2324|  9.73M|                  clean_storage.push_back(c);
 2325|  9.73M|               }
 2326|  9.74M|            }
 2327|  2.05k|            clean_view = clean_storage;
 2328|  2.05k|         }
 2329|   800k|         else {
 2330|   800k|            clean_view = num_str;
 2331|   800k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   802k|         auto parse_view = clean_view;
 2336|   802k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 793k, False: 8.94k]
  |  Branch (2336:37): [True: 8.26k, False: 785k]
  ------------------
 2337|  8.26k|            parse_view.remove_prefix(1);
 2338|  8.26k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 3.93k, False: 4.33k]
  ------------------
 2339|  3.93k|               ctx.error = error_code::parse_number_failure;
 2340|  3.93k|               return;
 2341|  3.93k|            }
 2342|  8.26k|         }
 2343|       |
 2344|   798k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   798k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|   798k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 27.0k, False: 771k]
  |  Branch (2347:45): [True: 34.1k, False: 737k]
  ------------------
 2348|  52.4k|               ctx.error = error_code::parse_number_failure;
 2349|  52.4k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|   798k|         finalize();
 2360|   798k|      }
_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|   810k|      {
  466|   810k|         skip_inline_ws(it, end);
  467|       |
  468|   810k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 426, False: 809k]
  ------------------
  469|    426|            if constexpr (!AllowEmptyInput) {
  470|    426|               ctx.error = error_code::unexpected_end;
  471|    426|            }
  472|    426|            return true;
  473|    426|         }
  474|       |
  475|   809k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   809k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 160, False: 809k]
  ------------------
  477|    160|            ctx.error = error_code::syntax_error;
  478|    160|            return true;
  479|    160|         }
  480|   809k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 142, False: 809k]
  ------------------
  481|    142|            ctx.error = error_code::syntax_error;
  482|    142|            return true;
  483|    142|         }
  484|       |
  485|   809k|         skip_inline_ws(it, end);
  486|       |
  487|   809k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 160, False: 809k]
  ------------------
  488|    160|            if constexpr (!AllowEmptyInput) {
  489|    160|               ctx.error = error_code::unexpected_end;
  490|    160|            }
  491|    160|            return true;
  492|    160|         }
  493|       |
  494|   809k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.36k, False: 803k]
  ------------------
  495|  5.36k|            return true;
  496|  5.36k|         }
  497|       |
  498|   803k|         return false;
  499|   809k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   809k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   809k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   809k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   809k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   809k|      {
  409|   809k|         state.has_anchor = false;
  410|   809k|         state.anchor_name.clear();
  411|   809k|         state.anchor_start = nullptr;
  412|   809k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   809k|         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|   809k|            else {
  421|   809k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.91k, False: 804k]
  ------------------
  422|   809k|            }
  423|   809k|         }
  424|       |
  425|   809k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 804k, False: 4.91k]
  |  Branch (425:27): [True: 3.52k, False: 800k]
  ------------------
  426|  3.52k|            ++it;
  427|  3.52k|            auto name = parse_anchor_name(it, end);
  428|  3.52k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 227, False: 3.29k]
  ------------------
  429|    227|               ctx.error = error_code::syntax_error;
  430|    227|               return true;
  431|    227|            }
  432|  3.29k|            skip_inline_ws(it, end);
  433|  3.29k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 217, False: 3.07k]
  ------------------
  434|    217|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    217|                  ctx.error = error_code::unexpected_end;
  436|    217|               }
  437|    217|               return true;
  438|    217|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.07k|            state.has_anchor = true;
  446|  3.07k|            state.anchor_name = std::string(name);
  447|  3.07k|            state.anchor_start = &*it;
  448|  3.07k|         }
  449|       |
  450|   808k|         return false;
  451|   809k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   809k|      {
  301|   809k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 809k]
  |  Branch (301:27): [True: 804k, False: 4.91k]
  ------------------
  302|       |
  303|  4.91k|         ++it; // skip '*'
  304|  4.91k|         auto name = parse_anchor_name(it, end);
  305|  4.91k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 321, False: 4.59k]
  ------------------
  306|    321|            ctx.error = error_code::syntax_error;
  307|    321|            return true;
  308|    321|         }
  309|       |
  310|  4.59k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.59k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 782, False: 3.81k]
  ------------------
  312|    782|            ctx.error = error_code::syntax_error; // undefined alias
  313|    782|            return true;
  314|    782|         }
  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.81k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.81k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 705, False: 3.10k]
  ------------------
  322|    705|            return true;
  323|    705|         }
  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.10k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 85, False: 3.02k]
  ------------------
  329|     85|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     85|            return true;
  331|     85|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  3.02k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.02k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 3.02k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  3.02k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 9, False: 3.01k]
  ------------------
  342|      9|            ctx.error = error_code::exceeded_max_expansion;
  343|      9|            ctx.custom_error_message = "alias expansion";
  344|      9|            return true;
  345|      9|         }
  346|       |
  347|  3.01k|         auto replay_it = span.begin;
  348|  3.01k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.01k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.01k|         ctx.indent_stack.clear();
  353|  3.01k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 765, False: 2.24k]
  ------------------
  354|    765|            ctx.push_indent(span.base_indent - 1);
  355|    765|         }
  356|       |
  357|  3.01k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.01k|         using V = std::remove_cvref_t<T>;
  360|  3.01k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.01k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.01k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.01k|         return true;
  367|  3.02k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   798k|         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_:
 5310|  20.2k|      {
 5311|  20.2k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  20.2k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  20.2k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  20.2k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  20.2k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 20.2k, False: 0]
  ------------------
 5321|  20.2k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  20.2k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  24.9k|      {
 2081|  24.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 24.9k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  24.9k|         yaml::node_preamble_state preamble{};
 2085|  24.9k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 5.63k, False: 19.3k]
  ------------------
 2086|  24.9k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  5.63k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  19.3k|         std::string str;
 2091|  19.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  19.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 1.77k, False: 17.5k]
  |  Branch (2093:31): [True: 936, False: 16.6k]
  |  Branch (2093:48): [True: 888, False: 15.7k]
  |  Branch (2093:65): [True: 346, False: 15.3k]
  |  Branch (2093:81): [True: 505, False: 14.8k]
  |  Branch (2093:97): [True: 317, False: 14.5k]
  ------------------
 2094|  14.5k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 709, False: 13.8k]
  |  Branch (2094:29): [True: 294, False: 13.5k]
  |  Branch (2094:44): [True: 310, False: 13.2k]
  ------------------
 2095|  6.07k|            value = true;
 2096|  6.07k|         }
 2097|  13.2k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 3.84k, False: 9.39k]
  |  Branch (2097:37): [True: 698, False: 8.69k]
  |  Branch (2097:55): [True: 721, False: 7.97k]
  |  Branch (2097:73): [True: 727, False: 7.24k]
  |  Branch (2097:88): [True: 5.76k, False: 1.48k]
  |  Branch (2097:103): [True: 312, False: 1.17k]
  ------------------
 2098|  13.0k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 317, False: 857]
  |  Branch (2098:35): [True: 313, False: 544]
  |  Branch (2098:51): [True: 393, False: 151]
  ------------------
 2099|  13.0k|            value = false;
 2100|  13.0k|         }
 2101|    151|         else {
 2102|    151|            ctx.error = error_code::expected_true_or_false;
 2103|    151|         }
 2104|       |
 2105|  19.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  19.3k|      }
_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|  24.9k|      {
  466|  24.9k|         skip_inline_ws(it, end);
  467|       |
  468|  24.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 24.9k]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|  24.9k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  24.9k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 24.9k]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|  24.9k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 24.9k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  24.9k|         skip_inline_ws(it, end);
  486|       |
  487|  24.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 24.9k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  24.9k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.61k, False: 19.3k]
  ------------------
  495|  5.61k|            return true;
  496|  5.61k|         }
  497|       |
  498|  19.3k|         return false;
  499|  24.9k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  24.9k|                                             [](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|  24.9k|      {
  409|  24.9k|         state.has_anchor = false;
  410|  24.9k|         state.anchor_name.clear();
  411|  24.9k|         state.anchor_start = nullptr;
  412|  24.9k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  24.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|  24.9k|            else {
  421|  24.9k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.58k, False: 19.3k]
  ------------------
  422|  24.9k|            }
  423|  24.9k|         }
  424|       |
  425|  24.9k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 19.3k, False: 5.58k]
  |  Branch (425:27): [True: 3.98k, False: 15.3k]
  ------------------
  426|  3.98k|            ++it;
  427|  3.98k|            auto name = parse_anchor_name(it, end);
  428|  3.98k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 3.97k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  3.97k|            skip_inline_ws(it, end);
  433|  3.97k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 3.95k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.95k|            state.has_anchor = true;
  446|  3.95k|            state.anchor_name = std::string(name);
  447|  3.95k|            state.anchor_start = &*it;
  448|  3.95k|         }
  449|       |
  450|  24.8k|         return false;
  451|  24.9k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  24.9k|      {
  301|  24.9k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 24.9k]
  |  Branch (301:27): [True: 19.3k, False: 5.58k]
  ------------------
  302|       |
  303|  5.58k|         ++it; // skip '*'
  304|  5.58k|         auto name = parse_anchor_name(it, end);
  305|  5.58k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 5.57k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  5.57k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.57k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 27, False: 5.54k]
  ------------------
  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|  5.54k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.54k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 863, False: 4.68k]
  ------------------
  322|    863|            return true;
  323|    863|         }
  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.68k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 4.67k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  4.67k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.67k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.67k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.67k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.67k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.67k|         auto replay_it = span.begin;
  348|  4.67k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.67k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.67k|         ctx.indent_stack.clear();
  353|  4.67k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.45k, False: 3.22k]
  ------------------
  354|  1.45k|            ctx.push_indent(span.base_indent - 1);
  355|  1.45k|         }
  356|       |
  357|  4.67k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.67k|         using V = std::remove_cvref_t<T>;
  360|  4.67k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.67k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.67k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.67k|         return true;
  367|  4.67k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  7.06k|      {
 2467|  7.06k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 7.06k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  7.06k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  7.06k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 10, False: 7.05k]
  ------------------
 2473|     10|            ctx.error = error_code::unexpected_end;
 2474|     10|            return;
 2475|     10|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  7.05k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 2.20k, False: 4.84k]
  ------------------
 2479|  2.20k|            ++it;
 2480|  2.20k|            return;
 2481|  2.20k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  4.84k|         auto start = it;
 2485|  22.8k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 22.4k, False: 339]
  |  Branch (2485:30): [True: 17.9k, False: 4.50k]
  ------------------
 2486|  17.9k|            ++it;
 2487|  17.9k|         }
 2488|       |
 2489|  4.84k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  4.84k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 24, False: 4.82k]
  ------------------
 2491|     24|            ctx.error = error_code::syntax_error;
 2492|     24|         }
 2493|  4.84k|      }
_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_:
 5310|   681k|      {
 5311|   681k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   681k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   681k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   681k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   681k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 681k, False: 0]
  ------------------
 5321|   681k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   681k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|   692k|      {
 4617|   692k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 692k]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|   692k|         yaml::node_preamble_state preamble{};
 4621|   692k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 12.0k, False: 680k]
  ------------------
 4622|   692k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  12.0k|            return;
 4624|       |
 4625|   680k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|   680k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 12, False: 680k]
  ------------------
 4627|     12|            return;
 4628|       |
 4629|   680k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|   680k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4631|       |
 4632|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4633|       |         // value of a key that existed before the read and adds new keys, while
 4634|       |         // pre-existing keys the document does not mention are preserved (like a
 4635|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4636|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4637|       |         // mappings disallow duplicate keys and the conformance suite expects
 4638|       |         // first-wins, which falls out of emplace into an empty map. Any
 4639|       |         // pre-existing entry the document leaves untouched is restored on scope
 4640|       |         // exit (including error paths). When the target starts empty (the common
 4641|       |         // case) this is a no-op with negligible cost.
 4642|   680k|         std::remove_cvref_t<T> preexisting_entries;
 4643|   680k|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 680k]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|   680k|         struct merge_restore_guard
 4648|   680k|         {
 4649|   680k|            std::remove_cvref_t<T>& target;
 4650|   680k|            std::remove_cvref_t<T>& saved;
 4651|   680k|            ~merge_restore_guard()
 4652|   680k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   680k|               for (auto& entry : saved) {
 4656|   680k|                  target.emplace(entry.first, std::move(entry.second));
 4657|   680k|               }
 4658|   680k|            }
 4659|   680k|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|   680k|         const bool treat_as_block_mapping =
 4662|   680k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [Folded, False: 680k]
  |  Branch (4662:48): [True: 0, False: 0]
  |  Branch (4662:62): [True: 0, False: 0]
  ------------------
 4663|       |
 4664|   680k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 421k, False: 258k]
  |  Branch (4664:28): [True: 0, Folded]
  ------------------
 4665|       |            // Flow mapping
 4666|   421k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|   421k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|   421k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 419k, False: 1.55k]
  |  Branch (4670:30): [True: 8.60k, False: 410k]
  ------------------
 4671|  8.60k|               ++it;
 4672|  8.60k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  8.60k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 11, False: 8.59k]
  ------------------
 4674|     11|                  return;
 4675|  8.59k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  8.59k|               return;
 4677|  8.60k|            }
 4678|       |
 4679|  1.32M|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 1.32M, False: 4.13k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  1.32M|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  1.32M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 1.32M, False: 0]
  |  Branch (4683:33): [True: 11.2k, False: 1.31M]
  ------------------
 4684|  11.2k|                  ++it;
 4685|  11.2k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  11.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 15, False: 11.2k]
  ------------------
 4687|     15|                     return;
 4688|  11.2k|                  break;
 4689|  11.2k|               }
 4690|       |
 4691|  1.31M|               bool explicit_flow_key = false;
 4692|  1.31M|               auto explicit_probe = it;
 4693|  1.31M|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  1.31M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 1.31M, False: 0]
  |  Branch (4694:45): [True: 16.8k, False: 1.29M]
  ------------------
 4695|  16.8k|                  const auto after_q = explicit_probe + 1;
 4696|  16.8k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 7, False: 16.7k]
  |  Branch (4696:41): [True: 10.2k, False: 6.56k]
  ------------------
 4697|  11.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 1.07k, False: 5.48k]
  |  Branch (4697:42): [True: 560, False: 4.92k]
  ------------------
 4698|  11.8k|                     explicit_flow_key = true;
 4699|  11.8k|                     it = explicit_probe + 1;
 4700|  11.8k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  11.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 3, False: 11.8k]
  ------------------
 4702|      3|                        return;
 4703|  11.8k|                  }
 4704|  16.8k|               }
 4705|       |               // Parse key
 4706|  1.31M|               key_t key{};
 4707|  1.31M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  1.31M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 11.8k, False: 1.30M]
  |  Branch (4708:44): [True: 11.8k, False: 11]
  |  Branch (4708:58): [True: 923, False: 10.9k]
  |  Branch (4708:72): [True: 2.87k, False: 8.06k]
  |  Branch (4708:86): [True: 734, False: 7.33k]
  ------------------
 4709|  4.53k|                     key.clear();
 4710|  4.53k|                  }
 4711|  1.30M|                  else {
 4712|  1.30M|                     auto key_probe = it;
 4713|  1.30M|                     yaml::skip_inline_ws(key_probe, end);
 4714|       |
 4715|       |                     // Use full node parsing only for structurally complex flow keys.
 4716|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4717|  1.30M|                     bool parse_complex_flow_key = false;
 4718|  1.30M|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 1.30M, False: 11]
  ------------------
 4719|  1.30M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 4.31k, False: 1.30M]
  |  Branch (4719:50): [True: 25.2k, False: 1.28M]
  ------------------
 4720|  29.5k|                           parse_complex_flow_key = true;
 4721|  29.5k|                        }
 4722|  1.28M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 367k, False: 912k]
  ------------------
 4723|   367k|                           ++key_probe;
 4724|   367k|                           yaml::parse_anchor_name(key_probe, end);
 4725|   367k|                           yaml::skip_inline_ws(key_probe, end);
 4726|   367k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 367k, False: 71]
  |  Branch (4726:53): [True: 3.22k, False: 364k]
  |  Branch (4726:74): [True: 202k, False: 161k]
  ------------------
 4727|   205k|                              parse_complex_flow_key = true;
 4728|   205k|                           }
 4729|   367k|                        }
 4730|  1.30M|                     }
 4731|       |
 4732|  1.30M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 235k, False: 1.07M]
  ------------------
 4733|   235k|                        glz::generic key_node{};
 4734|   235k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|   235k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 9.77k, False: 225k]
  ------------------
 4736|  9.77k|                           return;
 4737|   225k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 20, False: 225k]
  ------------------
 4738|     20|                           return;
 4739|   225k|                     }
 4740|  1.07M|                     else {
 4741|  1.07M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 4.66k, False: 1.07M]
  ------------------
 4742|  4.66k|                           return;
 4743|  4.66k|                        }
 4744|  1.07M|                     }
 4745|  1.30M|                  }
 4746|       |               }
 4747|       |               else {
 4748|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4749|       |                     ctx.error = error_code::syntax_error;
 4750|       |                     return;
 4751|       |                  }
 4752|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4753|       |                  if (bool(ctx.error)) [[unlikely]]
 4754|       |                     return;
 4755|       |               }
 4756|       |
 4757|       |               // Separation between flow key and ':' may include comments/newlines.
 4758|       |               // In flow context, newlines are allowed between key and ':'.
 4759|  1.29M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  1.31M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 16, False: 1.31M]
  ------------------
 4761|     16|                  return;
 4762|       |
 4763|  1.31M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  1.31M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  1.31M|                     val = {};
 4766|  1.31M|                     return true;
 4767|  1.31M|                  }
 4768|  1.31M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  1.31M|                     val = glz::generic{};
 4770|  1.31M|                     return true;
 4771|  1.31M|                  }
 4772|  1.31M|                  else {
 4773|  1.31M|                     static constexpr std::string_view null_value{"null"};
 4774|  1.31M|                     auto null_it = null_value.data();
 4775|  1.31M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  1.31M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  1.31M|                     return !bool(ctx.error);
 4778|  1.31M|                  }
 4779|  1.31M|               };
 4780|       |
 4781|  1.31M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 1.29M, False: 16.2k]
  |  Branch (4781:34): [True: 502k, False: 795k]
  |  Branch (4781:48): [True: 140k, False: 654k]
  ------------------
 4782|   643k|                  val_t val{};
 4783|   643k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 643k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|   643k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|   643k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 140k, False: 502k]
  ------------------
 4789|   140k|                     ++it;
 4790|   140k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|   140k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 160, False: 140k]
  ------------------
 4792|    160|                        return;
 4793|   140k|                     break;
 4794|   140k|                  }
 4795|       |
 4796|   502k|                  ++it; // skip comma
 4797|   502k|                  yaml::skip_ws_and_newlines(it, end);
 4798|   502k|                  continue;
 4799|   643k|               }
 4800|       |
 4801|   671k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 16.2k, False: 654k]
  |  Branch (4801:33): [True: 672, False: 654k]
  ------------------
 4802|  2.42k|                  ctx.error = error_code::syntax_error;
 4803|  2.42k|                  return;
 4804|  2.42k|               }
 4805|   668k|               ++it;
 4806|       |
 4807|   668k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|   668k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 5, False: 668k]
  ------------------
 4809|      5|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|   668k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 654k, False: 14.5k]
  |  Branch (4812:34): [True: 25.7k, False: 628k]
  |  Branch (4812:48): [True: 12.2k, False: 616k]
  ------------------
 4813|  37.9k|                  val_t val{};
 4814|  37.9k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 37.9k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  37.9k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  37.9k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 12.2k, False: 25.7k]
  ------------------
 4820|  12.2k|                     ++it;
 4821|  12.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  12.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 5, False: 12.2k]
  ------------------
 4823|      5|                        return;
 4824|  12.2k|                     break;
 4825|  12.2k|                  }
 4826|       |
 4827|  25.7k|                  ++it; // skip comma
 4828|  25.7k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  25.7k|                  continue;
 4830|  37.9k|               }
 4831|       |
 4832|       |               // Parse value
 4833|   630k|               val_t val{};
 4834|   630k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|   630k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 2.99k, False: 627k]
  ------------------
 4836|  2.99k|                  return;
 4837|       |
 4838|   627k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|   627k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|   627k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 612k, False: 14.8k]
  |  Branch (4842:33): [True: 219k, False: 393k]
  ------------------
 4843|   219k|                  ++it;
 4844|   219k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|   219k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 212, False: 219k]
  ------------------
 4846|    212|                     return;
 4847|   219k|                  break;
 4848|   219k|               }
 4849|   408k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 393k, False: 14.8k]
  |  Branch (4849:38): [True: 373k, False: 20.2k]
  ------------------
 4850|   373k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|   373k|                  yaml::skip_ws_and_newlines(it, end);
 4853|   373k|               }
 4854|  35.1k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 20.2k, False: 14.8k]
  |  Branch (4854:39): [True: 9.70k, False: 10.5k]
  |  Branch (4854:54): [True: 10.2k, False: 319]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  19.9k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  19.9k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 19.8k, False: 44]
  |  Branch (4858:36): [True: 4.00k, False: 15.8k]
  ------------------
 4859|  4.00k|                     ++it;
 4860|  4.00k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  4.00k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 2, False: 3.99k]
  ------------------
 4862|      2|                        return;
 4863|  3.99k|                     break;
 4864|  4.00k|                  }
 4865|  15.9k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 15.8k, False: 44]
  |  Branch (4865:36): [True: 15.8k, False: 74]
  ------------------
 4866|  15.8k|                     ++it;
 4867|  15.8k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  15.8k|                     continue;
 4869|  15.8k|                  }
 4870|    118|                  ctx.error = error_code::syntax_error;
 4871|    118|                  return;
 4872|  15.9k|               }
 4873|  15.2k|               else {
 4874|  15.2k|                  ctx.error = error_code::syntax_error;
 4875|  15.2k|                  return;
 4876|  15.2k|               }
 4877|   627k|            }
 4878|   412k|         }
 4879|   258k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   258k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   258k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   258k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   258k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   258k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   258k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   258k|                           if (ctx.stream_begin) {
 4893|   258k|                              auto is_line_content_start = [&](auto pos) {
 4894|   258k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   258k|                              };
 4896|       |
 4897|   258k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   258k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   258k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   258k|                                 return line != end && *line == ':';
 4901|   258k|                              };
 4902|       |
 4903|   258k|                              if (!is_line_content_start(it) &&
 4904|   258k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   258k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   258k|                                 ctx.error = error_code::syntax_error;
 4907|   258k|                                 return false;
 4908|   258k|                              }
 4909|   258k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   258k|                           }
 4911|   258k|                        }
 4912|       |
 4913|   258k|                        if (*it == '-' &&
 4914|   258k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   258k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   258k|                           ctx.error = error_code::syntax_error;
 4918|   258k|                           return false;
 4919|   258k|                        }
 4920|       |
 4921|   258k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   258k|                           return false;
 4923|   258k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   258k|                        ctx.pop_indent();
 4925|   258k|                     }
 4926|   258k|                     else {
 4927|   258k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   258k|                        if (nested_indent >= 0) {
 4929|   258k|                           yaml::skip_to_content(it, end);
 4930|   258k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   258k|                              ctx.error = error_code::syntax_error;
 4932|   258k|                              return false;
 4933|   258k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   258k|                           const int32_t value_indent =
 4937|   258k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   258k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   258k|                              return false;
 4940|   258k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   258k|                           ctx.pop_indent();
 4942|   258k|                        }
 4943|   258k|                     }
 4944|   258k|                     return !bool(ctx.error);
 4945|   258k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   258k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   258k|                     ctx.error = error_code::syntax_error;
 4952|   258k|                     return false;
 4953|   258k|                  }
 4954|   258k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   258k|                     ++it; // skip '?'
 4956|   258k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   258k|                     const int32_t explicit_value_indicator_indent =
 4959|   258k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   258k|                     key_t key{};
 4962|   258k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   258k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   258k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   258k|                        };
 4966|       |
 4967|   258k|                        auto key_it = it;
 4968|   258k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   258k|                        auto content = key_it;
 4971|   258k|                        yaml::skip_to_content(content, end);
 4972|   258k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   258k|                        if (content != end && *content == '&') {
 4978|   258k|                           auto anchor_probe = content + 1;
 4979|   258k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   258k|                           if (!anchor_name.empty()) {
 4981|   258k|                              auto after_anchor = anchor_probe;
 4982|   258k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   258k|                              auto value_indicator = after_anchor;
 4985|   258k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   258k|                                 key.clear();
 4987|   258k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   258k|                                 it = value_indicator;
 4989|   258k|                                 handled_anchor_only_empty_key = true;
 4990|   258k|                              }
 4991|   258k|                              else {
 4992|   258k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   258k|                                    yaml::skip_comment(value_indicator, end);
 4994|   258k|                                 }
 4995|   258k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   258k|                                    yaml::skip_newline(value_indicator, end);
 4997|   258k|                                    auto value_line = value_indicator;
 4998|   258k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   258k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   258k|                                       return false;
 5001|   258k|                                    if (value_line != end && *value_line == ':' &&
 5002|   258k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   258k|                                       key.clear();
 5004|   258k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   258k|                                       it = value_line;
 5006|   258k|                                       handled_anchor_only_empty_key = true;
 5007|   258k|                                    }
 5008|   258k|                                    else if (value_line != end && *value_line == ':') {
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|   258k|                                       ctx.error = error_code::syntax_error;
 5013|   258k|                                       return false;
 5014|   258k|                                    }
 5015|   258k|                                 }
 5016|   258k|                              }
 5017|   258k|                           }
 5018|   258k|                        }
 5019|       |
 5020|   258k|                        const bool key_content_spans_lines = [&] {
 5021|   258k|                           auto scan = key_it;
 5022|   258k|                           while (scan != content && scan != end) {
 5023|   258k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   258k|                              ++scan;
 5025|   258k|                           }
 5026|   258k|                           return false;
 5027|   258k|                        }();
 5028|       |
 5029|   258k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   258k|                        }
 5032|   258k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   258k|                           key.clear();
 5034|   258k|                           it = content;
 5035|   258k|                        }
 5036|   258k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   258k|                           auto key_node_it = content;
 5042|   258k|                           auto key_node_end = end;
 5043|   258k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   258k|                              auto scan = content;
 5048|   258k|                              while (scan != end) {
 5049|   258k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   258k|                                    ++scan;
 5051|   258k|                                 }
 5052|   258k|                                 if (scan == end) {
 5053|   258k|                                    break;
 5054|   258k|                                 }
 5055|       |
 5056|   258k|                                 yaml::skip_newline(scan, end);
 5057|   258k|                                 auto line_start = scan;
 5058|       |
 5059|   258k|                                 int32_t indicator_indent = 0;
 5060|   258k|                                 while (scan != end && *scan == ' ') {
 5061|   258k|                                    ++indicator_indent;
 5062|   258k|                                    ++scan;
 5063|   258k|                                 }
 5064|       |
 5065|   258k|                                 if (scan != end && *scan == ':') {
 5066|   258k|                                    const auto after_colon = scan + 1;
 5067|   258k|                                    if ((after_colon == end ||
 5068|   258k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   258k|                                        indicator_indent <= line_indent) {
 5070|   258k|                                       key_node_end = line_start;
 5071|   258k|                                       break;
 5072|   258k|                                    }
 5073|   258k|                                 }
 5074|   258k|                              }
 5075|   258k|                           }
 5076|       |
 5077|   258k|                           glz::generic key_node{};
 5078|   258k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   258k|                           ctx.explicit_mapping_key_context = true;
 5080|   258k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   258k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   258k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   258k|                              return false;
 5084|   258k|                           it = key_node_it;
 5085|   258k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   258k|                              return false;
 5087|   258k|                        }
 5088|   258k|                     }
 5089|   258k|                     else {
 5090|   258k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   258k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   258k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   258k|                              return false;
 5094|   258k|                        }
 5095|   258k|                     }
 5096|       |
 5097|   258k|                     yaml::skip_inline_ws(it, end);
 5098|   258k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   258k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   258k|                        auto probe = it;
 5103|   258k|                        bool found_value_indicator = false;
 5104|       |
 5105|   258k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   258k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   258k|                           auto value_line = probe;
 5109|   258k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   258k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   258k|                              return false;
 5112|       |
 5113|   258k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   258k|                              probe = value_line;
 5115|   258k|                              continue; // blank line
 5116|   258k|                           }
 5117|   258k|                           if (*value_line == '#') {
 5118|   258k|                              yaml::skip_comment(value_line, end);
 5119|   258k|                              probe = value_line;
 5120|   258k|                              continue; // comment-only line
 5121|   258k|                           }
 5122|   258k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   258k|                              it = value_line;
 5124|   258k|                              found_value_indicator = true;
 5125|   258k|                           }
 5126|   258k|                           break;
 5127|   258k|                        }
 5128|       |
 5129|   258k|                        if (found_value_indicator) {
 5130|   258k|                           yaml::skip_inline_ws(it, end);
 5131|   258k|                        }
 5132|   258k|                     }
 5133|       |
 5134|   258k|                     val_t val{};
 5135|   258k|                     if (it != end && *it == ':') {
 5136|   258k|                        ++it;
 5137|   258k|                        if (it != end && *it == '\t') {
 5138|   258k|                           ctx.error = error_code::syntax_error;
 5139|   258k|                           return false;
 5140|   258k|                        }
 5141|   258k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   258k|                           auto probe = it;
 5143|   258k|                           yaml::skip_newline(probe, end);
 5144|   258k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   258k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   258k|                              ctx.error = error_code::syntax_error;
 5147|   258k|                              return false;
 5148|   258k|                           }
 5149|   258k|                        }
 5150|   258k|                        yaml::skip_inline_ws(it, end);
 5151|   258k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   258k|                           return false;
 5153|   258k|                     }
 5154|       |
 5155|   258k|                     value.emplace(std::move(key), std::move(val));
 5156|   258k|                     return true;
 5157|   258k|                  }
 5158|       |
 5159|   258k|                  key_t key{};
 5160|   258k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   258k|                     auto key_probe = it;
 5162|   258k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   258k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   258k|                     if (complex_flow_key) {
 5165|   258k|                        glz::generic key_node{};
 5166|   258k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   258k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   258k|                           return false;
 5169|   258k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   258k|                           return false;
 5171|   258k|                     }
 5172|   258k|                     else {
 5173|   258k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   258k|                           return false;
 5175|   258k|                        }
 5176|   258k|                     }
 5177|   258k|                  }
 5178|   258k|                  else {
 5179|   258k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   258k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   258k|                        return false;
 5182|   258k|                  }
 5183|       |
 5184|   258k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   258k|                  if (it == end || *it != ':') {
 5187|   258k|                     ctx.error = error_code::syntax_error;
 5188|   258k|                     return false;
 5189|   258k|                  }
 5190|   258k|                  ++it;
 5191|   258k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   258k|                  val_t val{};
 5194|   258k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   258k|                     return false;
 5196|       |
 5197|   258k|                  value.emplace(std::move(key), std::move(val));
 5198|   258k|                  return true;
 5199|   258k|               });
 5200|   258k|         }
 5201|       |
 5202|   650k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|   650k|      }
_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|   692k|      {
  466|   692k|         skip_inline_ws(it, end);
  467|       |
  468|   692k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 692k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|   692k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   692k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 692k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   692k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 692k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   692k|         skip_inline_ws(it, end);
  486|       |
  487|   692k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 692k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   692k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.9k, False: 680k]
  ------------------
  495|  11.9k|            return true;
  496|  11.9k|         }
  497|       |
  498|   680k|         return false;
  499|   692k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|   692k|                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|   692k|      {
  409|   692k|         state.has_anchor = false;
  410|   692k|         state.anchor_name.clear();
  411|   692k|         state.anchor_start = nullptr;
  412|   692k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   692k|         if constexpr (Policy.allow_alias) {
  415|   692k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   692k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 691k, False: 542]
  ------------------
  417|   691k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 11.9k, False: 679k]
  ------------------
  418|   691k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   692k|         }
  424|       |
  425|   692k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 680k, False: 11.9k]
  |  Branch (425:27): [True: 8.48k, False: 671k]
  ------------------
  426|  8.48k|            ++it;
  427|  8.48k|            auto name = parse_anchor_name(it, end);
  428|  8.48k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 8.48k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  8.48k|            skip_inline_ws(it, end);
  433|  8.48k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 17, False: 8.46k]
  ------------------
  434|     17|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     17|                  ctx.error = error_code::unexpected_end;
  436|     17|               }
  437|     17|               return true;
  438|     17|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  8.46k|            state.has_anchor = true;
  446|  8.46k|            state.anchor_name = std::string(name);
  447|  8.46k|            state.anchor_start = &*it;
  448|  8.46k|         }
  449|       |
  450|   692k|         return false;
  451|   692k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   691k|      {
  301|   691k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 691k]
  |  Branch (301:27): [True: 679k, False: 11.9k]
  ------------------
  302|       |
  303|  11.9k|         ++it; // skip '*'
  304|  11.9k|         auto name = parse_anchor_name(it, end);
  305|  11.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 11.9k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  11.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 11.9k]
  ------------------
  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|  11.9k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.9k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.43k, False: 10.4k]
  ------------------
  322|  1.43k|            return true;
  323|  1.43k|         }
  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: 7, False: 10.4k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  10.4k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  10.4k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 10.4k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  10.4k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 10.4k]
  ------------------
  342|      7|            ctx.error = error_code::exceeded_max_expansion;
  343|      7|            ctx.custom_error_message = "alias expansion";
  344|      7|            return true;
  345|      7|         }
  346|       |
  347|  10.4k|         auto replay_it = span.begin;
  348|  10.4k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  10.4k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  10.4k|         ctx.indent_stack.clear();
  353|  10.4k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 837, False: 9.61k]
  ------------------
  354|    837|            ctx.push_indent(span.base_indent - 1);
  355|    837|         }
  356|       |
  357|  10.4k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  10.4k|         using V = std::remove_cvref_t<T>;
  360|  10.4k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  10.4k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  10.4k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  10.4k|         return true;
  367|  10.4k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|   681k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|       |                     val = {};
 4766|       |                     return true;
 4767|       |                  }
 4768|   681k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   681k|                     val = glz::generic{};
 4770|   681k|                     return true;
 4771|       |                  }
 4772|       |                  else {
 4773|       |                     static constexpr std::string_view null_value{"null"};
 4774|       |                     auto null_it = null_value.data();
 4775|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|       |                     return !bool(ctx.error);
 4778|       |                  }
 4779|   681k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   258k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   258k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 258k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   258k|         const int32_t parent_indent = ctx.current_indent();
 3722|   258k|         const bool discover_indent = (mapping_indent < 0);
 3723|   258k|         bool first_key = !discover_indent;
 3724|   258k|         bool discovered_first_key_mid_line = false;
 3725|   258k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|   623k|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 400k, False: 223k]
  ------------------
 3728|   400k|            auto line_start = it;
 3729|   400k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 400k]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|   574k|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 567k, False: 6.46k]
  ------------------
 3733|   567k|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 13.1k, False: 554k]
  ------------------
 3734|  13.1k|                  skip_comment(it, end);
 3735|  13.1k|                  skip_newline(it, end);
 3736|  13.1k|                  first_key = false;
 3737|  13.1k|                  line_indent = 0;
 3738|  13.1k|               }
 3739|   554k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 27.7k, False: 526k]
  |  Branch (3739:40): [True: 113k, False: 413k]
  ------------------
 3740|   141k|                  skip_newline(it, end);
 3741|   141k|                  first_key = false;
 3742|   141k|                  line_indent = 0;
 3743|   141k|               }
 3744|   413k|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 74.9k, False: 338k]
  ------------------
 3745|  74.9k|                  line_start = it;
 3746|  74.9k|                  line_indent = 0;
 3747|   340k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 337k, False: 2.67k]
  |  Branch (3747:39): [True: 265k, False: 72.2k]
  ------------------
 3748|   265k|                     ++line_indent;
 3749|   265k|                     ++it;
 3750|   265k|                  }
 3751|       |
 3752|  74.9k|                  bool saw_tab = false;
 3753|  77.0k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 73.8k, False: 3.19k]
  |  Branch (3753:40): [True: 440, False: 73.3k]
  |  Branch (3753:54): [True: 1.60k, False: 71.7k]
  ------------------
 3754|  2.04k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 1.12k, False: 916]
  |  Branch (3754:43): [True: 916, False: 0]
  ------------------
 3755|  2.04k|                     ++it;
 3756|  2.04k|                  }
 3757|       |
 3758|  74.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 3.19k, False: 71.7k]
  |  Branch (3758:36): [True: 2.54k, False: 69.2k]
  |  Branch (3758:51): [True: 1.65k, False: 67.5k]
  |  Branch (3758:66): [True: 2.51k, False: 65.0k]
  ------------------
 3759|  9.91k|                     first_key = false;
 3760|  9.91k|                     line_indent = 0;
 3761|  9.91k|                     continue; // Blank or comment line
 3762|  9.91k|                  }
 3763|       |
 3764|  65.0k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 32, False: 65.0k]
  ------------------
 3765|     32|                     ctx.error = error_code::syntax_error;
 3766|     32|                     return;
 3767|     32|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|  65.0k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 63.2k, False: 1.73k]
  |  Branch (3770:46): [True: 386, False: 62.9k]
  ------------------
 3771|    386|                     it = line_start;
 3772|    386|                     return;
 3773|    386|                  }
 3774|       |
 3775|  64.6k|                  first_key = false;
 3776|  64.6k|                  break; // Found content
 3777|  65.0k|               }
 3778|   338k|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 9.67k, False: 328k]
  ------------------
 3779|  9.67k|                  line_start = it;
 3780|  22.0k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 21.4k, False: 504]
  |  Branch (3780:40): [True: 1.12k, False: 20.3k]
  |  Branch (3780:54): [True: 11.2k, False: 9.17k]
  ------------------
 3781|  9.67k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 504, False: 9.17k]
  |  Branch (3781:36): [True: 1.07k, False: 8.09k]
  |  Branch (3781:51): [True: 7.76k, False: 335]
  |  Branch (3781:66): [True: 304, False: 31]
  ------------------
 3782|  9.64k|                     first_key = false;
 3783|  9.64k|                     line_indent = 0;
 3784|  9.64k|                     continue; // Blank or comment-only line with tab indentation
 3785|  9.64k|                  }
 3786|     31|                  ctx.error = error_code::syntax_error;
 3787|     31|                  return;
 3788|  9.67k|               }
 3789|   328k|               else {
 3790|   328k|                  line_start = it;
 3791|   328k|                  break; // Content at column 0
 3792|   328k|               }
 3793|   567k|            }
 3794|       |
 3795|   399k|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 6.46k, False: 393k]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|   393k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 1.36k, False: 391k]
  |  Branch (3799:45): [True: 1.21k, False: 390k]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|   390k|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 390k, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|   390k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 390k, False: 0]
  |  Branch (3806:39): [True: 132k, False: 258k]
  |  Branch (3806:62): [True: 17.9k, False: 114k]
  |  Branch (3806:84): [True: 12.1k, False: 5.75k]
  ------------------
 3807|  12.1k|                  it = line_start;
 3808|  12.1k|                  return;
 3809|  12.1k|               }
 3810|   378k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 120k, False: 258k]
  |  Branch (3810:43): [True: 279, False: 119k]
  ------------------
 3811|    279|                  it = line_start;
 3812|    279|                  return;
 3813|    279|               }
 3814|   378k|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|   378k|            bool established_mapping_indent_this_line = false;
 3818|   378k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 258k, False: 119k]
  ------------------
 3819|   258k|               mapping_indent = line_indent;
 3820|   258k|               established_mapping_indent_this_line = true;
 3821|   258k|               discovered_first_key_visual_indent = line_indent;
 3822|   258k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   258k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 258k, False: 0]
  |  Branch (3823:43): [True: 258k, False: 0]
  ------------------
 3824|   258k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   258k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 103, False: 258k]
  ------------------
 3826|    103|                        ctx.error = error_code::syntax_error;
 3827|    103|                        return;
 3828|    103|                     }
 3829|       |
 3830|   258k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   258k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 256k, False: 1.73k]
  |  Branch (3831:49): [True: 204k, False: 52.1k]
  ------------------
 3832|   204k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   204k|                     }
 3834|   258k|                  }
 3835|   258k|               }
 3836|   258k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|   378k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 378k, False: 103]
  |  Branch (3840:36): [True: 378k, False: 0]
  |  Branch (3840:59): [True: 119k, False: 258k]
  ------------------
 3841|   119k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 57.3k, False: 62.4k]
  ------------------
 3842|  57.3k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 57.0k, False: 314]
  |  Branch (3842:43): [True: 28.8k, False: 28.1k]
  ------------------
 3843|  28.8k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 25, False: 28.8k]
  ------------------
 3844|     25|                     ctx.error = error_code::syntax_error;
 3845|     25|                     return;
 3846|     25|                  }
 3847|  28.8k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 963, False: 27.8k]
  ------------------
 3848|    963|                     it = line_start;
 3849|    963|                     return;
 3850|    963|                  }
 3851|  28.8k|               }
 3852|  28.4k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 269, False: 28.1k]
  ------------------
 3853|    269|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 19, False: 250]
  |  Branch (3853:47): [True: 2, False: 248]
  ------------------
 3854|    248|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 248, False: 0]
  |  Branch (3854:49): [True: 248, False: 0]
  |  Branch (3854:72): [True: 3, False: 245]
  ------------------
 3855|     24|                  ctx.error = error_code::syntax_error;
 3856|     24|                  return;
 3857|     24|               }
 3858|  57.3k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|   377k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 377k]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|   377k|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 377k]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|   377k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 103, False: 377k]
  |  Branch (3876:32): [True: 0, False: 377k]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|   377k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 126k, False: 251k]
  |  Branch (3885:53): [True: 42.7k, False: 83.3k]
  |  Branch (3885:94): [True: 15.0k, False: 27.7k]
  ------------------
 3886|  15.0k|               const auto after_colon = it + 1;
 3887|  15.0k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 13.3k, False: 1.68k]
  ------------------
 3888|  15.0k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 358, False: 14.6k]
  |  Branch (3888:43): [True: 13.8k, False: 817]
  ------------------
 3889|  14.1k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 1.04k, False: 13.1k]
  ------------------
 3890|  1.04k|                  it = line_start;
 3891|  1.04k|                  return;
 3892|  1.04k|               }
 3893|  15.0k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|   376k|            int32_t effective_line_indent = line_indent;
 3897|   376k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 375k, False: 103]
  |  Branch (3897:36): [True: 258k, False: 117k]
  ------------------
 3898|   258k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 204k, False: 53.8k]
  ------------------
 3899|   204k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 148k, False: 56.2k]
  |  Branch (3899:52): [True: 89.5k, False: 58.4k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   114k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   114k|            }
 3912|       |
 3913|   376k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 11.1k, False: 364k]
  ------------------
 3914|  11.1k|               return;
 3915|  11.1k|            }
 3916|   364k|            first_key = false;
 3917|       |
 3918|   364k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 364k]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|   364k|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|   364k|               auto flow_end = it;
 3925|   364k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|   364k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 24, False: 364k]
  ------------------
 3927|     24|                  return;
 3928|   364k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 303k, False: 61.3k]
  |  Branch (3928:40): [True: 122k, False: 181k]
  |  Branch (3928:60): [True: 4.72k, False: 176k]
  |  Branch (3928:80): [True: 40.8k, False: 135k]
  ------------------
 3929|   168k|                  it = flow_end;
 3930|   168k|                  return;
 3931|   168k|               }
 3932|   364k|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|   364k|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 148k, False: 216k]
  ------------------
 3938|   148k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 36.6k, False: 111k]
  |  Branch (3938:34): [True: 1.22k, False: 110k]
  ------------------
 3939|  37.9k|                  auto peek = it;
 3940|  37.9k|                  skip_inline_ws(peek, end);
 3941|  37.9k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 36.0k, False: 1.89k]
  |  Branch (3941:38): [True: 34.5k, False: 1.49k]
  |  Branch (3941:55): [True: 33.4k, False: 1.08k]
  |  Branch (3941:72): [True: 31.8k, False: 1.59k]
  ------------------
 3942|  31.8k|                     continue; // At leading indent of new line
 3943|  31.8k|                  }
 3944|  37.9k|               }
 3945|   116k|               skip_inline_ws(it, end);
 3946|   116k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 114k, False: 1.89k]
  |  Branch (3946:33): [True: 6.09k, False: 108k]
  ------------------
 3947|  6.09k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  6.09k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 6.09k, False: 0]
  ------------------
 3949|  6.09k|                        const char prev = *(it - 1);
 3950|  6.09k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 2.44k, False: 3.65k]
  |  Branch (3950:44): [True: 1.41k, False: 1.02k]
  |  Branch (3950:60): [True: 671, False: 746]
  |  Branch (3950:76): [True: 6, False: 665]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  6.09k|                     }
 3955|  6.09k|                  }
 3956|  6.09k|               }
 3957|  6.08k|               skip_comment(it, end);
 3958|   116k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 114k, False: 2.17k]
  |  Branch (3958:34): [True: 26.3k, False: 87.6k]
  |  Branch (3958:49): [True: 41.4k, False: 46.2k]
  ------------------
 3959|  67.7k|                  skip_newline(it, end);
 3960|  67.7k|               }
 3961|  48.4k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 46.2k, False: 2.17k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|  46.2k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|  46.2k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 110, False: 46.1k]
  ------------------
 3968|    110|                        ctx.error = error_code::syntax_error;
 3969|    110|                        return;
 3970|    110|                     }
 3971|  46.2k|                  }
 3972|  46.2k|               }
 3973|   116k|            }
 3974|   364k|         }
 3975|   258k|      }
_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:
 4882|   375k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   375k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   375k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   375k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   375k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   375k|                           if (ctx.stream_begin) {
 4893|   375k|                              auto is_line_content_start = [&](auto pos) {
 4894|   375k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   375k|                              };
 4896|       |
 4897|   375k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   375k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   375k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   375k|                                 return line != end && *line == ':';
 4901|   375k|                              };
 4902|       |
 4903|   375k|                              if (!is_line_content_start(it) &&
 4904|   375k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   375k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   375k|                                 ctx.error = error_code::syntax_error;
 4907|   375k|                                 return false;
 4908|   375k|                              }
 4909|   375k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   375k|                           }
 4911|   375k|                        }
 4912|       |
 4913|   375k|                        if (*it == '-' &&
 4914|   375k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   375k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   375k|                           ctx.error = error_code::syntax_error;
 4918|   375k|                           return false;
 4919|   375k|                        }
 4920|       |
 4921|   375k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   375k|                           return false;
 4923|   375k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   375k|                        ctx.pop_indent();
 4925|   375k|                     }
 4926|   375k|                     else {
 4927|   375k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   375k|                        if (nested_indent >= 0) {
 4929|   375k|                           yaml::skip_to_content(it, end);
 4930|   375k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   375k|                              ctx.error = error_code::syntax_error;
 4932|   375k|                              return false;
 4933|   375k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   375k|                           const int32_t value_indent =
 4937|   375k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   375k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   375k|                              return false;
 4940|   375k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   375k|                           ctx.pop_indent();
 4942|   375k|                        }
 4943|   375k|                     }
 4944|   375k|                     return !bool(ctx.error);
 4945|   375k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   375k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 150k, False: 225k]
  |  Branch (4950:37): [True: 149k, False: 430]
  |  Branch (4950:58): [True: 2, False: 149k]
  ------------------
 4951|      2|                     ctx.error = error_code::syntax_error;
 4952|      2|                     return false;
 4953|      2|                  }
 4954|   375k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 150k, False: 225k]
  |  Branch (4954:38): [True: 430, False: 149k]
  |  Branch (4954:57): [True: 47.1k, False: 102k]
  |  Branch (4954:77): [True: 65.2k, False: 37.5k]
  |  Branch (4954:98): [True: 28.5k, False: 8.97k]
  ------------------
 4955|   141k|                     ++it; // skip '?'
 4956|   141k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   141k|                     const int32_t explicit_value_indicator_indent =
 4959|   141k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 99.2k, False: 42.1k]
  ------------------
 4960|       |
 4961|   141k|                     key_t key{};
 4962|   141k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   141k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   141k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   141k|                        };
 4966|       |
 4967|   141k|                        auto key_it = it;
 4968|   141k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   141k|                        auto content = key_it;
 4971|   141k|                        yaml::skip_to_content(content, end);
 4972|   141k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   141k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 139k, False: 2.37k]
  |  Branch (4977:47): [True: 42.7k, False: 96.2k]
  ------------------
 4978|  42.7k|                           auto anchor_probe = content + 1;
 4979|  42.7k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  42.7k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 42.7k, False: 17]
  ------------------
 4981|  42.7k|                              auto after_anchor = anchor_probe;
 4982|  42.7k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  42.7k|                              auto value_indicator = after_anchor;
 4985|  42.7k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 40.1k, False: 2.62k]
  |  Branch (4985:61): [True: 2.98k, False: 37.1k]
  ------------------
 4986|  2.98k|                                 key.clear();
 4987|  2.98k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  2.98k|                                 it = value_indicator;
 4989|  2.98k|                                 handled_anchor_only_empty_key = true;
 4990|  2.98k|                              }
 4991|  39.7k|                              else {
 4992|  39.7k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 37.1k, False: 2.62k]
  |  Branch (4992:64): [True: 1.98k, False: 35.1k]
  ------------------
 4993|  1.98k|                                    yaml::skip_comment(value_indicator, end);
 4994|  1.98k|                                 }
 4995|  39.7k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 36.9k, False: 2.78k]
  |  Branch (4995:65): [True: 5.66k, False: 31.3k]
  |  Branch (4995:93): [True: 13.4k, False: 17.8k]
  ------------------
 4996|  19.1k|                                    yaml::skip_newline(value_indicator, end);
 4997|  19.1k|                                    auto value_line = value_indicator;
 4998|  19.1k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  19.1k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 4, False: 19.1k]
  ------------------
 5000|      4|                                       return false;
 5001|  19.1k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 18.1k, False: 965]
  |  Branch (5001:62): [True: 1.61k, False: 16.5k]
  ------------------
 5002|  1.61k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 1.60k, False: 5]
  ------------------
 5003|  1.60k|                                       key.clear();
 5004|  1.60k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  1.60k|                                       it = value_line;
 5006|  1.60k|                                       handled_anchor_only_empty_key = true;
 5007|  1.60k|                                    }
 5008|  17.5k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 16.5k, False: 965]
  |  Branch (5008:67): [True: 5, False: 16.5k]
  ------------------
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|      5|                                       ctx.error = error_code::syntax_error;
 5013|      5|                                       return false;
 5014|      5|                                    }
 5015|  19.1k|                                 }
 5016|  39.7k|                              }
 5017|  42.7k|                           }
 5018|  42.7k|                        }
 5019|       |
 5020|   141k|                        const bool key_content_spans_lines = [&] {
 5021|   141k|                           auto scan = key_it;
 5022|   141k|                           while (scan != content && scan != end) {
 5023|   141k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   141k|                              ++scan;
 5025|   141k|                           }
 5026|   141k|                           return false;
 5027|   141k|                        }();
 5028|       |
 5029|   141k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 4.59k, False: 136k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  4.59k|                        }
 5032|   136k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 2.37k, False: 134k]
  |  Branch (5032:53): [True: 4.09k, False: 130k]
  |  Branch (5032:72): [True: 3.02k, False: 1.06k]
  ------------------
 5033|  5.40k|                           key.clear();
 5034|  5.40k|                           it = content;
 5035|  5.40k|                        }
 5036|   131k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   131k|                           auto key_node_it = content;
 5042|   131k|                           auto key_node_end = end;
 5043|   131k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   131k|                              auto scan = content;
 5048|  1.43M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 1.41M, False: 18.6k]
  ------------------
 5049|  74.7M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 74.6M, False: 79.3k]
  |  Branch (5049:56): [True: 74.2M, False: 438k]
  |  Branch (5049:73): [True: 73.3M, False: 894k]
  ------------------
 5050|  73.3M|                                    ++scan;
 5051|  73.3M|                                 }
 5052|  1.41M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 79.3k, False: 1.33M]
  ------------------
 5053|  79.3k|                                    break;
 5054|  79.3k|                                 }
 5055|       |
 5056|  1.33M|                                 yaml::skip_newline(scan, end);
 5057|  1.33M|                                 auto line_start = scan;
 5058|       |
 5059|  1.33M|                                 int32_t indicator_indent = 0;
 5060|  1.92M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 1.90M, False: 18.6k]
  |  Branch (5060:56): [True: 586k, False: 1.31M]
  ------------------
 5061|   586k|                                    ++indicator_indent;
 5062|   586k|                                    ++scan;
 5063|   586k|                                 }
 5064|       |
 5065|  1.33M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 1.31M, False: 18.6k]
  |  Branch (5065:53): [True: 84.4k, False: 1.23M]
  ------------------
 5066|  84.4k|                                    const auto after_colon = scan + 1;
 5067|  84.4k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 989, False: 83.5k]
  ------------------
 5068|  83.5k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 69.9k, False: 13.5k]
  ------------------
 5069|  70.9k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 33.3k, False: 37.6k]
  ------------------
 5070|  33.3k|                                       key_node_end = line_start;
 5071|  33.3k|                                       break;
 5072|  33.3k|                                    }
 5073|  84.4k|                                 }
 5074|  1.33M|                              }
 5075|   131k|                           }
 5076|       |
 5077|   131k|                           glz::generic key_node{};
 5078|   131k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   131k|                           ctx.explicit_mapping_key_context = true;
 5080|   131k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   131k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   131k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 1.29k, False: 130k]
  ------------------
 5083|  1.29k|                              return false;
 5084|   130k|                           it = key_node_it;
 5085|   130k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 9, False: 130k]
  ------------------
 5086|      9|                              return false;
 5087|   130k|                        }
 5088|       |                     }
 5089|       |                     else {
 5090|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|       |                           if (bool(ctx.error)) [[unlikely]]
 5093|       |                              return false;
 5094|       |                        }
 5095|       |                     }
 5096|       |
 5097|   140k|                     yaml::skip_inline_ws(it, end);
 5098|   141k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   141k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 118k, False: 23.1k]
  |  Branch (5101:40): [True: 9.94k, False: 108k]
  |  Branch (5101:55): [True: 24.6k, False: 83.5k]
  ------------------
 5102|  34.6k|                        auto probe = it;
 5103|  34.6k|                        bool found_value_indicator = false;
 5104|       |
 5105|  48.9k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 43.8k, False: 5.16k]
  |  Branch (5105:49): [True: 13.6k, False: 30.2k]
  |  Branch (5105:67): [True: 30.2k, False: 1]
  ------------------
 5106|  43.8k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|  43.8k|                           auto value_line = probe;
 5109|  43.8k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|  43.8k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 2, False: 43.8k]
  ------------------
 5111|      2|                              return false;
 5112|       |
 5113|  43.8k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 4.85k, False: 38.9k]
  |  Branch (5113:53): [True: 2.04k, False: 36.9k]
  |  Branch (5113:76): [True: 3.89k, False: 33.0k]
  ------------------
 5114|  10.7k|                              probe = value_line;
 5115|  10.7k|                              continue; // blank line
 5116|  10.7k|                           }
 5117|  33.0k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 3.55k, False: 29.4k]
  ------------------
 5118|  3.55k|                              yaml::skip_comment(value_line, end);
 5119|  3.55k|                              probe = value_line;
 5120|  3.55k|                              continue; // comment-only line
 5121|  3.55k|                           }
 5122|  29.4k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 14.4k, False: 15.0k]
  |  Branch (5122:54): [True: 4.50k, False: 9.91k]
  ------------------
 5123|  4.50k|                              it = value_line;
 5124|  4.50k|                              found_value_indicator = true;
 5125|  4.50k|                           }
 5126|  29.4k|                           break;
 5127|  33.0k|                        }
 5128|       |
 5129|  34.6k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 4.50k, False: 30.1k]
  ------------------
 5130|  4.50k|                           yaml::skip_inline_ws(it, end);
 5131|  4.50k|                        }
 5132|  34.6k|                     }
 5133|       |
 5134|   141k|                     val_t val{};
 5135|   141k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 118k, False: 23.1k]
  |  Branch (5135:39): [True: 43.6k, False: 74.6k]
  ------------------
 5136|  43.6k|                        ++it;
 5137|  43.6k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 42.5k, False: 1.07k]
  |  Branch (5137:42): [True: 3, False: 42.5k]
  ------------------
 5138|      3|                           ctx.error = error_code::syntax_error;
 5139|      3|                           return false;
 5140|      3|                        }
 5141|  43.6k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 42.5k, False: 1.07k]
  |  Branch (5141:43): [True: 3.71k, False: 38.8k]
  |  Branch (5141:58): [True: 11.7k, False: 27.0k]
  ------------------
 5142|  15.4k|                           auto probe = it;
 5143|  15.4k|                           yaml::skip_newline(probe, end);
 5144|  29.8k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 27.9k, False: 1.87k]
  |  Branch (5144:51): [True: 14.3k, False: 13.5k]
  ------------------
 5145|  15.4k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 13.5k, False: 1.87k]
  |  Branch (5145:48): [True: 4.80k, False: 8.78k]
  |  Branch (5145:65): [True: 4.51k, False: 289]
  |  Branch (5145:89): [True: 2, False: 4.51k]
  ------------------
 5146|      2|                              ctx.error = error_code::syntax_error;
 5147|      2|                              return false;
 5148|      2|                           }
 5149|  15.4k|                        }
 5150|  43.6k|                        yaml::skip_inline_ws(it, end);
 5151|  43.6k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 234, False: 43.3k]
  ------------------
 5152|    234|                           return false;
 5153|  43.6k|                     }
 5154|       |
 5155|   141k|                     value.emplace(std::move(key), std::move(val));
 5156|   141k|                     return true;
 5157|   141k|                  }
 5158|       |
 5159|   234k|                  key_t key{};
 5160|   234k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   234k|                     auto key_probe = it;
 5162|   234k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   234k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 234k, False: 0]
  |  Branch (5163:74): [True: 1.28k, False: 233k]
  |  Branch (5163:95): [True: 959, False: 232k]
  ------------------
 5164|   234k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 2.24k, False: 232k]
  ------------------
 5165|  2.24k|                        glz::generic key_node{};
 5166|  2.24k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  2.24k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 757, False: 1.48k]
  ------------------
 5168|    757|                           return false;
 5169|  1.48k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 2, False: 1.48k]
  ------------------
 5170|      2|                           return false;
 5171|  1.48k|                     }
 5172|   232k|                     else {
 5173|   232k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 407, False: 231k]
  ------------------
 5174|    407|                           return false;
 5175|    407|                        }
 5176|   232k|                     }
 5177|       |                  }
 5178|       |                  else {
 5179|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|       |                     if (bool(ctx.error)) [[unlikely]]
 5181|       |                        return false;
 5182|       |                  }
 5183|       |
 5184|   233k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   234k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 1.33k, False: 233k]
  |  Branch (5186:36): [True: 183, False: 233k]
  ------------------
 5187|    348|                     ctx.error = error_code::syntax_error;
 5188|    348|                     return false;
 5189|    348|                  }
 5190|   234k|                  ++it;
 5191|   234k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   234k|                  val_t val{};
 5194|   234k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 8.10k, False: 226k]
  ------------------
 5195|  8.10k|                     return false;
 5196|       |
 5197|   226k|                  value.emplace(std::move(key), std::move(val));
 5198|   226k|                  return true;
 5199|   234k|               });
_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:
 5020|   141k|                        const bool key_content_spans_lines = [&] {
 5021|   141k|                           auto scan = key_it;
 5022|   151k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 107k, False: 44.4k]
  |  Branch (5022:54): [True: 107k, False: 0]
  ------------------
 5023|   107k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 66.9k, False: 40.5k]
  |  Branch (5023:52): [True: 30.0k, False: 10.5k]
  ------------------
 5024|  10.5k|                              ++scan;
 5025|  10.5k|                           }
 5026|  44.4k|                           return false;
 5027|   141k|                        }();
_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_:
 4963|   130k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   130k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   130k|                        };
_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_:
 4883|   276k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   276k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 271k, False: 4.80k]
  |  Branch (4884:39): [True: 200k, False: 71.5k]
  ------------------
 4885|   200k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   200k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   200k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 200k, False: 0]
  ------------------
 4893|   200k|                              auto is_line_content_start = [&](auto pos) {
 4894|   200k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   200k|                              };
 4896|       |
 4897|   200k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   200k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   200k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   200k|                                 return line != end && *line == ':';
 4901|   200k|                              };
 4902|       |
 4903|   200k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 200k, False: 0]
  ------------------
 4904|   200k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 15.0k, False: 185k]
  ------------------
 4905|  15.0k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 558, False: 14.5k]
  ------------------
 4906|    558|                                 ctx.error = error_code::syntax_error;
 4907|    558|                                 return false;
 4908|    558|                              }
 4909|   199k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   199k|                           }
 4911|   200k|                        }
 4912|       |
 4913|   200k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 4.95k, False: 195k]
  ------------------
 4914|  4.95k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 286, False: 4.66k]
  |  Branch (4914:49): [True: 601, False: 4.06k]
  ------------------
 4915|    887|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 13, False: 874]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     13|                           ctx.error = error_code::syntax_error;
 4918|     13|                           return false;
 4919|     13|                        }
 4920|       |
 4921|   200k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 200k]
  ------------------
 4922|      0|                           return false;
 4923|   200k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   200k|                        ctx.pop_indent();
 4925|   200k|                     }
 4926|  76.3k|                     else {
 4927|  76.3k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  76.3k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 23.8k, False: 52.5k]
  ------------------
 4929|  23.8k|                           yaml::skip_to_content(it, end);
 4930|  23.8k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 23.8k, False: 0]
  |  Branch (4930:45): [True: 0, False: 23.8k]
  |  Branch (4930:59): [True: 0, False: 0]
  |  Branch (4930:78): [True: 0, False: 0]
  ------------------
 4931|      0|                              ctx.error = error_code::syntax_error;
 4932|      0|                              return false;
 4933|      0|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  23.8k|                           const int32_t value_indent =
 4937|  23.8k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 23.8k]
  ------------------
 4938|  23.8k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 23.8k]
  ------------------
 4939|      0|                              return false;
 4940|  23.8k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  23.8k|                           ctx.pop_indent();
 4942|  23.8k|                        }
 4943|  76.3k|                     }
 4944|   276k|                     return !bool(ctx.error);
 4945|   276k|                  };
_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_:
 4893|   200k|                              auto is_line_content_start = [&](auto pos) {
 4894|   200k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   200k|                              };
_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_:
 4897|   214k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   214k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   407k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 407k, False: 0]
  |  Branch (4899:57): [True: 192k, False: 215k]
  |  Branch (4899:73): [True: 467, False: 214k]
  ------------------
 4900|   214k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 214k, False: 0]
  |  Branch (4900:56): [True: 128k, False: 86.2k]
  ------------------
 4901|   214k|                              };
_ZN3glz4yaml26detect_nested_value_indentINS0_12yaml_contextEPKcS4_EEiRT_RT0_T1_i:
 3496|  1.29M|      {
 3497|  1.29M|         skip_ws_and_comment(it, end);
 3498|  1.29M|         if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3498:14): [True: 125k, False: 1.16M]
  |  Branch (3498:28): [True: 632k, False: 536k]
  |  Branch (3498:43): [True: 158, False: 632k]
  ------------------
 3499|   125k|            return -1;
 3500|   125k|         }
 3501|  1.16M|         skip_newline(it, end);
 3502|  1.16M|         auto content_start = it;
 3503|       |
 3504|       |         // Peek ahead to find the first content line (skip blank/comment lines)
 3505|  1.16M|         auto peek = it;
 3506|  1.65M|         while (peek != end) {
  ------------------
  |  Branch (3506:17): [True: 1.54M, False: 113k]
  ------------------
 3507|  1.54M|            if (*peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3507:17): [True: 75.3k, False: 1.47M]
  |  Branch (3507:34): [True: 175k, False: 1.29M]
  ------------------
 3508|   251k|               skip_newline(peek, end);
 3509|   251k|            }
 3510|  1.29M|            else if (*peek == '#') {
  ------------------
  |  Branch (3510:22): [True: 77.1k, False: 1.21M]
  ------------------
 3511|  77.1k|               skip_comment(peek, end);
 3512|  77.1k|            }
 3513|  1.21M|            else if (*peek == ' ') {
  ------------------
  |  Branch (3513:22): [True: 733k, False: 483k]
  ------------------
 3514|   733k|               auto line_start = peek;
 3515|  3.86M|               while (peek != end && *peek == ' ') ++peek;
  ------------------
  |  Branch (3515:23): [True: 3.84M, False: 17.5k]
  |  Branch (3515:38): [True: 3.13M, False: 716k]
  ------------------
 3516|   733k|               if (peek == end || *peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3516:20): [True: 17.5k, False: 716k]
  |  Branch (3516:35): [True: 15.0k, False: 701k]
  |  Branch (3516:52): [True: 17.1k, False: 683k]
  ------------------
 3517|  49.7k|                  continue; // blank line with trailing spaces
 3518|  49.7k|               }
 3519|   683k|               if (*peek == '#') {
  ------------------
  |  Branch (3519:20): [True: 21.9k, False: 662k]
  ------------------
 3520|  21.9k|                  skip_comment(peek, end);
 3521|  21.9k|                  continue; // comment-only line
 3522|  21.9k|               }
 3523|       |               // YAML allows node properties to appear on standalone lines before the
 3524|       |               // actual node value, for example:
 3525|       |               //   key:
 3526|       |               //     !tag
 3527|       |               //     &anchor
 3528|       |               //     actual: value
 3529|       |               // This loop recognizes chains of properties (`!tag`, `&anchor`, optional
 3530|       |               // inline spaces/comments) and treats those lines as non-content so they do
 3531|       |               // not incorrectly define nested indentation.
 3532|   662k|               {
 3533|   662k|                  auto prop = peek;
 3534|   662k|                  bool saw_property = false;
 3535|   903k|                  while (prop != end) {
  ------------------
  |  Branch (3535:26): [True: 902k, False: 1.06k]
  ------------------
 3536|   902k|                     if (*prop == '!') {
  ------------------
  |  Branch (3536:26): [True: 21.0k, False: 881k]
  ------------------
 3537|  21.0k|                        const auto tag = parse_yaml_tag(prop, end, ctx);
 3538|  21.0k|                        if (tag == yaml_tag::unknown) break;
  ------------------
  |  Branch (3538:29): [True: 322, False: 20.6k]
  ------------------
 3539|  20.6k|                        saw_property = true;
 3540|  20.6k|                        skip_inline_ws(prop, end);
 3541|  20.6k|                        continue;
 3542|  21.0k|                     }
 3543|   881k|                     if (*prop == '&') {
  ------------------
  |  Branch (3543:26): [True: 221k, False: 659k]
  ------------------
 3544|   221k|                        ++prop;
 3545|   221k|                        auto aname = parse_anchor_name(prop, end);
 3546|   221k|                        if (aname.empty()) break;
  ------------------
  |  Branch (3546:29): [True: 1.08k, False: 220k]
  ------------------
 3547|   220k|                        saw_property = true;
 3548|   220k|                        skip_inline_ws(prop, end);
 3549|   220k|                        continue;
 3550|   221k|                     }
 3551|   659k|                     break;
 3552|   881k|                  }
 3553|   662k|                  if (saw_property) {
  ------------------
  |  Branch (3553:23): [True: 113k, False: 548k]
  ------------------
 3554|   113k|                     auto tail = prop;
 3555|   113k|                     skip_inline_ws(tail, end);
 3556|   113k|                     if (tail == end || *tail == '\n' || *tail == '\r' || *tail == '#') {
  ------------------
  |  Branch (3556:26): [True: 1.31k, False: 112k]
  |  Branch (3556:41): [True: 29.4k, False: 82.8k]
  |  Branch (3556:58): [True: 57.6k, False: 25.1k]
  |  Branch (3556:75): [True: 1.64k, False: 23.5k]
  ------------------
 3557|  90.0k|                        if (tail != end && *tail == '#') {
  ------------------
  |  Branch (3557:29): [True: 88.7k, False: 1.31k]
  |  Branch (3557:44): [True: 1.64k, False: 87.0k]
  ------------------
 3558|  1.64k|                           skip_comment(tail, end);
 3559|  1.64k|                        }
 3560|  90.0k|                        if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (3560:29): [True: 88.4k, False: 1.53k]
  |  Branch (3560:45): [True: 29.7k, False: 58.7k]
  |  Branch (3560:62): [True: 58.3k, False: 424]
  ------------------
 3561|  88.0k|                           skip_newline(tail, end);
 3562|  88.0k|                        }
 3563|  90.0k|                        peek = tail;
 3564|  90.0k|                        continue;
 3565|  90.0k|                     }
 3566|   113k|                  }
 3567|   662k|               }
 3568|   572k|               peek = line_start; // content found, restore to measure properly
 3569|   572k|               break;
 3570|   662k|            }
 3571|   483k|            else {
 3572|   483k|               break; // content at column 0
 3573|   483k|            }
 3574|  1.54M|         }
 3575|       |
 3576|       |         // Measure indent of the content line
 3577|  1.16M|         int32_t content_indent = measure_indent<false>(peek, end, ctx);
 3578|  1.16M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3578:14): [True: 232, False: 1.16M]
  ------------------
 3579|    232|            return -1;
 3580|       |
 3581|       |         // Tabs in indentation-like positions are only allowed when they are plain
 3582|       |         // scalar content. Structural lines (mapping keys/entries) remain errors.
 3583|  1.16M|         if (peek != end && *peek == '\t') {
  ------------------
  |  Branch (3583:14): [True: 1.05M, False: 113k]
  |  Branch (3583:29): [True: 13.6k, False: 1.04M]
  ------------------
 3584|  13.6k|            auto probe = peek;
 3585|  49.8k|            while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (3585:20): [True: 49.5k, False: 294]
  |  Branch (3585:37): [True: 4.68k, False: 44.8k]
  |  Branch (3585:54): [True: 31.4k, False: 13.3k]
  ------------------
 3586|  13.6k|            if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (3586:17): [True: 13.3k, False: 294]
  |  Branch (3586:33): [True: 12.7k, False: 674]
  |  Branch (3586:51): [True: 10.5k, False: 2.14k]
  |  Branch (3586:69): [True: 5.29k, False: 5.27k]
  ------------------
 3587|  5.29k|               const bool looks_sequence_entry =
 3588|  5.29k|                  (*probe == '-') &&
  ------------------
  |  Branch (3588:19): [True: 318, False: 4.97k]
  ------------------
 3589|    318|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3589:20): [True: 6, False: 312]
  |  Branch (3589:42): [True: 4, False: 308]
  ------------------
 3590|  5.29k|               const bool looks_explicit_entry =
 3591|  5.29k|                  (*probe == '?' || *probe == ':') &&
  ------------------
  |  Branch (3591:20): [True: 324, False: 4.96k]
  |  Branch (3591:37): [True: 506, False: 4.46k]
  ------------------
 3592|    830|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3592:20): [True: 24, False: 806]
  |  Branch (3592:42): [True: 8, False: 798]
  ------------------
 3593|  5.29k|               bool looks_mapping_key = false;
 3594|  5.29k|               auto scan = probe;
 3595|   506k|               while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (3595:23): [True: 504k, False: 2.09k]
  |  Branch (3595:38): [True: 503k, False: 956]
  |  Branch (3595:55): [True: 501k, False: 2.12k]
  ------------------
 3596|   501k|                  if (*scan == ':') {
  ------------------
  |  Branch (3596:23): [True: 1.05k, False: 500k]
  ------------------
 3597|  1.05k|                     const auto after = scan + 1;
 3598|  1.05k|                     if (after == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after)]) {
  ------------------
  |  Branch (3598:26): [True: 88, False: 962]
  |  Branch (3598:42): [True: 28, False: 934]
  ------------------
 3599|    116|                        looks_mapping_key = true;
 3600|    116|                        break;
 3601|    116|                     }
 3602|  1.05k|                  }
 3603|   501k|                  ++scan;
 3604|   501k|               }
 3605|  5.29k|               if (looks_sequence_entry || looks_explicit_entry || looks_mapping_key) {
  ------------------
  |  Branch (3605:20): [True: 10, False: 5.28k]
  |  Branch (3605:44): [True: 32, False: 5.24k]
  |  Branch (3605:68): [True: 82, False: 5.16k]
  ------------------
 3606|    124|                  ctx.error = error_code::syntax_error;
 3607|    124|                  return -1;
 3608|    124|               }
 3609|  5.29k|            }
 3610|  13.6k|         }
 3611|       |
 3612|  1.16M|         const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3612:48): [True: 0, False: 1.16M]
  ------------------
 3613|  1.16M|         if (content_indent > effective_line_indent && peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (3613:14): [True: 397k, False: 771k]
  |  Branch (3613:56): [True: 397k, False: 0]
  |  Branch (3613:71): [True: 397k, False: 0]
  |  Branch (3613:88): [True: 397k, False: 0]
  ------------------
 3614|   397k|            it = content_start;
 3615|   397k|            return content_indent;
 3616|   397k|         }
 3617|       |
 3618|       |         // YAML allows "indentless sequences" as mapping values:
 3619|       |         // key:
 3620|       |         // - item
 3621|   771k|         if (content_indent == effective_line_indent && peek != end && *peek == '-') {
  ------------------
  |  Branch (3621:14): [True: 520k, False: 251k]
  |  Branch (3621:57): [True: 461k, False: 59.3k]
  |  Branch (3621:72): [True: 16.3k, False: 444k]
  ------------------
 3622|  16.3k|            const auto after_dash = peek + 1;
 3623|  16.3k|            if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3623:17): [True: 182, False: 16.1k]
  |  Branch (3623:38): [True: 12.8k, False: 3.24k]
  ------------------
 3624|  13.0k|               it = content_start;
 3625|  13.0k|               return content_indent;
 3626|  13.0k|            }
 3627|  16.3k|         }
 3628|       |
 3629|   758k|         it = content_start;
 3630|   758k|         return -1;
 3631|   771k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|   680k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   680k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 680k]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|   680k|            }
_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_:
 5310|   108k|      {
 5311|   108k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   108k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   108k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   108k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   108k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 108k, False: 0]
  ------------------
 5321|   108k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   108k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|   111k|      {
 4183|   111k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 111k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   111k|         auto peek = it;
 4188|   111k|         yaml::node_preamble_state preamble{};
 4189|   111k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 5.48k, False: 106k]
  ------------------
 4190|   111k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  5.48k|            it = peek;
 4192|  5.48k|            return;
 4193|  5.48k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   106k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   106k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 10, False: 106k]
  ------------------
 4198|     10|            return;
 4199|       |
 4200|   106k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 41.4k, False: 64.9k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  41.4k|            it = peek;
 4203|  41.4k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  41.4k|         }
 4205|  64.9k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 64.8k, False: 84]
  ------------------
 4206|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4207|       |            // But if there was a tag, we need to advance past it
 4208|  64.8k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 287, False: 64.5k]
  |  Branch (4208:57): [True: 2.15k, False: 62.4k]
  ------------------
 4209|  2.44k|               it = peek;
 4210|  2.44k|            }
 4211|  64.8k|            int32_t seq_indent = ctx.current_indent();
 4212|  64.8k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 64.6k, False: 226]
  |  Branch (4212:31): [True: 35.9k, False: 28.7k]
  ------------------
 4213|  35.9k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 11.9k, False: 24.0k]
  |  Branch (4213:62): [True: 11.2k, False: 674]
  ------------------
 4214|  35.9k|                                                          : (ctx.current_indent() + 1);
 4215|  35.9k|            }
 4216|  64.8k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|  64.8k|         }
 4218|     84|         else {
 4219|     84|            ctx.error = error_code::syntax_error;
 4220|     84|         }
 4221|       |
 4222|   106k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   106k|      }
_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|   111k|      {
  466|   111k|         skip_inline_ws(it, end);
  467|       |
  468|   111k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 111k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|   111k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   111k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 111k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   111k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 111k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   111k|         skip_inline_ws(it, end);
  486|       |
  487|   111k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 111k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   111k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.46k, False: 106k]
  ------------------
  495|  5.46k|            return true;
  496|  5.46k|         }
  497|       |
  498|   106k|         return false;
  499|   111k|      }
_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_:
 4190|   111k|                                             [](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|   111k|      {
  409|   111k|         state.has_anchor = false;
  410|   111k|         state.anchor_name.clear();
  411|   111k|         state.anchor_start = nullptr;
  412|   111k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   111k|         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|   111k|            else {
  421|   111k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.43k, False: 106k]
  ------------------
  422|   111k|            }
  423|   111k|         }
  424|       |
  425|   111k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 106k, False: 5.43k]
  |  Branch (425:27): [True: 3.05k, False: 103k]
  ------------------
  426|  3.05k|            ++it;
  427|  3.05k|            auto name = parse_anchor_name(it, end);
  428|  3.05k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 7, False: 3.04k]
  ------------------
  429|      7|               ctx.error = error_code::syntax_error;
  430|      7|               return true;
  431|      7|            }
  432|  3.04k|            skip_inline_ws(it, end);
  433|  3.04k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 25, False: 3.02k]
  ------------------
  434|     25|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     25|                  ctx.error = error_code::unexpected_end;
  436|     25|               }
  437|     25|               return true;
  438|     25|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.02k|            state.has_anchor = true;
  446|  3.02k|            state.anchor_name = std::string(name);
  447|  3.02k|            state.anchor_start = &*it;
  448|  3.02k|         }
  449|       |
  450|   111k|         return false;
  451|   111k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   111k|      {
  301|   111k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 111k]
  |  Branch (301:27): [True: 106k, False: 5.43k]
  ------------------
  302|       |
  303|  5.43k|         ++it; // skip '*'
  304|  5.43k|         auto name = parse_anchor_name(it, end);
  305|  5.43k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 5.42k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  5.42k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.42k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 21, False: 5.40k]
  ------------------
  312|     21|            ctx.error = error_code::syntax_error; // undefined alias
  313|     21|            return true;
  314|     21|         }
  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.40k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.40k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.56k, False: 3.84k]
  ------------------
  322|  1.56k|            return true;
  323|  1.56k|         }
  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.84k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 3.83k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  3.83k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.83k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 3.83k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  3.83k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.83k]
  ------------------
  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.83k|         auto replay_it = span.begin;
  348|  3.83k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.83k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.83k|         ctx.indent_stack.clear();
  353|  3.83k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.33k, False: 2.49k]
  ------------------
  354|  1.33k|            ctx.push_indent(span.base_indent - 1);
  355|  1.33k|         }
  356|       |
  357|  3.83k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.83k|         using V = std::remove_cvref_t<T>;
  360|  3.83k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.83k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.83k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.83k|         return true;
  367|  3.83k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  41.4k|      {
 2665|  41.4k|         using V = std::remove_cvref_t<T>;
 2666|  41.4k|         using value_type = typename V::value_type;
 2667|       |
 2668|  41.4k|         struct sequence_container_adapter
 2669|  41.4k|         {
 2670|  41.4k|            size_t index = 0;
 2671|       |
 2672|  41.4k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  41.4k|            {
 2674|  41.4k|               if constexpr (!resizable<V>) {
 2675|  41.4k|                  return index >= container.size();
 2676|  41.4k|               }
 2677|  41.4k|               else {
 2678|  41.4k|                  (void)container;
 2679|  41.4k|                  return false;
 2680|  41.4k|               }
 2681|  41.4k|            }
 2682|       |
 2683|  41.4k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  41.4k|            inline void append(V& container, value_type&& element) noexcept
 2686|  41.4k|            {
 2687|  41.4k|               if constexpr (emplace_backable<V>) {
 2688|  41.4k|                  container.emplace_back(std::move(element));
 2689|  41.4k|               }
 2690|  41.4k|               else if constexpr (emplaceable<V>) {
 2691|  41.4k|                  container.emplace(std::move(element));
 2692|  41.4k|               }
 2693|  41.4k|            }
 2694|  41.4k|         };
 2695|       |
 2696|  41.4k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 41.4k]
  |  Branch (2696:27): [True: 0, False: 41.4k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  41.4k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  41.4k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  41.4k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  41.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 13, False: 41.4k]
  ------------------
 2709|     13|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  41.4k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 40.3k, False: 1.06k]
  |  Branch (2712:27): [True: 8.25k, False: 32.1k]
  ------------------
 2713|  8.25k|            ++it;
 2714|  8.25k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  8.25k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 23, False: 8.23k]
  ------------------
 2716|     23|               return;
 2717|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|       |               if (ctx.current_indent() < 0) {
 2719|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|       |               }
 2721|       |            }
 2722|  8.23k|            return;
 2723|  8.25k|         }
 2724|       |
 2725|  33.1k|         bool just_saw_comma = false;
 2726|  33.1k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  33.1k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  60.5k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 59.3k, False: 1.18k]
  ------------------
 2731|  59.3k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  59.3k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 59.3k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  59.3k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 59.3k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  59.3k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 6.19k, False: 53.1k]
  ------------------
 2741|  6.19k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 6.19k, False: 0]
  ------------------
 2742|  6.19k|                     ++it;
 2743|  6.19k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  6.19k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 4, False: 6.19k]
  ------------------
 2745|      4|                        return;
 2746|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|       |                        if (ctx.current_indent() < 0) {
 2748|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|       |                        }
 2750|       |                     }
 2751|  6.19k|                     return;
 2752|  6.19k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  6.19k|               }
 2756|       |
 2757|  53.1k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 39, False: 53.1k]
  |  Branch (2757:34): [True: 19, False: 53.1k]
  ------------------
 2758|     58|                  ctx.error = error_code::syntax_error;
 2759|     58|                  return;
 2760|     58|               }
 2761|  53.1k|               just_saw_comma = false;
 2762|       |
 2763|  53.1k|               value_type element{};
 2764|  53.1k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  53.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 7.94k, False: 45.1k]
  ------------------
 2767|  7.94k|                  return;
 2768|       |
 2769|  45.1k|               bool saw_line_break_before_separator = false;
 2770|  45.1k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  45.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 15, False: 45.1k]
  ------------------
 2772|     15|                  return;
 2773|       |
 2774|  45.1k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 44.2k, False: 931]
  |  Branch (2774:33): [True: 7.38k, False: 36.8k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  7.38k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 13, False: 7.37k]
  ------------------
 2777|     13|                     ctx.error = error_code::syntax_error;
 2778|     13|                     return;
 2779|     13|                  }
 2780|  7.37k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  7.37k|                     glz::generic key_node = std::move(element);
 2782|  7.37k|                     ++it;
 2783|  7.37k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  7.37k|                     glz::generic mapped{};
 2786|  7.37k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  7.37k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 659, False: 6.71k]
  ------------------
 2788|    659|                        return;
 2789|       |
 2790|  6.71k|                     std::string key;
 2791|  6.71k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 2, False: 6.71k]
  ------------------
 2792|      2|                        return;
 2793|       |
 2794|  6.71k|                     glz::generic pair{};
 2795|  6.71k|                     pair[key] = std::move(mapped);
 2796|  6.71k|                     element = std::move(pair);
 2797|       |
 2798|  6.71k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  6.71k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 0, False: 6.71k]
  ------------------
 2800|      0|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  7.37k|               }
 2807|       |
 2808|  45.1k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  45.1k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 965, False: 44.1k]
  ------------------
 2811|    965|                  ctx.error = error_code::unexpected_end;
 2812|    965|                  return;
 2813|    965|               }
 2814|       |
 2815|  44.1k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 15.6k, False: 28.5k]
  ------------------
 2816|  15.6k|                  ++it;
 2817|  15.6k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  15.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 16, False: 15.6k]
  ------------------
 2819|     16|                     return;
 2820|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|       |                     if (ctx.current_indent() < 0) {
 2822|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|       |                     }
 2824|       |                  }
 2825|  15.6k|                  return;
 2826|  15.6k|               }
 2827|  28.5k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 27.4k, False: 1.13k]
  ------------------
 2828|  27.4k|                  ++it;
 2829|  27.4k|                  just_saw_comma = true;
 2830|  27.4k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  27.4k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 11, False: 27.4k]
  ------------------
 2832|     11|                     return;
 2833|  27.4k|               }
 2834|  1.13k|               else {
 2835|  1.13k|                  ctx.error = error_code::syntax_error;
 2836|  1.13k|                  return;
 2837|  1.13k|               }
 2838|  44.1k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  33.1k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   106k|      {
 2649|   106k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   106k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   106k|               value.clear();
 2653|   106k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   106k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  44.5k|            {
 2687|  44.5k|               if constexpr (emplace_backable<V>) {
 2688|  44.5k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  44.5k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|  64.8k|      {
 3160|  64.8k|         using V = std::remove_cvref_t<T>;
 3161|  64.8k|         using value_type = typename V::value_type;
 3162|       |
 3163|  64.8k|         struct sequence_container_adapter
 3164|  64.8k|         {
 3165|  64.8k|            size_t index = 0;
 3166|       |
 3167|  64.8k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|  64.8k|            {
 3169|  64.8k|               if constexpr (!resizable<V>) {
 3170|  64.8k|                  return index >= container.size();
 3171|  64.8k|               }
 3172|  64.8k|               else {
 3173|  64.8k|                  (void)container;
 3174|  64.8k|                  return false;
 3175|  64.8k|               }
 3176|  64.8k|            }
 3177|       |
 3178|  64.8k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|  64.8k|            inline void append(V& container, value_type&& element) noexcept
 3181|  64.8k|            {
 3182|  64.8k|               if constexpr (emplace_backable<V>) {
 3183|  64.8k|                  container.emplace_back(std::move(element));
 3184|  64.8k|               }
 3185|  64.8k|               else if constexpr (emplaceable<V>) {
 3186|  64.8k|                  container.emplace(std::move(element));
 3187|  64.8k|               }
 3188|  64.8k|            }
 3189|  64.8k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|  64.8k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|  64.8k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|  64.8k|         bool first_item = true;
 3200|  64.8k|         bool has_pending_item_anchor = false;
 3201|  64.8k|         std::string pending_item_anchor_name{};
 3202|  64.8k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   174k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 156k, False: 18.3k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   156k|            int32_t line_indent = 0;
 3215|   156k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   156k|            auto line_start = it;
 3217|       |
 3218|   203k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 196k, False: 7.85k]
  ------------------
 3219|   196k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 8.44k, False: 187k]
  ------------------
 3220|  8.44k|                  skip_comment(it, end);
 3221|  8.44k|                  skip_newline(it, end);
 3222|  8.44k|                  line_start = it;
 3223|  8.44k|                  line_indent = 0;
 3224|  8.44k|               }
 3225|   187k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 9.29k, False: 178k]
  |  Branch (3225:40): [True: 22.2k, False: 156k]
  ------------------
 3226|  31.5k|                  skip_newline(it, end);
 3227|  31.5k|                  line_start = it;
 3228|  31.5k|                  line_indent = 0;
 3229|  31.5k|               }
 3230|   156k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 13.7k, False: 142k]
  ------------------
 3231|  13.7k|                  line_start = it;
 3232|  13.7k|                  line_indent = 0;
 3233|   212k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 210k, False: 1.64k]
  |  Branch (3233:39): [True: 198k, False: 12.1k]
  ------------------
 3234|   198k|                     ++line_indent;
 3235|   198k|                     ++it;
 3236|   198k|                  }
 3237|       |
 3238|  13.7k|                  bool saw_tab = false;
 3239|  15.5k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 13.6k, False: 1.89k]
  |  Branch (3239:40): [True: 768, False: 12.9k]
  |  Branch (3239:54): [True: 1.03k, False: 11.8k]
  ------------------
 3240|  1.80k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 992, False: 810]
  |  Branch (3240:43): [True: 810, False: 0]
  ------------------
 3241|  1.80k|                     ++it;
 3242|  1.80k|                  }
 3243|       |
 3244|  13.7k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 1.89k, False: 11.8k]
  |  Branch (3244:36): [True: 701, False: 11.1k]
  |  Branch (3244:51): [True: 943, False: 10.2k]
  |  Branch (3244:66): [True: 1.51k, False: 8.72k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  5.05k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 3.15k, False: 1.89k]
  |  Branch (3246:39): [True: 1.51k, False: 1.64k]
  ------------------
 3247|  1.51k|                        skip_comment(it, end);
 3248|  1.51k|                     }
 3249|  5.05k|                     line_indent = 0;
 3250|  5.05k|                     continue;
 3251|  5.05k|                  }
 3252|       |
 3253|  8.72k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 11, False: 8.71k]
  ------------------
 3254|     11|                     ctx.error = error_code::syntax_error;
 3255|     11|                     return;
 3256|     11|                  }
 3257|  8.71k|                  break; // Found content
 3258|  8.72k|               }
 3259|   142k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 2.44k, False: 139k]
  ------------------
 3260|  2.44k|                  line_start = it;
 3261|  6.82k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 6.52k, False: 297]
  |  Branch (3261:40): [True: 1.09k, False: 5.42k]
  |  Branch (3261:54): [True: 3.28k, False: 2.14k]
  ------------------
 3262|  2.44k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 297, False: 2.14k]
  |  Branch (3262:36): [True: 757, False: 1.38k]
  |  Branch (3262:51): [True: 316, False: 1.07k]
  |  Branch (3262:66): [True: 1.05k, False: 13]
  ------------------
 3263|  2.42k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 2.13k, False: 297]
  |  Branch (3263:39): [True: 1.05k, False: 1.07k]
  ------------------
 3264|  1.05k|                        skip_comment(it, end);
 3265|  1.05k|                     }
 3266|  2.42k|                     line_indent = 0;
 3267|  2.42k|                     continue;
 3268|  2.42k|                  }
 3269|     13|                  ctx.error = error_code::syntax_error;
 3270|     13|                  return;
 3271|  2.44k|               }
 3272|   139k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   139k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 64.8k, False: 75.0k]
  |  Branch (3276:37): [True: 64.6k, False: 225]
  ------------------
 3277|  64.6k|                     line_indent = sequence_indent;
 3278|  64.6k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  64.6k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 64.6k, False: 0]
  |  Branch (3279:49): [True: 64.6k, False: 0]
  ------------------
 3280|  64.6k|                           auto probe = it;
 3281|  64.6k|                           int32_t leading_ws = 0;
 3282|  64.6k|                           bool saw_tab = false;
 3283|   161k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 161k, False: 0]
  |  Branch (3283:64): [True: 90.7k, False: 70.9k]
  |  Branch (3283:87): [True: 6.27k, False: 64.6k]
  ------------------
 3284|  96.9k|                              --probe;
 3285|  96.9k|                              ++leading_ws;
 3286|  96.9k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 2.93k, False: 94.0k]
  |  Branch (3286:52): [True: 4.57k, False: 89.4k]
  ------------------
 3287|  96.9k|                           }
 3288|  64.6k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 64.6k]
  |  Branch (3288:61): [True: 3.58k, False: 61.0k]
  |  Branch (3288:85): [True: 21.3k, False: 39.7k]
  ------------------
 3289|  24.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 2, False: 24.8k]
  ------------------
 3290|      2|                                 ctx.error = error_code::syntax_error;
 3291|      2|                                 return;
 3292|      2|                              }
 3293|  24.8k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  24.8k|                           }
 3295|  64.6k|                        }
 3296|  64.6k|                     }
 3297|  64.6k|                  }
 3298|  64.6k|                  break;
 3299|   139k|               }
 3300|   196k|            }
 3301|       |
 3302|   156k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 7.85k, False: 148k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   148k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 2.42k, False: 146k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   146k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 14.6k, False: 131k]
  ------------------
 3309|  14.6k|               it = line_start;
 3310|  14.6k|               return;
 3311|  14.6k|            }
 3312|       |
 3313|   131k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 5.43k, False: 126k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  5.43k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 2, False: 5.42k]
  ------------------
 3318|      2|                  ctx.error = error_code::syntax_error;
 3319|      2|                  return;
 3320|      2|               }
 3321|       |
 3322|  5.42k|               ++it;
 3323|  5.42k|               auto pending_name = parse_anchor_name(it, end);
 3324|  5.42k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 9, False: 5.41k]
  ------------------
 3325|      9|                  ctx.error = error_code::syntax_error;
 3326|      9|                  return;
 3327|      9|               }
 3328|  5.41k|               skip_inline_ws(it, end);
 3329|  5.41k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 5.38k, False: 33]
  |  Branch (3329:33): [True: 746, False: 4.64k]
  ------------------
 3330|    746|                  skip_comment(it, end);
 3331|    746|               }
 3332|       |
 3333|  5.41k|               has_pending_item_anchor = true;
 3334|  5.41k|               pending_item_anchor_name = std::string(pending_name);
 3335|  5.41k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  5.41k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 42, False: 5.37k]
  |  Branch (3337:34): [True: 3.44k, False: 1.93k]
  |  Branch (3337:49): [True: 40, False: 3.40k]
  ------------------
 3338|     82|                  ctx.error = error_code::syntax_error;
 3339|     82|                  return;
 3340|     82|               }
 3341|       |
 3342|  5.33k|               skip_newline(it, end);
 3343|  5.33k|               continue;
 3344|  5.41k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   126k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 18.5k, False: 107k]
  ------------------
 3348|  18.5k|               it = line_start;
 3349|  18.5k|               return;
 3350|  18.5k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   107k|            dash_col = line_indent;
 3356|   107k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   107k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 107k, False: 2]
  ------------------
 3358|   107k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   107k|               }
 3360|   107k|            }
 3361|       |
 3362|   107k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   107k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 103k, False: 4.47k]
  |  Branch (3365:30): [True: 2.39k, False: 100k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  2.39k|               it = line_start;
 3368|  2.39k|               return;
 3369|  2.39k|            }
 3370|       |
 3371|   105k|            bool saw_tab_after_dash = false;
 3372|   179k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 173k, False: 5.73k]
  |  Branch (3372:34): [True: 53.4k, False: 120k]
  |  Branch (3372:48): [True: 20.9k, False: 99.5k]
  ------------------
 3373|  74.3k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 1.42k, False: 72.9k]
  |  Branch (3373:59): [True: 20.4k, False: 52.4k]
  ------------------
 3374|  74.3k|               ++it;
 3375|  74.3k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   105k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 20.4k, False: 84.8k]
  |  Branch (3377:39): [True: 20.0k, False: 345]
  |  Branch (3377:52): [True: 342, False: 19.7k]
  ------------------
 3378|    342|               const auto after_dash = it + 1;
 3379|    342|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 3, False: 339]
  |  Branch (3379:41): [True: 2, False: 337]
  ------------------
 3380|      5|                  ctx.error = error_code::syntax_error;
 3381|      5|                  return;
 3382|      5|               }
 3383|    342|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   105k|            auto parse_element = [&](auto& element) {
 3387|   105k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   105k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   105k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   105k|                     return;
 3397|   105k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   105k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   105k|                  ctx.sequence_item_value_context = true;
 3400|   105k|                  ctx.sequence_dash_indent = dash_col;
 3401|   105k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   105k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   105k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   105k|                  ctx.pop_indent();
 3405|   105k|               }
 3406|   105k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   105k|                  skip_ws_and_comment(it, end);
 3409|   105k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   105k|                  auto nested_start = it;
 3413|   105k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   105k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   105k|                     return;
 3416|   105k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   105k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   105k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   105k|                     const int32_t element_indent =
 3428|   105k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   105k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   105k|                        return;
 3431|   105k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   105k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   105k|                     ctx.sequence_item_value_context = true;
 3434|   105k|                     ctx.sequence_dash_indent = dash_col;
 3435|   105k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   105k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   105k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   105k|                     ctx.pop_indent();
 3439|   105k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   105k|               }
 3442|       |
 3443|   105k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   105k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   105k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   105k|                                                                      pending_item_anchor_indent};
 3447|   105k|                  has_pending_item_anchor = false;
 3448|   105k|               }
 3449|   105k|            };
 3450|       |
 3451|   105k|            if constexpr (emplace_backable<V>) {
 3452|   105k|               auto& element = value.emplace_back();
 3453|   105k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   105k|            first_item = false;
 3472|       |
 3473|   105k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 598, False: 104k]
  ------------------
 3474|    598|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   105k|         }
 3479|  64.8k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   105k|            auto parse_element = [&](auto& element) {
 3387|   105k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 99.5k, False: 5.73k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   105k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 99.5k, False: 5.73k]
  |  Branch (3390:33): [True: 50.1k, False: 49.3k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|  50.1k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 50.1k]
  ------------------
 3396|      0|                     return;
 3397|  50.1k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|  50.1k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|  50.1k|                  ctx.sequence_item_value_context = true;
 3400|  50.1k|                  ctx.sequence_dash_indent = dash_col;
 3401|  50.1k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|  50.1k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|  50.1k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|  50.1k|                  ctx.pop_indent();
 3405|  50.1k|               }
 3406|  55.0k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  55.0k|                  skip_ws_and_comment(it, end);
 3409|  55.0k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  55.0k|                  auto nested_start = it;
 3413|  55.0k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  55.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 4, False: 55.0k]
  ------------------
 3415|      4|                     return;
 3416|  55.0k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|  55.0k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 4.60k, False: 50.4k]
  ------------------
 3422|  55.0k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 5.20k, False: 49.8k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  5.20k|                     const int32_t element_indent =
 3428|  5.20k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 5.20k]
  ------------------
 3429|  5.20k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 5.20k]
  ------------------
 3430|      0|                        return;
 3431|  5.20k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  5.20k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  5.20k|                     ctx.sequence_item_value_context = true;
 3434|  5.20k|                     ctx.sequence_dash_indent = dash_col;
 3435|  5.20k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  5.20k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  5.20k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  5.20k|                     ctx.pop_indent();
 3439|  5.20k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  55.0k|               }
 3442|       |
 3443|   105k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 2.22k, False: 103k]
  |  Branch (3443:47): [True: 2.09k, False: 136]
  ------------------
 3444|  2.09k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 1.75k, False: 340]
  ------------------
 3445|  2.09k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  2.09k|                                                                      pending_item_anchor_indent};
 3447|  2.09k|                  has_pending_item_anchor = false;
 3448|  2.09k|               }
 3449|   105k|            };
_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_:
 5530|   359k|   {
 5531|   359k|      if constexpr (yaml::check_flow_context(Opts)) {
 5532|       |         // In flow context, only treat plain content as an implicit "key: value"
 5533|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5534|   359k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|   359k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|   359k|            bool at_node_start = true;
 5542|   359k|            int depth = 0;
 5543|   359k|            while (pos != stop) {
 5544|   359k|               const char c = *pos;
 5545|   359k|               if (c == ' ' || c == '\t') {
 5546|   359k|                  ++pos;
 5547|   359k|                  continue;
 5548|   359k|               }
 5549|   359k|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|   359k|               if ((c == '"' || c == '\'') && node_start) {
 5552|   359k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|   359k|                  continue;
 5554|   359k|               }
 5555|   359k|               if (c == '[' || c == '{') {
 5556|   359k|                  ++depth;
 5557|   359k|                  at_node_start = true;
 5558|   359k|                  ++pos;
 5559|   359k|                  continue;
 5560|   359k|               }
 5561|   359k|               if (c == ']' || c == '}') {
 5562|   359k|                  if (depth == 0) return false;
 5563|   359k|                  --depth;
 5564|   359k|                  ++pos;
 5565|   359k|                  continue;
 5566|   359k|               }
 5567|   359k|               if (c == ',' && depth == 0) return false;
 5568|   359k|               if (c == ':' && depth == 0) {
 5569|   359k|                  auto next = pos + 1;
 5570|   359k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|   359k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|   359k|               if (c == ',' || c == ':') {
 5574|   359k|                  at_node_start = true;
 5575|   359k|                  ++pos;
 5576|   359k|                  continue;
 5577|   359k|               }
 5578|   359k|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|   359k|                  at_node_start = true;
 5580|   359k|                  continue;
 5581|   359k|               }
 5582|   359k|               ++pos;
 5583|   359k|            }
 5584|   359k|            return false;
 5585|   359k|         };
 5586|       |
 5587|   359k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5587:14): [True: 150k, False: 209k]
  |  Branch (5587:49): [True: 4.58k, False: 205k]
  ------------------
 5588|   154k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5588:17): [True: 132k, False: 22.0k]
  ------------------
 5589|   132k|               return;
 5590|   132k|            }
 5591|  22.0k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5591:17): [True: 3.86k, False: 18.1k]
  ------------------
 5592|  3.86k|               return;
 5593|  3.86k|            }
 5594|  22.0k|         }
 5595|       |
 5596|   223k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|   223k|         return;
 5598|   359k|      }
 5599|       |
 5600|   359k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 0, False: 359k]
  ------------------
 5601|      0|         return;
 5602|      0|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|   359k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 0, False: 359k]
  ------------------
 5605|      0|         return;
 5606|      0|      }
 5607|   359k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   359k|   }
_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_:
 5534|   359k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|   359k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|   359k|            bool at_node_start = true;
 5542|   359k|            int depth = 0;
 5543|  6.23M|            while (pos != stop) {
  ------------------
  |  Branch (5543:20): [True: 6.19M, False: 41.6k]
  ------------------
 5544|  6.19M|               const char c = *pos;
 5545|  6.19M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5545:20): [True: 691k, False: 5.50M]
  |  Branch (5545:32): [True: 96.8k, False: 5.40M]
  ------------------
 5546|   788k|                  ++pos;
 5547|   788k|                  continue;
 5548|   788k|               }
 5549|  5.40M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  5.40M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5551:21): [True: 59.6k, False: 5.34M]
  |  Branch (5551:33): [True: 24.5k, False: 5.32M]
  |  Branch (5551:47): [True: 50.5k, False: 33.6k]
  ------------------
 5552|  50.5k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5552:23): [True: 5.97k, False: 44.5k]
  ------------------
 5553|  44.5k|                  continue;
 5554|  50.5k|               }
 5555|  5.35M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5555:20): [True: 301k, False: 5.05M]
  |  Branch (5555:32): [True: 55.6k, False: 4.99M]
  ------------------
 5556|   357k|                  ++depth;
 5557|   357k|                  at_node_start = true;
 5558|   357k|                  ++pos;
 5559|   357k|                  continue;
 5560|   357k|               }
 5561|  4.99M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5561:20): [True: 46.3k, False: 4.95M]
  |  Branch (5561:32): [True: 48.5k, False: 4.90M]
  ------------------
 5562|  94.8k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5562:23): [True: 37.4k, False: 57.4k]
  ------------------
 5563|  57.4k|                  --depth;
 5564|  57.4k|                  ++pos;
 5565|  57.4k|                  continue;
 5566|  94.8k|               }
 5567|  4.90M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5567:20): [True: 329k, False: 4.57M]
  |  Branch (5567:32): [True: 93.6k, False: 235k]
  ------------------
 5568|  4.81M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5568:20): [True: 301k, False: 4.50M]
  |  Branch (5568:32): [True: 181k, False: 120k]
  ------------------
 5569|   181k|                  auto next = pos + 1;
 5570|   181k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5570:26): [True: 2.28k, False: 178k]
  |  Branch (5570:41): [True: 107k, False: 71.3k]
  |  Branch (5570:57): [True: 10.9k, False: 60.3k]
  |  Branch (5570:74): [True: 9.74k, False: 50.5k]
  |  Branch (5570:91): [True: 19.4k, False: 31.1k]
  ------------------
 5571|   181k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  4.62M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5573:20): [True: 235k, False: 4.39M]
  |  Branch (5573:32): [True: 120k, False: 4.27M]
  ------------------
 5574|   355k|                  at_node_start = true;
 5575|   355k|                  ++pos;
 5576|   355k|                  continue;
 5577|   355k|               }
 5578|  4.27M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5578:20): [True: 720k, False: 3.55M]
  |  Branch (5578:34): [True: 57.8k, False: 663k]
  ------------------
 5579|  57.8k|                  at_node_start = true;
 5580|  57.8k|                  continue;
 5581|  57.8k|               }
 5582|  4.21M|               ++pos;
 5583|  4.21M|            }
 5584|  41.6k|            return false;
 5585|   359k|         };
_ZN3glz26line_could_be_flow_mappingIPKcS2_EEbT_T0_:
 5398|  7.15M|   {
 5399|  7.15M|      const auto stop = yaml::implicit_key_scan_end(it, end);
 5400|  7.15M|      int flow_depth = 0;
 5401|       |      // See `line_could_be_block_mapping` for why the quote guard is the state of the node rather
 5402|       |      // than the preceding character.
 5403|  7.15M|      bool at_node_start = true;
 5404|  7.15M|      bool prev_was_whitespace = true;
 5405|  7.15M|      bool key_supports_adjacent_value = false;
 5406|       |
 5407|  53.6M|      while (it != stop) {
  ------------------
  |  Branch (5407:14): [True: 53.4M, False: 252k]
  ------------------
 5408|  53.4M|         const char c = *it;
 5409|  53.4M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (5409:14): [True: 373k, False: 53.0M]
  |  Branch (5409:27): [True: 286k, False: 52.7M]
  ------------------
 5410|   660k|            return false;
 5411|   660k|         }
 5412|  52.7M|         if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5412:14): [True: 2.50M, False: 50.2M]
  |  Branch (5412:26): [True: 318k, False: 49.9M]
  ------------------
 5413|  2.82M|            prev_was_whitespace = true;
 5414|  2.82M|            key_supports_adjacent_value = false; // "Adjacent" admits no separation at all
 5415|  2.82M|            ++it;
 5416|  2.82M|            continue;
 5417|  2.82M|         }
 5418|  49.9M|         if (flow_depth == 0 && (c == ',' || c == ']' || c == '}')) {
  ------------------
  |  Branch (5418:14): [True: 39.0M, False: 10.8M]
  |  Branch (5418:34): [True: 4.41M, False: 34.6M]
  |  Branch (5418:46): [True: 128k, False: 34.5M]
  |  Branch (5418:58): [True: 185k, False: 34.3M]
  ------------------
 5419|  4.73M|            return false;
 5420|  4.73M|         }
 5421|       |         // As in `line_could_be_block_mapping`, content clears both flags and a branch opts back in.
 5422|  45.2M|         const bool after_whitespace = std::exchange(prev_was_whitespace, false);
 5423|  45.2M|         const bool node_start = std::exchange(at_node_start, false);
 5424|  45.2M|         const bool adjacent_value_ok = std::exchange(key_supports_adjacent_value, false);
 5425|       |
 5426|  45.2M|         if (c == '#' && flow_depth == 0 && after_whitespace) {
  ------------------
  |  Branch (5426:14): [True: 658k, False: 44.5M]
  |  Branch (5426:26): [True: 596k, False: 61.2k]
  |  Branch (5426:45): [True: 41.0k, False: 555k]
  ------------------
 5427|  41.0k|            return false;
 5428|  41.0k|         }
 5429|  45.1M|         if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5429:15): [True: 1.87M, False: 43.2M]
  |  Branch (5429:27): [True: 106k, False: 43.1M]
  |  Branch (5429:41): [True: 1.52M, False: 455k]
  ------------------
 5430|  1.52M|            if (not yaml::skip_probe_quoted_scalar(it, stop)) {
  ------------------
  |  Branch (5430:17): [True: 45.2k, False: 1.48M]
  ------------------
 5431|  45.2k|               return false;
 5432|  45.2k|            }
 5433|  1.48M|            key_supports_adjacent_value = true;
 5434|  1.48M|            continue;
 5435|  1.52M|         }
 5436|  43.6M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (5436:14): [True: 855k, False: 42.7M]
  |  Branch (5436:26): [True: 248k, False: 42.5M]
  ------------------
 5437|  1.10M|            ++flow_depth;
 5438|  1.10M|            at_node_start = true;
 5439|  1.10M|            ++it;
 5440|  1.10M|            continue;
 5441|  1.10M|         }
 5442|  42.5M|         if (c == ']' || c == '}') {
  ------------------
  |  Branch (5442:14): [True: 67.9k, False: 42.4M]
  |  Branch (5442:26): [True: 49.6k, False: 42.4M]
  ------------------
 5443|   117k|            --flow_depth; // Depth zero returned above, so this closes a collection we opened
 5444|   117k|            if (flow_depth == 0) {
  ------------------
  |  Branch (5444:17): [True: 70.4k, False: 47.0k]
  ------------------
 5445|  70.4k|               key_supports_adjacent_value = true;
 5446|  70.4k|            }
 5447|   117k|            ++it;
 5448|   117k|            continue;
 5449|   117k|         }
 5450|  42.4M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (5450:14): [True: 3.03M, False: 39.3M]
  |  Branch (5450:26): [True: 1.42M, False: 1.61M]
  ------------------
 5451|  1.42M|            const auto next = it + 1;
 5452|  1.42M|            if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (5452:17): [True: 16.7k, False: 1.40M]
  |  Branch (5452:32): [True: 807k, False: 597k]
  |  Branch (5452:48): [True: 93.0k, False: 504k]
  |  Branch (5452:65): [True: 72.3k, False: 432k]
  |  Branch (5452:82): [True: 109k, False: 322k]
  ------------------
 5453|  1.09M|               return true;
 5454|  1.09M|            }
 5455|       |            // A ':' run together with its key is a separator only after a JSON-like key.
 5456|   322k|            return adjacent_value_ok;
 5457|  1.42M|         }
 5458|       |         // Inside a flow collection ',' separates entries and ':' ends a key, so a node begins
 5459|       |         // after either.
 5460|  40.9M|         if (c == ',' || c == ':') {
  ------------------
  |  Branch (5460:14): [True: 1.72M, False: 39.2M]
  |  Branch (5460:26): [True: 1.61M, False: 37.6M]
  ------------------
 5461|  3.33M|            at_node_start = true;
 5462|  3.33M|            ++it;
 5463|  3.33M|            continue;
 5464|  3.33M|         }
 5465|  37.6M|         if (node_start && yaml::skip_probe_node_property(it, stop)) {
  ------------------
  |  Branch (5465:14): [True: 8.50M, False: 29.1M]
  |  Branch (5465:28): [True: 214k, False: 8.29M]
  ------------------
 5466|   214k|            at_node_start = true;
 5467|   214k|            continue;
 5468|   214k|         }
 5469|  37.4M|         ++it;
 5470|  37.4M|      }
 5471|       |
 5472|   252k|      return false;
 5473|  7.15M|   }
_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_:
 5962|  30.1k|            auto is_word_boundary = [&](const auto ptr) {
 5963|  30.1k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 1.11k, False: 29.0k]
  ------------------
 5964|  1.11k|                  return true;
 5965|  1.11k|               }
 5966|  29.0k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 16.3k, False: 12.7k]
  ------------------
 5967|  16.3k|                  auto next = ptr + 1;
 5968|  16.3k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 889, False: 15.4k]
  |  Branch (5968:43): [True: 3.82k, False: 11.5k]
  |  Branch (5968:59): [True: 6.66k, False: 4.92k]
  |  Branch (5968:76): [True: 1.40k, False: 3.52k]
  |  Branch (5968:93): [True: 2.54k, False: 979]
  ------------------
 5969|  16.3k|               }
 5970|  12.7k|               return is_plain_scalar_boundary(*ptr);
 5971|  29.0k|            };
_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:
 5888|  12.7k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  12.7k|               switch (ch) {
 5890|    840|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 840, False: 11.8k]
  ------------------
 5891|  1.99k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 1.15k, False: 11.5k]
  ------------------
 5892|  2.91k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 922, False: 11.8k]
  ------------------
 5893|  4.76k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 1.85k, False: 10.8k]
  ------------------
 5894|  7.33k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 2.56k, False: 10.1k]
  ------------------
 5895|  8.02k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 691, False: 12.0k]
  ------------------
 5896|  8.86k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 839, False: 11.8k]
  ------------------
 5897|  8.86k|                  return true;
 5898|  3.86k|               default:
  ------------------
  |  Branch (5898:16): [True: 3.86k, False: 8.86k]
  ------------------
 5899|  3.86k|                  return false;
 5900|  12.7k|               }
 5901|  12.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_ENKUlT_E_clISM_EEDaSZ_:
 5903|  25.3k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  25.3k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  25.3k|                  return false;
 5906|  25.3k|               }
 5907|  25.3k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 0, False: 25.3k]
  ------------------
 5908|      0|                  return false;
 5909|      0|               }
 5910|  25.3k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 25.3k, False: 0]
  |  Branch (5910:40): [True: 0, False: 0]
  |  Branch (5910:61): [True: 0, False: 0]
  ------------------
 5911|      0|                  return false;
 5912|      0|               }
 5913|       |
 5914|  25.3k|               auto look = word_end;
 5915|  25.3k|               yaml::skip_newline(look, end);
 5916|  25.3k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 0, False: 25.3k]
  ------------------
 5917|      0|                  int32_t line_indent = 0;
 5918|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 0, False: 0]
  |  Branch (5918:41): [True: 0, False: 0]
  ------------------
 5919|      0|                     ++line_indent;
 5920|      0|                     ++look;
 5921|      0|                  }
 5922|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 0, False: 0]
  |  Branch (5922:38): [True: 0, False: 0]
  ------------------
 5923|      0|                     return false;
 5924|      0|                  }
 5925|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 0, False: 0]
  |  Branch (5925:38): [True: 0, False: 0]
  |  Branch (5925:55): [True: 0, False: 0]
  ------------------
 5926|      0|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 0, False: 0]
  ------------------
 5927|      0|                        yaml::skip_newline(look, end);
 5928|      0|                        continue;
 5929|      0|                     }
 5930|      0|                     return false;
 5931|      0|                  }
 5932|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 0, False: 0]
  ------------------
 5933|      0|                     yaml::skip_comment(look, end);
 5934|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 0, False: 0]
  |  Branch (5934:42): [True: 0, False: 0]
  |  Branch (5934:59): [True: 0, False: 0]
  ------------------
 5935|      0|                        yaml::skip_newline(look, end);
 5936|      0|                        continue;
 5937|      0|                     }
 5938|      0|                     return false;
 5939|      0|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|      0|                  {
 5945|      0|                     auto scan = look;
 5946|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 0, False: 0]
  |  Branch (5946:44): [True: 0, False: 0]
  |  Branch (5946:61): [True: 0, False: 0]
  ------------------
 5947|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 0, False: 0]
  ------------------
 5948|      0|                           auto after_colon = scan + 1;
 5949|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 0, False: 0]
  |  Branch (5949:54): [True: 0, False: 0]
  |  Branch (5949:77): [True: 0, False: 0]
  ------------------
 5950|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 0, False: 0]
  |  Branch (5950:56): [True: 0, False: 0]
  ------------------
 5951|      0|                              return false;
 5952|      0|                           }
 5953|      0|                        }
 5954|      0|                        ++scan;
 5955|      0|                     }
 5956|      0|                  }
 5957|       |
 5958|      0|                  return line_indent > ctx.current_indent();
 5959|      0|               }
 5960|  25.3k|               return false;
 5961|  25.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_:
 5484|   936k|   {
 5485|   936k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   936k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   936k|         const bool could_be_mapping = [&] {
 5493|   936k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   936k|               return line_could_be_flow_mapping(it, end);
 5495|   936k|            }
 5496|   936k|            else {
 5497|   936k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   936k|            }
 5499|   936k|         }();
 5500|   936k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 787k, False: 148k]
  ------------------
 5501|   787k|            return false;
 5502|   787k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   148k|         auto temp_ctx = ctx.make_speculative();
 5505|   148k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   148k|                                                                                               end);
 5507|   148k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   148k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   148k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 139k, False: 9.53k]
  ------------------
 5510|   139k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   139k|            return true;
 5512|   139k|         }
 5513|       |         // The line matched "key: value" pattern but parsing failed.
 5514|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5515|       |         // so propagate the error rather than silently falling back to string.
 5516|  9.53k|         ctx.error = temp_ctx.error;
 5517|  9.53k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  9.53k|         return false;
 5519|   148k|      }
 5520|   936k|   }
_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:
 5492|   936k|         const bool could_be_mapping = [&] {
 5493|   936k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   936k|               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|       |            else {
 5497|       |               return yaml::line_could_be_block_mapping(it, end);
 5498|       |            }
 5499|   936k|         }();
_ZN3glz4yaml15materialize_keyILb1ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  4.25M|   {
   39|  4.25M|      if constexpr (empty_on_null) {
   40|  4.25M|         if (key_node.is_null()) {
  ------------------
  |  Branch (40:14): [True: 174k, False: 4.08M]
  ------------------
   41|   174k|            key.clear();
   42|   174k|            return true;
   43|   174k|         }
   44|  4.25M|      }
   45|  4.25M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 823k, False: 3.43M]
  ------------------
   46|   823k|         key = *s;
   47|   823k|         return true;
   48|   823k|      }
   49|  3.43M|      key.clear();
   50|  3.43M|      (void)glz::write_json(key_node, key);
   51|  3.43M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  3.43M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 354, False: 3.43M]
  ------------------
   53|    354|            ctx.error = error_code::exceeded_max_expansion;
   54|    354|            ctx.custom_error_message = "complex key expansion";
   55|    354|            return false;
   56|    354|         }
   57|  3.43M|      }
   58|  3.43M|      return true;
   59|  4.25M|   }
_ZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1576|  14.8M|      {
 1577|  14.8M|         key.clear();
 1578|  14.8M|         skip_inline_ws(it, end);
 1579|       |
 1580|  14.8M|         if (it == end) {
  ------------------
  |  Branch (1580:14): [True: 86, False: 14.8M]
  ------------------
 1581|     86|            ctx.error = error_code::unexpected_end;
 1582|     86|            return false;
 1583|     86|         }
 1584|       |
 1585|  14.8M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1586|  14.8M|            if (tag == yaml_tag::unknown) {
 1587|  14.8M|               ctx.error = error_code::syntax_error;
 1588|  14.8M|               return false;
 1589|  14.8M|            }
 1590|  14.8M|            if (!tag_valid_for_string(tag)) {
 1591|  14.8M|               ctx.error = error_code::syntax_error;
 1592|  14.8M|               return false;
 1593|  14.8M|            }
 1594|  14.8M|            return true;
 1595|  14.8M|         };
 1596|       |
 1597|       |         // Tags on keys (e.g. "!!str : value")
 1598|  14.8M|         auto key_tag = parse_yaml_tag(it, end, ctx);
 1599|  14.8M|         if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1599:14): [True: 152, False: 14.8M]
  ------------------
 1600|    152|            return false;
 1601|    152|         }
 1602|  14.8M|         skip_inline_ws(it, end);
 1603|  14.8M|         if (it == end) {
  ------------------
  |  Branch (1603:14): [True: 192, False: 14.8M]
  ------------------
 1604|    192|            ctx.error = error_code::unexpected_end;
 1605|    192|            return false;
 1606|    192|         }
 1607|       |
 1608|       |         // Handle alias as key (*name resolves to anchor value)
 1609|  14.8M|         if (*it == '*') {
  ------------------
  |  Branch (1609:14): [True: 1.92M, False: 12.9M]
  ------------------
 1610|  1.92M|            ++it;
 1611|  1.92M|            auto name = parse_anchor_name(it, end);
 1612|  1.92M|            if (name.empty()) {
  ------------------
  |  Branch (1612:17): [True: 620, False: 1.92M]
  ------------------
 1613|    620|               ctx.error = error_code::syntax_error;
 1614|    620|               return false;
 1615|    620|            }
 1616|  1.92M|            auto anchor_it = ctx.anchors.find(name);
 1617|  1.92M|            if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (1617:17): [True: 8.96k, False: 1.91M]
  ------------------
 1618|  8.96k|               ctx.error = error_code::syntax_error; // undefined alias
 1619|  8.96k|               return false;
 1620|  8.96k|            }
 1621|  1.91M|            auto& span = anchor_it->second;
 1622|  1.91M|            if (span.begin == span.end) {
  ------------------
  |  Branch (1622:17): [True: 103k, False: 1.81M]
  ------------------
 1623|   103k|               key.clear(); // empty anchor
 1624|   103k|            }
 1625|  1.81M|            else if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (1625:22): [True: 78, False: 1.81M]
  ------------------
 1626|       |               // A key alias replays its anchor the same way a value alias does, and a complex
 1627|       |               // key hands the span to the full reader, so it is charged the same way.
 1628|     78|               ctx.error = error_code::exceeded_max_expansion;
 1629|     78|               ctx.custom_error_message = "alias expansion";
 1630|     78|               return false;
 1631|     78|            }
 1632|  1.81M|            else {
 1633|       |               // Replay the anchor span to extract the key string
 1634|  1.81M|               auto replay_it = span.begin;
 1635|  1.81M|               auto replay_end = span.end;
 1636|  1.81M|               if (*replay_it == '"') {
  ------------------
  |  Branch (1636:20): [True: 1.63k, False: 1.81M]
  ------------------
 1637|  1.63k|                  parse_double_quoted_string(key, ctx, replay_it, replay_end);
 1638|  1.63k|               }
 1639|  1.81M|               else if (*replay_it == '\'') {
  ------------------
  |  Branch (1639:25): [True: 1.08k, False: 1.80M]
  ------------------
 1640|  1.08k|                  parse_single_quoted_string(key, ctx, replay_it, replay_end);
 1641|  1.08k|               }
 1642|  1.80M|               else if (*replay_it == '[' || *replay_it == '{') {
  ------------------
  |  Branch (1642:25): [True: 17.8k, False: 1.79M]
  |  Branch (1642:46): [True: 960k, False: 831k]
  ------------------
 1643|       |                  // Canonicalize complex alias keys (flow seq/map) to a stable string form.
 1644|   978k|                  glz::generic key_node{};
 1645|   978k|                  auto temp_ctx = ctx.make_speculative();
 1646|   978k|                  from<YAML, glz::generic>::template op<flow_context_on<opts{.error_on_unknown_keys = false}>()>(
 1647|   978k|                     key_node, temp_ctx, replay_it, replay_end);
 1648|   978k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1649|   978k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1650|   978k|                  if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1650:23): [True: 83.6k, False: 894k]
  ------------------
 1651|  83.6k|                     ctx.error = temp_ctx.error;
 1652|  83.6k|                     ctx.custom_error_message = temp_ctx.custom_error_message;
 1653|  83.6k|                     return false;
 1654|  83.6k|                  }
 1655|   894k|                  ctx.anchors = std::move(temp_ctx.anchors);
 1656|       |
 1657|   894k|                  if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1657:23): [True: 42, False: 894k]
  ------------------
 1658|     42|                     return false;
 1659|     42|                  }
 1660|   894k|               }
 1661|   831k|               else {
 1662|   831k|                  bool parse_structured_alias_key = false;
 1663|   831k|                  if (*replay_it == '-' &&
  ------------------
  |  Branch (1663:23): [True: 123k, False: 707k]
  ------------------
 1664|   123k|                      ((replay_it + 1) == replay_end ||
  ------------------
  |  Branch (1664:24): [True: 14.7k, False: 108k]
  ------------------
 1665|   108k|                       yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(replay_it + 1))])) {
  ------------------
  |  Branch (1665:24): [True: 63.4k, False: 45.3k]
  ------------------
 1666|  78.1k|                     parse_structured_alias_key = true;
 1667|  78.1k|                  }
 1668|   752k|                  else {
 1669|   752k|                     auto scan = replay_it;
 1670|   539M|                     while (scan != replay_end) {
  ------------------
  |  Branch (1670:29): [True: 539M, False: 94.3k]
  ------------------
 1671|   539M|                        if (*scan == ':') {
  ------------------
  |  Branch (1671:29): [True: 442k, False: 539M]
  ------------------
 1672|   442k|                           const auto after_colon = scan + 1;
 1673|   442k|                           if (after_colon == replay_end ||
  ------------------
  |  Branch (1673:32): [True: 57.9k, False: 384k]
  ------------------
 1674|   384k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) {
  ------------------
  |  Branch (1674:32): [True: 200k, False: 183k]
  ------------------
 1675|   258k|                              parse_structured_alias_key = true;
 1676|   258k|                              break;
 1677|   258k|                           }
 1678|   442k|                        }
 1679|   539M|                        if (*scan == '\n' || *scan == '\r') {
  ------------------
  |  Branch (1679:29): [True: 196k, False: 539M]
  |  Branch (1679:46): [True: 203k, False: 538M]
  ------------------
 1680|   399k|                           break;
 1681|   399k|                        }
 1682|   538M|                        ++scan;
 1683|   538M|                     }
 1684|   752k|                  }
 1685|   831k|                  if (!parse_structured_alias_key) {
  ------------------
  |  Branch (1685:23): [True: 494k, False: 336k]
  ------------------
 1686|   395M|                     for (auto p = replay_it; p != replay_end; ++p) {
  ------------------
  |  Branch (1686:47): [True: 394M, False: 94.3k]
  ------------------
 1687|   394M|                        if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1687:29): [True: 196k, False: 394M]
  |  Branch (1687:43): [True: 203k, False: 394M]
  ------------------
 1688|   399k|                           parse_structured_alias_key = true;
 1689|   399k|                           break;
 1690|   399k|                        }
 1691|   394M|                     }
 1692|   494k|                  }
 1693|       |
 1694|   831k|                  if (parse_structured_alias_key) {
  ------------------
  |  Branch (1694:23): [True: 736k, False: 94.3k]
  ------------------
 1695|   736k|                     glz::generic key_node{};
 1696|   736k|                     auto temp_ctx = ctx.make_speculative();
 1697|   736k|                     from<YAML, glz::generic>::template op<opts{.error_on_unknown_keys = false}>(key_node, temp_ctx,
 1698|   736k|                                                                                                 replay_it, replay_end);
 1699|   736k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1700|   736k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1701|   736k|                     if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1701:26): [True: 195k, False: 541k]
  ------------------
 1702|   195k|                        ctx.error = temp_ctx.error;
 1703|   195k|                        ctx.custom_error_message = temp_ctx.custom_error_message;
 1704|   195k|                        return false;
 1705|   195k|                     }
 1706|   541k|                     ctx.anchors = std::move(temp_ctx.anchors);
 1707|       |
 1708|   541k|                     if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1708:26): [True: 28, False: 540k]
  ------------------
 1709|     28|                        return false;
 1710|     28|                     }
 1711|   541k|                  }
 1712|  94.3k|                  else {
 1713|  94.3k|                     parse_plain_scalar(key, ctx, replay_it, replay_end, false);
 1714|  94.3k|                  }
 1715|   831k|               }
 1716|  1.81M|            }
 1717|  1.63M|            return !bool(ctx.error);
 1718|  1.91M|         }
 1719|       |
 1720|       |         // Handle anchor on key (&name before key text)
 1721|  12.9M|         bool has_key_anchor = false;
 1722|  12.9M|         std::string key_anchor_name;
 1723|  12.9M|         if (*it == '&') {
  ------------------
  |  Branch (1723:14): [True: 2.05M, False: 10.8M]
  ------------------
 1724|  2.05M|            ++it;
 1725|  2.05M|            auto name = parse_anchor_name(it, end);
 1726|  2.05M|            if (name.empty()) {
  ------------------
  |  Branch (1726:17): [True: 562, False: 2.05M]
  ------------------
 1727|    562|               ctx.error = error_code::syntax_error;
 1728|    562|               return false;
 1729|    562|            }
 1730|  2.05M|            skip_inline_ws(it, end);
 1731|  2.05M|            if (it == end) {
  ------------------
  |  Branch (1731:17): [True: 546, False: 2.05M]
  ------------------
 1732|    546|               ctx.error = error_code::unexpected_end;
 1733|    546|               return false;
 1734|    546|            }
 1735|       |            // Anchor on alias is invalid per YAML spec
 1736|  2.05M|            if (*it == '*') {
  ------------------
  |  Branch (1736:17): [True: 78, False: 2.05M]
  ------------------
 1737|     78|               ctx.error = error_code::syntax_error;
 1738|     78|               return false;
 1739|     78|            }
 1740|  2.05M|            has_key_anchor = true;
 1741|  2.05M|            key_anchor_name = std::string(name);
 1742|  2.05M|         }
 1743|       |
 1744|       |         // Allow node-property order "&anchor !!str key: value" for mapping keys.
 1745|  12.9M|         if (*it == '!') {
  ------------------
  |  Branch (1745:14): [True: 7.67k, False: 12.9M]
  ------------------
 1746|  7.67k|            if (key_tag != yaml_tag::none) {
  ------------------
  |  Branch (1746:17): [True: 6, False: 7.66k]
  ------------------
 1747|       |               // Duplicate tag properties on the same key node are malformed.
 1748|      6|               ctx.error = error_code::syntax_error;
 1749|      6|               return false;
 1750|      6|            }
 1751|  7.66k|            key_tag = parse_yaml_tag(it, end, ctx);
 1752|  7.66k|            if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1752:17): [True: 68, False: 7.59k]
  ------------------
 1753|     68|               return false;
 1754|     68|            }
 1755|  7.59k|            skip_inline_ws(it, end);
 1756|  7.59k|            if (it == end) {
  ------------------
  |  Branch (1756:17): [True: 22, False: 7.57k]
  ------------------
 1757|     22|               ctx.error = error_code::unexpected_end;
 1758|     22|               return false;
 1759|     22|            }
 1760|  7.59k|         }
 1761|       |
 1762|  12.9M|         const char* key_start = &*it;
 1763|  12.9M|         bool quoted_key_spans_lines = false;
 1764|       |
 1765|  12.9M|         if (*it == '"') {
  ------------------
  |  Branch (1765:14): [True: 1.65M, False: 11.2M]
  ------------------
 1766|  1.65M|            auto quoted_start = it;
 1767|  1.65M|            parse_double_quoted_string(key, ctx, it, end);
 1768|  1.65M|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1768:17): [True: 1.65M, False: 500]
  ------------------
 1769|  9.11M|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1769:44): [True: 7.47M, False: 1.64M]
  ------------------
 1770|  7.47M|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1770:23): [True: 3.79k, False: 7.47M]
  |  Branch (1770:37): [True: 12.1k, False: 7.46M]
  ------------------
 1771|  15.9k|                     quoted_key_spans_lines = true;
 1772|  15.9k|                     break;
 1773|  15.9k|                  }
 1774|  7.47M|               }
 1775|  1.65M|            }
 1776|  1.65M|         }
 1777|  11.2M|         else if (*it == '\'') {
  ------------------
  |  Branch (1777:19): [True: 11.4k, False: 11.2M]
  ------------------
 1778|  11.4k|            auto quoted_start = it;
 1779|  11.4k|            parse_single_quoted_string(key, ctx, it, end);
 1780|  11.4k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1780:17): [True: 11.1k, False: 248]
  ------------------
 1781|  90.6k|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1781:44): [True: 82.2k, False: 8.46k]
  ------------------
 1782|  82.2k|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1782:23): [True: 958, False: 81.2k]
  |  Branch (1782:37): [True: 1.75k, False: 79.5k]
  ------------------
 1783|  2.71k|                     quoted_key_spans_lines = true;
 1784|  2.71k|                     break;
 1785|  2.71k|                  }
 1786|  82.2k|               }
 1787|  11.1k|            }
 1788|  11.4k|         }
 1789|  11.2M|         else {
 1790|       |            // Plain key - read until colon
 1791|  40.3M|            while (it != end) {
  ------------------
  |  Branch (1791:20): [True: 40.3M, False: 414]
  ------------------
 1792|       |               // Bulk-copy the ordinary run; only dispatch bytes need the checks below.
 1793|  40.3M|               {
 1794|  40.3M|                  const auto run_start = it;
 1795|   138M|                  while (it != end && !plain_scalar_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1795:26): [True: 138M, False: 2.70k]
  |  Branch (1795:39): [True: 98.0M, False: 40.3M]
  ------------------
 1796|  98.0M|                     ++it;
 1797|  98.0M|                  }
 1798|  40.3M|                  if (it != run_start) {
  ------------------
  |  Branch (1798:23): [True: 30.9M, False: 9.41M]
  ------------------
 1799|  30.9M|                     key.append(run_start, it);
 1800|  30.9M|                  }
 1801|  40.3M|                  if (it == end) break;
  ------------------
  |  Branch (1801:23): [True: 2.70k, False: 40.3M]
  ------------------
 1802|  40.3M|               }
 1803|       |
 1804|  40.3M|               const char c = *it;
 1805|  40.3M|               if (c == ':') {
  ------------------
  |  Branch (1805:20): [True: 30.0M, False: 10.3M]
  ------------------
 1806|       |                  // Check if this ends the key
 1807|  30.0M|                  if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' ||
  ------------------
  |  Branch (1807:23): [True: 90.1k, False: 29.9M]
  |  Branch (1807:42): [True: 4.04M, False: 25.9M]
  |  Branch (1807:62): [True: 269k, False: 25.6M]
  |  Branch (1807:83): [True: 368k, False: 25.2M]
  ------------------
 1808|  25.2M|                      *(it + 1) == '\r') {
  ------------------
  |  Branch (1808:23): [True: 1.72M, False: 23.5M]
  ------------------
 1809|  6.49M|                     break;
 1810|  6.49M|                  }
 1811|  23.5M|                  if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1811:23): [True: 22.6M, False: 881k]
  |  Branch (1811:35): [True: 246k, False: 22.4M]
  |  Branch (1811:55): [True: 46, False: 22.4M]
  |  Branch (1811:75): [True: 79.9k, False: 22.3M]
  ------------------
 1812|   326k|                     break;
 1813|   326k|                  }
 1814|  23.5M|               }
 1815|  33.5M|               if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1815:20): [True: 1.25M, False: 32.2M]
  |  Branch (1815:33): [True: 1.62M, False: 30.6M]
  ------------------
 1816|  2.88M|                  if (!in_flow) break;
  ------------------
  |  Branch (1816:23): [True: 1.98k, False: 2.88M]
  ------------------
 1817|       |
 1818|  2.88M|                  auto continuation = it;
 1819|  2.88M|                  skip_newline(continuation, end);
 1820|  2.88M|                  int32_t continuation_indent = 0;
 1821|  24.2M|                  while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1821:26): [True: 24.2M, False: 648]
  |  Branch (1821:50): [True: 21.3M, False: 2.96M]
  |  Branch (1821:74): [True: 83.1k, False: 2.88M]
  ------------------
 1822|  21.4M|                     if (*continuation == ' ') ++continuation_indent;
  ------------------
  |  Branch (1822:26): [True: 21.3M, False: 83.1k]
  ------------------
 1823|  21.4M|                     ++continuation;
 1824|  21.4M|                  }
 1825|       |
 1826|  2.88M|                  if (continuation == end) {
  ------------------
  |  Branch (1826:23): [True: 648, False: 2.88M]
  ------------------
 1827|    648|                     break;
 1828|    648|                  }
 1829|       |
 1830|  2.88M|                  if (*continuation == '#') {
  ------------------
  |  Branch (1830:23): [True: 42.4k, False: 2.84M]
  ------------------
 1831|  42.4k|                     it = continuation;
 1832|  42.4k|                     skip_comment(it, end);
 1833|  42.4k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (1833:26): [True: 42.3k, False: 42]
  |  Branch (1833:40): [True: 17.3k, False: 24.9k]
  |  Branch (1833:55): [True: 24.9k, False: 82]
  ------------------
 1834|  42.3k|                        skip_newline(it, end);
 1835|  42.3k|                        continue;
 1836|  42.3k|                     }
 1837|    124|                     break;
 1838|  42.4k|                  }
 1839|       |
 1840|       |                  // A continuation line starting with flow terminators or ':' does
 1841|       |                  // not belong to the key content.
 1842|  2.84M|                  if (*continuation == ',' || *continuation == ']' || *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1842:23): [True: 158k, False: 2.68M]
  |  Branch (1842:47): [True: 14, False: 2.68M]
  |  Branch (1842:71): [True: 12.0k, False: 2.66M]
  |  Branch (1842:95): [True: 221k, False: 2.44M]
  ------------------
 1843|   392k|                     break;
 1844|   392k|                  }
 1845|       |
 1846|  2.44M|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1846:23): [True: 178k, False: 2.26M]
  ------------------
 1847|   178k|                     if (*continuation == '?' || *continuation == ':') {
  ------------------
  |  Branch (1847:26): [True: 1.24k, False: 177k]
  |  Branch (1847:50): [True: 0, False: 177k]
  ------------------
 1848|  1.24k|                        auto after = continuation + 1;
 1849|  1.24k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1849:29): [True: 8, False: 1.23k]
  |  Branch (1849:45): [True: 14, False: 1.22k]
  |  Branch (1849:62): [True: 6, False: 1.21k]
  |  Branch (1849:80): [True: 6, False: 1.21k]
  |  Branch (1849:98): [True: 6, False: 1.20k]
  ------------------
 1850|     40|                           break;
 1851|     40|                        }
 1852|  1.24k|                     }
 1853|       |
 1854|   178k|                     if (*continuation == '&' || *continuation == '*' || *continuation == '!') {
  ------------------
  |  Branch (1854:26): [True: 6, False: 178k]
  |  Branch (1854:50): [True: 10, False: 178k]
  |  Branch (1854:74): [True: 10, False: 178k]
  ------------------
 1855|     26|                        break;
 1856|     26|                     }
 1857|       |
 1858|   178k|                     if (*continuation == '-') {
  ------------------
  |  Branch (1858:26): [True: 3.11k, False: 175k]
  ------------------
 1859|  3.11k|                        auto after = continuation + 1;
 1860|  3.11k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1860:29): [True: 12, False: 3.09k]
  |  Branch (1860:45): [True: 6, False: 3.09k]
  |  Branch (1860:62): [True: 6, False: 3.08k]
  |  Branch (1860:80): [True: 6, False: 3.08k]
  |  Branch (1860:98): [True: 6, False: 3.07k]
  ------------------
 1861|     36|                           break;
 1862|     36|                        }
 1863|  3.11k|                     }
 1864|       |
 1865|   178k|                     if (ctx.current_indent() >= 0 && continuation_indent <= ctx.current_indent()) {
  ------------------
  |  Branch (1865:26): [True: 946, False: 177k]
  |  Branch (1865:55): [True: 436, False: 510]
  ------------------
 1866|    436|                        break;
 1867|    436|                     }
 1868|       |
 1869|       |                     // A continuation line that contains an implicit mapping-key
 1870|       |                     // indicator (": " / ":\n") starts a new entry, not key text.
 1871|   177k|                     {
 1872|   177k|                        auto scan = continuation;
 1873|   761k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1873:32): [True: 760k, False: 1.01k]
  |  Branch (1873:47): [True: 598k, False: 161k]
  |  Branch (1873:64): [True: 583k, False: 15.0k]
  ------------------
 1874|   583k|                           if (*scan == ':') {
  ------------------
  |  Branch (1874:32): [True: 14.5k, False: 569k]
  ------------------
 1875|  14.5k|                              auto after_colon = scan + 1;
 1876|  14.5k|                              const bool tight_key_colon =
 1877|  14.5k|                                 (scan == continuation) || (*(scan - 1) != ' ' && *(scan - 1) != '\t');
  ------------------
  |  Branch (1877:34): [True: 0, False: 14.5k]
  |  Branch (1877:61): [True: 12.0k, False: 2.44k]
  |  Branch (1877:83): [True: 11.7k, False: 304]
  ------------------
 1878|  14.5k|                              if (tight_key_colon &&
  ------------------
  |  Branch (1878:35): [True: 11.7k, False: 2.74k]
  ------------------
 1879|  11.7k|                                  (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1879:36): [True: 28, False: 11.7k]
  |  Branch (1879:58): [True: 10, False: 11.7k]
  |  Branch (1879:81): [True: 6, False: 11.7k]
  ------------------
 1880|  11.7k|                                   *after_colon == '\n' || *after_colon == '\r')) {
  ------------------
  |  Branch (1880:36): [True: 6, False: 11.7k]
  |  Branch (1880:60): [True: 10, False: 11.7k]
  ------------------
 1881|     60|                                 break;
 1882|     60|                              }
 1883|  14.5k|                           }
 1884|   583k|                           ++scan;
 1885|   583k|                        }
 1886|   177k|                        if (scan != end && *scan == ':') {
  ------------------
  |  Branch (1886:29): [True: 176k, False: 1.01k]
  |  Branch (1886:44): [True: 60, False: 176k]
  ------------------
 1887|     60|                           break;
 1888|     60|                        }
 1889|   177k|                     }
 1890|   177k|                  }
 1891|       |
 1892|  2.44M|                  if (!key.empty() && key.back() != ' ') {
  ------------------
  |  Branch (1892:23): [True: 1.86M, False: 584k]
  |  Branch (1892:39): [True: 675k, False: 1.18M]
  ------------------
 1893|   675k|                     key.push_back(' ');
 1894|   675k|                  }
 1895|  2.44M|                  it = continuation;
 1896|  2.44M|                  continue;
 1897|  2.44M|               }
 1898|  30.6M|               if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1898:20): [True: 28.7M, False: 1.93M]
  |  Branch (1898:32): [True: 2.90M, False: 25.7M]
  |  Branch (1898:44): [True: 220, False: 25.7M]
  |  Branch (1898:56): [True: 1.05M, False: 24.7M]
  ------------------
 1899|  26.6M|               if (c == '#') {
  ------------------
  |  Branch (1899:20): [True: 2.89M, False: 23.7M]
  ------------------
 1900|  2.89M|                  if (key.empty() || key.back() == ' ' || key.back() == '\t') break;
  ------------------
  |  Branch (1900:23): [True: 6.42k, False: 2.89M]
  |  Branch (1900:38): [True: 33.1k, False: 2.85M]
  |  Branch (1900:59): [True: 2.31k, False: 2.85M]
  ------------------
 1901|  2.89M|               }
 1902|       |
 1903|  26.6M|               if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1903:20): [True: 14.4k, False: 26.6M]
  ------------------
 1904|  14.4k|                  ctx.error = error_code::invalid_control_character;
 1905|  14.4k|                  return false;
 1906|  14.4k|               }
 1907|  26.6M|               key.push_back(c);
 1908|  26.6M|               ++it;
 1909|  26.6M|            }
 1910|       |
 1911|       |            // Trim trailing whitespace from key
 1912|  12.4M|            while (!key.empty() && (key.back() == ' ' || key.back() == '\t')) {
  ------------------
  |  Branch (1912:20): [True: 9.28M, False: 3.13M]
  |  Branch (1912:37): [True: 1.03M, False: 8.25M]
  |  Branch (1912:58): [True: 164k, False: 8.09M]
  ------------------
 1913|  1.19M|               key.pop_back();
 1914|  1.19M|            }
 1915|       |
 1916|       |            // Empty keys are valid YAML (":" in block or flow mappings).
 1917|  11.2M|         }
 1918|       |
 1919|  12.8M|         if (bool(ctx.error)) return false;
  ------------------
  |  Branch (1919:14): [True: 748, False: 12.8M]
  ------------------
 1920|       |
 1921|       |         // Implicit mapping keys must be single-line in both block and flow styles.
 1922|  12.8M|         if (quoted_key_spans_lines && !in_flow) {
  ------------------
  |  Branch (1922:14): [True: 18.6k, False: 12.8M]
  |  Branch (1922:40): [True: 92, False: 18.5k]
  ------------------
 1923|     92|            ctx.error = error_code::syntax_error;
 1924|     92|            return false;
 1925|     92|         }
 1926|       |
 1927|       |         // Store anchor on key if present
 1928|  12.8M|         if (has_key_anchor) {
  ------------------
  |  Branch (1928:14): [True: 2.05M, False: 10.8M]
  ------------------
 1929|  2.05M|            ctx.anchors[std::move(key_anchor_name)] = {key_start, &*it, ctx.current_indent()};
 1930|  2.05M|         }
 1931|       |
 1932|  12.8M|         return true;
 1933|  12.8M|      }
_ZZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_bENKUlNS0_8yaml_tagEE_clESI_:
 1585|  14.8M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1586|  14.8M|            if (tag == yaml_tag::unknown) {
  ------------------
  |  Branch (1586:17): [True: 118, False: 14.8M]
  ------------------
 1587|    118|               ctx.error = error_code::syntax_error;
 1588|    118|               return false;
 1589|    118|            }
 1590|  14.8M|            if (!tag_valid_for_string(tag)) {
  ------------------
  |  Branch (1590:17): [True: 102, False: 14.8M]
  ------------------
 1591|    102|               ctx.error = error_code::syntax_error;
 1592|    102|               return false;
 1593|    102|            }
 1594|  14.8M|            return true;
 1595|  14.8M|         };
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  6.70M|      {
  275|  6.70M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  6.70M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  6.70M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  6.70M|      }
_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_:
 5752|  9.83M|      {
 5753|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5754|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5755|  9.83M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  9.83M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  9.83M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  9.83M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  9.83M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 9.83M]
  ------------------
 5760|      0|            return;
 5761|       |
 5762|       |         // No depth is taken here: the sequence and mapping readers this dispatches to count the
 5763|       |         // levels, so a scalar at the bottom of a document costs nothing, as in JSON. The one way
 5764|       |         // back into this reader that opens no collection is `redispatch`, which counts itself.
 5765|       |
 5766|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5767|       |         // For nested values, only skip inline whitespace to preserve block structure
 5768|  9.83M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 8.13M, False: 1.69M]
  ------------------
 5769|  8.13M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  8.13M|         }
 5771|  1.69M|         else {
 5772|  1.69M|            yaml::skip_inline_ws(it, end);
 5773|  1.69M|         }
 5774|       |
 5775|  9.83M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 112, False: 9.83M]
  ------------------
 5776|    112|            ctx.error = error_code::unexpected_end;
 5777|    112|            return;
 5778|    112|         }
 5779|       |
 5780|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5781|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5782|       |         // same variant definitions round-trip across both formats.
 5783|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5784|       |            using V = std::remove_cvref_t<T>;
 5785|       |            const bool value_is_mapping =
 5786|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5787|       |            if (value_is_mapping) {
 5788|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5789|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5790|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5791|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5792|       |               auto tag_ctx = ctx.make_speculative();
 5793|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5794|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5795|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5796|       |               if (index < ids_v<V>.size()) {
 5797|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5798|       |                  emplace_runtime_variant(value, index);
 5799|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5800|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5801|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5802|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5803|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5804|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5805|       |                     return;
 5806|       |                  }
 5807|       |                  std::visit(
 5808|       |                     [&](auto&& alt) {
 5809|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5810|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5811|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5812|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5813|       |                        }
 5814|       |                        else if constexpr (custom_read<Alt>) {
 5815|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5816|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5817|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5818|       |                           // entry, then hand the remaining mapping to the custom handler.
 5819|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5820|       |                              ctx.error = error_code::feature_not_supported;
 5821|       |                              ctx.custom_error_message =
 5822|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5823|       |                           }
 5824|       |                           else {
 5825|       |                              ctx.scratch.clear();
 5826|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5827|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5828|       |                                    ctx.error = error_code::feature_not_supported;
 5829|       |                                    ctx.custom_error_message =
 5830|       |                                       "the tag must be the first key for a custom variant alternative";
 5831|       |                                 }
 5832|       |                                 else {
 5833|       |                                    yaml::skip_inline_ws(it, end);
 5834|       |                                    if (it == end || *it != ':') {
 5835|       |                                       ctx.error = error_code::syntax_error;
 5836|       |                                    }
 5837|       |                                    else {
 5838|       |                                       ++it;
 5839|       |                                       yaml::skip_inline_ws(it, end);
 5840|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5841|       |                                       if (!bool(ctx.error)) {
 5842|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5843|       |                                          // was the whole mapping: leave the alternative default.
 5844|       |                                          auto probe = it;
 5845|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5846|       |                                          if (probe == end) {
 5847|       |                                             it = probe;
 5848|       |                                          }
 5849|       |                                          else {
 5850|       |                                             // Publish the mapping's column so the custom handler's block
 5851|       |                                             // mapping (which would otherwise discover its own indent) reads
 5852|       |                                             // the remaining entries at the variant's indent and dedents
 5853|       |                                             // correctly in every context (root, sequence, nested).
 5854|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5855|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5856|       |                                             ctx.forced_block_mapping_indent = -1;
 5857|       |                                          }
 5858|       |                                       }
 5859|       |                                    }
 5860|       |                                 }
 5861|       |                              }
 5862|       |                           }
 5863|       |                        }
 5864|       |                        else {
 5865|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5866|       |                           // the value, but the mapping must still be consumed.
 5867|       |                           walk_tagged_mapping<Opts>(
 5868|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5869|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5870|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5871|       |                              });
 5872|       |                        }
 5873|       |                     },
 5874|       |                     value);
 5875|       |                  ctx.pop_indent();
 5876|       |                  return;
 5877|       |               }
 5878|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5879|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5880|       |               // otherwise the deduction path reports no_matching_variant_type.
 5881|       |            }
 5882|       |         }
 5883|       |
 5884|  9.83M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  9.83M|            using V = std::remove_cvref_t<T>;
 5886|  9.83M|            using counts = yaml_variant_type_count<V>;
 5887|  9.83M|            const char c = *it;
 5888|  9.83M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  9.83M|               switch (ch) {
 5890|  9.83M|               case ' ':
 5891|  9.83M|               case '\t':
 5892|  9.83M|               case '\n':
 5893|  9.83M|               case '\r':
 5894|  9.83M|               case ',':
 5895|  9.83M|               case ']':
 5896|  9.83M|               case '}':
 5897|  9.83M|                  return true;
 5898|  9.83M|               default:
 5899|  9.83M|                  return false;
 5900|  9.83M|               }
 5901|  9.83M|            };
 5902|       |
 5903|  9.83M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  9.83M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  9.83M|                  return false;
 5906|  9.83M|               }
 5907|  9.83M|               if (ctx.current_indent() < 0) {
 5908|  9.83M|                  return false;
 5909|  9.83M|               }
 5910|  9.83M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  9.83M|                  return false;
 5912|  9.83M|               }
 5913|       |
 5914|  9.83M|               auto look = word_end;
 5915|  9.83M|               yaml::skip_newline(look, end);
 5916|  9.83M|               while (look != end) {
 5917|  9.83M|                  int32_t line_indent = 0;
 5918|  9.83M|                  while (look != end && *look == ' ') {
 5919|  9.83M|                     ++line_indent;
 5920|  9.83M|                     ++look;
 5921|  9.83M|                  }
 5922|  9.83M|                  if (look != end && *look == '\t') {
 5923|  9.83M|                     return false;
 5924|  9.83M|                  }
 5925|  9.83M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  9.83M|                     if (look != end) {
 5927|  9.83M|                        yaml::skip_newline(look, end);
 5928|  9.83M|                        continue;
 5929|  9.83M|                     }
 5930|  9.83M|                     return false;
 5931|  9.83M|                  }
 5932|  9.83M|                  if (*look == '#') {
 5933|  9.83M|                     yaml::skip_comment(look, end);
 5934|  9.83M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  9.83M|                        yaml::skip_newline(look, end);
 5936|  9.83M|                        continue;
 5937|  9.83M|                     }
 5938|  9.83M|                     return false;
 5939|  9.83M|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  9.83M|                  {
 5945|  9.83M|                     auto scan = look;
 5946|  9.83M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  9.83M|                        if (*scan == ':') {
 5948|  9.83M|                           auto after_colon = scan + 1;
 5949|  9.83M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  9.83M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  9.83M|                              return false;
 5952|  9.83M|                           }
 5953|  9.83M|                        }
 5954|  9.83M|                        ++scan;
 5955|  9.83M|                     }
 5956|  9.83M|                  }
 5957|       |
 5958|  9.83M|                  return line_indent > ctx.current_indent();
 5959|  9.83M|               }
 5960|  9.83M|               return false;
 5961|  9.83M|            };
 5962|  9.83M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  9.83M|               if (ptr == end) {
 5964|  9.83M|                  return true;
 5965|  9.83M|               }
 5966|  9.83M|               if (*ptr == ':') {
 5967|  9.83M|                  auto next = ptr + 1;
 5968|  9.83M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  9.83M|               }
 5970|  9.83M|               return is_plain_scalar_boundary(*ptr);
 5971|  9.83M|            };
 5972|       |
 5973|  9.83M|            switch (c) {
 5974|  2.64M|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 2.64M, False: 7.19M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|  2.64M|               ++it;
 5977|  2.64M|               auto aname = yaml::parse_anchor_name(it, end);
 5978|  2.64M|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 62, False: 2.64M]
  ------------------
 5979|     62|                  ctx.error = error_code::syntax_error;
 5980|     62|                  return;
 5981|     62|               }
 5982|  2.64M|               yaml::skip_inline_ws(it, end);
 5983|  2.64M|               bool anchor_on_same_line = true;
 5984|  2.64M|               bool value_is_indentless_sequence = false;
 5985|  2.64M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 21.6k, False: 2.61M]
  |  Branch (5985:33): [True: 104k, False: 2.51M]
  |  Branch (5985:48): [True: 117k, False: 2.39M]
  |  Branch (5985:63): [True: 27.0k, False: 2.37M]
  ------------------
 5986|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5987|       |                  // next line (indented past current context) or if this is an empty node.
 5988|   270k|                  bool value_on_next_line = false;
 5989|   270k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 248k, False: 21.6k]
  ------------------
 5990|   248k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|   248k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 27.0k, False: 221k]
  ------------------
 5993|   129k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 129k, False: 10]
  |  Branch (5993:47): [True: 113k, False: 15.9k]
  |  Branch (5993:64): [True: 102k, False: 11.1k]
  ------------------
 5994|  27.0k|                     }
 5995|       |                     // Skip newline
 5996|   248k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 248k, False: 10]
  |  Branch (5996:42): [True: 119k, False: 128k]
  |  Branch (5996:59): [True: 128k, False: 0]
  ------------------
 5997|   248k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   344k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 338k, False: 6.59k]
  |  Branch (5999:48): [True: 40.1k, False: 297k]
  |  Branch (5999:65): [True: 55.7k, False: 242k]
  ------------------
 6000|  95.9k|                           yaml::skip_newline(peek, end);
 6001|  95.9k|                        }
 6002|       |                        // Measure indent of next content line
 6003|   248k|                        int32_t next_indent = 0;
 6004|   520k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 510k, False: 9.84k]
  |  Branch (6004:47): [True: 271k, False: 238k]
  ------------------
 6005|   271k|                           ++next_indent;
 6006|   271k|                           ++peek;
 6007|   271k|                        }
 6008|   248k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 238k, False: 9.84k]
  |  Branch (6008:44): [True: 234k, False: 4.44k]
  |  Branch (6008:61): [True: 232k, False: 1.66k]
  ------------------
 6009|   232k|                           const bool indentless_sequence =
 6010|   232k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 221k, False: 10.9k]
  |  Branch (6010:69): [True: 61.6k, False: 160k]
  ------------------
 6011|  61.6k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 4.94k, False: 56.6k]
  ------------------
 6012|  56.6k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 55.4k, False: 1.23k]
  ------------------
 6013|  60.3k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 4.55k, False: 55.8k]
  ------------------
 6014|  55.8k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 21.2k, False: 34.5k]
  |  Branch (6014:61): [True: 20.2k, False: 956]
  ------------------
 6015|   232k|                           value_is_indentless_sequence = indentless_sequence;
 6016|   232k|                           const bool same_indent_property_node =
 6017|   232k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 33.5k, False: 199k]
  ------------------
 6018|  33.5k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 1.60k, False: 31.9k]
  |  Branch (6018:48): [True: 4.14k, False: 27.8k]
  |  Branch (6018:64): [True: 278, False: 27.5k]
  |  Branch (6018:80): [True: 378, False: 27.1k]
  |  Branch (6018:96): [True: 446, False: 26.7k]
  ------------------
 6019|  26.7k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 954, False: 25.7k]
  |  Branch (6019:48): [True: 1.56k, False: 24.2k]
  |  Branch (6019:65): [True: 862, False: 23.3k]
  |  Branch (6019:81): [True: 2.42k, False: 20.9k]
  ------------------
 6020|   232k|                           value_on_next_line =
 6021|   232k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 162k, False: 70.0k]
  |  Branch (6021:71): [True: 24.8k, False: 45.1k]
  |  Branch (6021:94): [True: 12.6k, False: 32.5k]
  ------------------
 6022|   232k|                        }
 6023|   248k|                     }
 6024|   248k|                  }
 6025|   270k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 70.1k, False: 200k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  70.1k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  70.1k|                     return;
 6029|  70.1k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|   200k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 19.4k, False: 180k]
  ------------------
 6032|  97.8k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 97.8k, False: 0]
  |  Branch (6032:42): [True: 82.2k, False: 15.5k]
  |  Branch (6032:57): [True: 78.4k, False: 3.88k]
  ------------------
 6033|  19.4k|                  }
 6034|   200k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 200k, False: 0]
  ------------------
 6035|   270k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 270k, False: 0]
  |  Branch (6035:40): [True: 27.0k, False: 243k]
  |  Branch (6035:55): [True: 43.1k, False: 200k]
  ------------------
 6036|  70.2k|                     yaml::skip_newline(it, end);
 6037|  70.2k|                  }
 6038|   200k|                  yaml::skip_inline_ws(it, end);
 6039|   200k|                  anchor_on_same_line = false;
 6040|   200k|               }
 6041|       |
 6042|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|       |                  if (anchor_on_same_line && *it == '-' &&
 6044|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|       |                     ctx.error = error_code::syntax_error;
 6047|       |                     return;
 6048|       |                  }
 6049|       |               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|  2.57M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 2.57M, False: 6]
  |  Branch (6053:33): [True: 780, False: 2.57M]
  |  Branch (6053:47): [True: 26, False: 754]
  ------------------
 6054|     26|                  ctx.error = error_code::syntax_error;
 6055|     26|                  return;
 6056|     26|               }
 6057|       |
 6058|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 6060|       |                     auto probe = it + 1;
 6061|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|       |                     if (nested_anchor_name.empty()) {
 6063|       |                        ctx.error = error_code::syntax_error;
 6064|       |                        return;
 6065|       |                     }
 6066|       |                     yaml::skip_inline_ws(probe, end);
 6067|       |                     // Allow nested anchor usage only when it clearly starts a
 6068|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6069|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6070|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 6071|       |                        ctx.error = error_code::syntax_error;
 6072|       |                        return;
 6073|       |                     }
 6074|       |                  }
 6075|       |               }
 6076|       |
 6077|  2.57M|               const char* anchor_start = &*it;
 6078|  2.57M|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6081|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6082|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6083|       |                  // next line, the anchor applies to the entire next-line content.
 6084|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 6085|       |                     auto key_start = it;
 6086|       |                     if (*key_start == '!') {
 6087|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 6089|       |                           ctx.error = error_code::syntax_error;
 6090|       |                           return;
 6091|       |                        }
 6092|       |                        yaml::skip_inline_ws(key_start, end);
 6093|       |                        if (key_start == end) {
 6094|       |                           ctx.error = error_code::unexpected_end;
 6095|       |                           return;
 6096|       |                        }
 6097|       |                        if (*key_start == '\n' || *key_start == '\r') {
 6098|       |                           ctx.error = error_code::syntax_error;
 6099|       |                           return;
 6100|       |                        }
 6101|       |
 6102|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6103|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6104|       |                        // key-span registration below while the untagged spelling was rejected;
 6105|       |                        // an alias node carries no other properties either way.
 6106|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 6107|       |                           ctx.error = error_code::syntax_error;
 6108|       |                           return;
 6109|       |                        }
 6110|       |                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|       |                     auto key_scan = key_start;
 6114|       |                     auto key_end = key_start;
 6115|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6116|       |                        // Quoted key: skip to closing quote
 6117|       |                        const char quote = *key_scan;
 6118|       |                        ++key_scan;
 6119|       |                        while (key_scan != end && *key_scan != quote) {
 6120|       |                           if (*key_scan == '\\' && quote == '"') {
 6121|       |                              ++key_scan;
 6122|       |                              if (key_scan != end) ++key_scan;
 6123|       |                           }
 6124|       |                           else {
 6125|       |                              ++key_scan;
 6126|       |                           }
 6127|       |                        }
 6128|       |                        if (key_scan == end) {
 6129|       |                           ctx.error = error_code::syntax_error;
 6130|       |                           return;
 6131|       |                        }
 6132|       |                        ++key_scan; // past closing quote
 6133|       |                        key_end = key_scan;
 6134|       |                        yaml::skip_inline_ws(key_scan, end);
 6135|       |                     }
 6136|       |                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|       |                        while (key_scan != end) {
 6139|       |                           if (*key_scan == ':') {
 6140|       |                              auto next = key_scan + 1;
 6141|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6142|       |                                 break;
 6143|       |                              }
 6144|       |                           }
 6145|       |                           ++key_scan;
 6146|       |                        }
 6147|       |                        key_end = key_scan;
 6148|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6149|       |                           --key_end;
 6150|       |                        }
 6151|       |                     }
 6152|       |                     if (key_scan == end || *key_scan != ':') {
 6153|       |                        ctx.error = error_code::syntax_error;
 6154|       |                        return;
 6155|       |                     }
 6156|       |                     // Store anchor with just the key text span
 6157|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|       |                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|       |                     if constexpr (counts::n_object > 0) {
 6161|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|       |                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|       |                     return;
 6168|       |                  }
 6169|       |               }
 6170|       |
 6171|  2.57M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|  2.57M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|  2.57M|               redispatch<Opts>(value, ctx, it, end);
 6174|  2.57M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|  2.57M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 2.56M, False: 6.83k]
  ------------------
 6176|  2.56M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|  2.56M|               }
 6178|  2.57M|               return;
 6179|  2.57M|            }
 6180|   532k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 532k, False: 9.30M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6184|       |                     if constexpr (counts::n_object > 0) {
 6185|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|       |                                                                                                        end);
 6187|       |                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|       |                  }
 6194|       |               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|   532k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   532k|               return;
 6199|  2.57M|            }
 6200|   694k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 694k, False: 9.13M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   694k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   694k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 40, False: 694k]
  ------------------
 6204|     40|                  ctx.error = error_code::syntax_error;
 6205|     40|                  return;
 6206|     40|               }
 6207|   694k|               yaml::skip_inline_ws(it, end);
 6208|   694k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 692k, False: 1.87k]
  |  Branch (6208:33): [True: 24.8k, False: 667k]
  ------------------
 6209|  24.8k|                  yaml::skip_comment(it, end);
 6210|  24.8k|               }
 6211|   694k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 690k, False: 3.12k]
  |  Branch (6211:34): [True: 35.4k, False: 655k]
  |  Branch (6211:49): [True: 80.6k, False: 574k]
  ------------------
 6212|   116k|                  auto content = it;
 6213|   116k|                  yaml::skip_newline(content, end);
 6214|   116k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|   116k|                  bool consume_following_content = false;
 6217|   116k|                  auto content_token = content;
 6218|   116k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 109k, False: 6.25k]
  ------------------
 6219|   109k|                     auto indent_probe = content;
 6220|   109k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|   109k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 6, False: 109k]
  ------------------
 6222|      6|                        return;
 6223|   109k|                     content_token = indent_probe;
 6224|       |
 6225|       |                     // A tag at the end of a sequence/map entry has an empty value
 6226|       |                     // unless the next non-empty content is nested under the current node.
 6227|   109k|                     bool tagged_indentless_sequence = false;
 6228|   109k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 15.3k, False: 94.5k]
  |  Branch (6228:56): [True: 15.3k, False: 0]
  |  Branch (6228:79): [True: 14.0k, False: 1.30k]
  ------------------
 6229|  14.0k|                        const auto after_dash = indent_probe + 1;
 6230|  14.0k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 1.20k, False: 12.8k]
  ------------------
 6231|  13.4k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 12.2k, False: 594]
  ------------------
 6232|  13.4k|                           tagged_indentless_sequence =
 6233|  13.4k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 1.52k, False: 11.9k]
  ------------------
 6234|  11.9k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 7.78k, False: 4.16k]
  |  Branch (6234:60): [True: 688, False: 7.10k]
  ------------------
 6235|  13.4k|                        }
 6236|  14.0k|                     }
 6237|       |
 6238|   109k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 43.4k, False: 66.4k]
  ------------------
 6239|  66.4k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 39.8k, False: 26.6k]
  |  Branch (6239:93): [True: 2.21k, False: 24.4k]
  ------------------
 6240|   109k|                  }
 6241|       |
 6242|   116k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 85.4k, False: 30.6k]
  ------------------
 6243|  85.4k|                     it = content_token;
 6244|  85.4k|                  }
 6245|  30.6k|                  else {
 6246|  30.6k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 658, False: 30.0k]
  ------------------
 6247|    658|                        if constexpr (counts::n_str > 0) {
 6248|    658|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|    658|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|    658|                           value = StrType{};
 6251|    658|                           return;
 6252|    658|                        }
 6253|    658|                     }
 6254|  30.6k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 810, False: 29.8k]
  ------------------
 6255|    810|                        if constexpr (counts::n_null > 0) {
 6256|    810|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    810|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    810|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 810]
  ------------------
 6259|    810|                           return;
 6260|    810|                        }
 6261|    810|                     }
 6262|  30.6k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 22.2k, False: 8.36k]
  ------------------
 6263|  22.2k|                        if constexpr (counts::n_null > 0) {
 6264|  22.2k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  22.2k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  22.2k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 22.2k]
  ------------------
 6267|  22.2k|                           return;
 6268|  22.2k|                        }
 6269|  22.2k|                     }
 6270|  30.6k|                  }
 6271|   116k|               }
 6272|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6273|       |                  // In block context, a comma immediately after a tag token is malformed
 6274|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6275|       |                  if (it != end && *it == ',') {
 6276|       |                     ctx.error = error_code::syntax_error;
 6277|       |                     return;
 6278|       |                  }
 6279|       |                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|       |                     const bool starts_block_sequence_entry =
 6282|       |                        (it != end && *it == '-') &&
 6283|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6284|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6285|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6286|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6287|       |                        redispatch<Opts>(value, ctx, it, end);
 6288|       |                        return;
 6289|       |                     }
 6290|       |                  }
 6291|       |               }
 6292|   694k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 3.12k, False: 690k]
  ------------------
 6293|  3.12k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 2.08k, False: 1.03k]
  ------------------
 6294|  2.08k|                     if constexpr (counts::n_str > 0) {
 6295|  2.08k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|  2.08k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|  2.08k|                        value = StrType{};
 6298|  2.08k|                        return;
 6299|  2.08k|                     }
 6300|  2.08k|                  }
 6301|  3.12k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 1.02k, False: 2.09k]
  ------------------
 6302|  1.02k|                     if constexpr (counts::n_null > 0) {
 6303|  1.02k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  1.02k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  1.02k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 1.02k]
  ------------------
 6306|  1.02k|                        return;
 6307|  1.02k|                     }
 6308|  1.02k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  3.12k|                  return;
 6311|  3.12k|               }
 6312|   690k|               switch (tag) {
 6313|  1.02k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 1.02k, False: 689k]
  ------------------
 6314|  1.02k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  1.02k|                  return;
 6316|  4.44k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 4.44k, False: 686k]
  ------------------
 6317|  13.6k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 9.18k, False: 681k]
  ------------------
 6318|  13.6k|                  if constexpr (counts::n_num > 0) {
 6319|  13.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  13.6k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  47.7k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 34.1k, False: 656k]
  ------------------
 6327|  47.7k|                  if constexpr (counts::n_bool > 0) {
 6328|  47.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  47.7k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  50.2k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 2.48k, False: 688k]
  ------------------
 6336|  50.2k|                  if constexpr (counts::n_null > 0) {
 6337|  50.2k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  50.2k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  50.2k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 50.2k]
  ------------------
 6340|  50.2k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  50.2k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|   119k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 68.8k, False: 622k]
  ------------------
 6348|   119k|                  if constexpr (counts::n_object > 0) {
 6349|   119k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|   119k|                                                                                                     end);
 6351|   119k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|   151k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 32.6k, False: 658k]
  ------------------
 6358|   151k|                  if constexpr (counts::n_array > 0) {
 6359|   151k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|       |                        if (it != end && *it == '-') {
 6362|       |                           ctx.allow_indentless_sequence = true;
 6363|       |                        }
 6364|       |                     }
 6365|   151k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|   151k|                                                                                                    end);
 6367|   151k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|   151k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   666k|               default: {
  ------------------
  |  Branch (6374:16): [True: 514k, False: 176k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   666k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 514k, False: 151k]
  |  Branch (6377:36): [True: 199k, False: 314k]
  ------------------
 6378|   199k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|   199k|                     return;
 6380|   199k|                  }
 6381|       |
 6382|   466k|                  if constexpr (counts::n_array > 0) {
 6383|   466k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 314k, False: 151k]
  |  Branch (6383:39): [True: 1.35k, False: 313k]
  ------------------
 6384|  1.35k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  1.35k|                                                                                                       end);
 6386|  1.35k|                        return;
 6387|  1.35k|                     }
 6388|   466k|                  }
 6389|   466k|                  if constexpr (counts::n_object > 0) {
 6390|   466k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 313k, False: 153k]
  |  Branch (6390:39): [True: 2.07k, False: 311k]
  ------------------
 6391|  2.07k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  2.07k|                                                                                                        end);
 6393|  2.07k|                        return;
 6394|  2.07k|                     }
 6395|   466k|                  }
 6396|       |
 6397|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|       |                     if constexpr (counts::n_array > 0) {
 6399|       |                        const bool starts_block_sequence_entry =
 6400|       |                           (it != end && *it == '-') &&
 6401|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6402|       |                        if (starts_block_sequence_entry) {
 6403|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|       |                                                                                                          it, end);
 6405|       |                           return;
 6406|       |                        }
 6407|       |                     }
 6408|       |                     if constexpr (counts::n_object > 0) {
 6409|       |                        const bool starts_explicit_mapping_indicator =
 6410|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6411|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6412|       |                        if (starts_explicit_mapping_indicator) {
 6413|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|       |                                                                                                           it, end);
 6415|       |                           return;
 6416|       |                        }
 6417|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6418|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6419|       |                                                                                                           it, end);
 6420|       |                           return;
 6421|       |                        }
 6422|       |                     }
 6423|       |                  }
 6424|       |
 6425|   466k|                  if constexpr (counts::n_str > 0) {
 6426|   466k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   466k|                     return;
 6428|   466k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   466k|                  return;
 6433|   666k|               }
 6434|   690k|               }
 6435|      0|               return;
 6436|   690k|            }
 6437|  2.62M|            case '{':
  ------------------
  |  Branch (6437:13): [True: 2.62M, False: 7.20M]
  ------------------
 6438|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6441|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|       |                                                                                                     end);
 6443|       |                     return;
 6444|       |                  }
 6445|       |               }
 6446|       |               // Flow mapping - object type
 6447|  2.62M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  2.62M|               return;
 6449|   143k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 143k, False: 9.68M]
  ------------------
 6450|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6453|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|       |                                                                                                     end);
 6455|       |                     return;
 6456|       |                  }
 6457|       |               }
 6458|       |               // Flow sequence - array type
 6459|   143k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|   143k|               return;
 6461|   434k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 434k, False: 9.39M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   434k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 433k, False: 1.04k]
  |  Branch (6463:39): [True: 6, False: 433k]
  ------------------
 6464|      6|                  ctx.error = error_code::syntax_error;
 6465|      6|                  return;
 6466|      6|               }
 6467|   434k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 433k, False: 1.04k]
  |  Branch (6467:40): [True: 128k, False: 304k]
  |  Branch (6467:56): [True: 215k, False: 89.4k]
  |  Branch (6467:73): [True: 43.4k, False: 46.0k]
  ------------------
 6468|   387k|                  if constexpr (counts::n_object > 0) {
 6469|   387k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   387k|                                                                                                     end);
 6471|   387k|                     return;
 6472|   387k|                  }
 6473|   387k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   434k|               return;
 6476|     12|            case '%':
  ------------------
  |  Branch (6476:13): [True: 12, False: 9.83M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     12|               ctx.error = error_code::syntax_error;
 6479|     12|               return;
 6480|  35.2k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 35.2k, False: 9.79M]
  ------------------
 6481|  40.1k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 4.91k, False: 9.82M]
  ------------------
 6482|       |               // Could be a quoted string OR a quoted key in a block mapping
 6483|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6484|  40.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  40.1k|               return;
 6486|  32.3k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 32.3k, False: 9.80M]
  ------------------
 6487|  77.7k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 45.3k, False: 9.78M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  77.7k|               if constexpr (counts::n_bool > 0) {
 6490|  77.7k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 77.1k, False: 656]
  |  Branch (6490:44): [True: 50.1k, False: 26.9k]
  |  Branch (6490:60): [True: 48.5k, False: 1.60k]
  |  Branch (6490:76): [True: 42.8k, False: 5.63k]
  ------------------
 6491|  44.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 4.05k, False: 30.1k]
  |  Branch (6491:60): [True: 2.24k, False: 1.81k]
  |  Branch (6491:76): [True: 1.89k, False: 350]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  44.7k|                     const auto after_true = it + 4;
 6494|  44.7k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  44.7k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 42.9k, False: 1.88k]
  ------------------
 6497|  42.9k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 0, False: 42.9k]
  ------------------
 6498|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|      0|                           return;
 6500|      0|                        }
 6501|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6502|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6503|  42.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 42.3k, False: 522]
  |  Branch (6503:47): [True: 31.6k, False: 10.7k]
  ------------------
 6504|  31.6k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 1.49k, False: 30.1k]
  |  Branch (6504:47): [True: 23.3k, False: 6.78k]
  |  Branch (6504:63): [True: 5.07k, False: 1.71k]
  |  Branch (6504:80): [True: 452, False: 1.26k]
  |  Branch (6504:97): [True: 1.26k, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  31.6k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  31.6k|                           return;
 6508|  31.6k|                        }
 6509|  11.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  11.2k|                                                                                                      end);
 6511|  11.2k|                        return;
 6512|  42.9k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  44.7k|                  }
 6515|  77.7k|               }
 6516|  34.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  77.7k|               return;
 6518|   104k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 104k, False: 9.72M]
  ------------------
 6519|   155k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 50.8k, False: 9.78M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|   155k|               if constexpr (counts::n_bool > 0) {
 6522|   155k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 154k, False: 636]
  |  Branch (6522:44): [True: 51.0k, False: 103k]
  |  Branch (6522:60): [True: 35.9k, False: 15.0k]
  |  Branch (6522:76): [True: 33.0k, False: 2.91k]
  |  Branch (6522:92): [True: 31.6k, False: 1.35k]
  ------------------
 6523|   123k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 5.47k, False: 117k]
  |  Branch (6523:60): [True: 4.25k, False: 1.22k]
  |  Branch (6523:76): [True: 2.58k, False: 1.67k]
  |  Branch (6523:92): [True: 1.30k, False: 1.28k]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  32.9k|                     const auto after_false = it + 5;
 6526|  32.9k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  32.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 25.9k, False: 6.99k]
  ------------------
 6529|  25.9k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 0, False: 25.9k]
  ------------------
 6530|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|      0|                           return;
 6532|      0|                        }
 6533|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6534|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6535|  25.9k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 25.5k, False: 462]
  |  Branch (6535:47): [True: 19.0k, False: 6.43k]
  ------------------
 6536|  19.0k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 1.08k, False: 17.9k]
  |  Branch (6536:47): [True: 2.54k, False: 15.4k]
  |  Branch (6536:63): [True: 6.75k, False: 8.68k]
  |  Branch (6536:80): [True: 8.04k, False: 646]
  |  Branch (6536:97): [True: 646, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  19.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  19.0k|                           return;
 6540|  19.0k|                        }
 6541|  6.89k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  6.89k|                                                                                                      end);
 6543|  6.89k|                        return;
 6544|  25.9k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  32.9k|                  }
 6547|   155k|               }
 6548|   129k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|   155k|               return;
 6550|  65.8k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 65.8k, False: 9.76M]
  ------------------
 6551|  92.7k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 26.8k, False: 9.80M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  92.7k|               if constexpr (counts::n_null > 0) {
 6554|  92.7k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 91.2k, False: 1.48k]
  |  Branch (6554:44): [True: 63.0k, False: 28.1k]
  |  Branch (6554:60): [True: 52.7k, False: 10.2k]
  |  Branch (6554:76): [True: 50.8k, False: 1.99k]
  ------------------
 6555|  56.9k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 9.92k, False: 30.5k]
  |  Branch (6555:60): [True: 8.83k, False: 1.09k]
  |  Branch (6555:76): [True: 6.09k, False: 2.73k]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  56.9k|                     const auto after_null = it + 4;
 6558|  56.9k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  56.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 44.8k, False: 12.0k]
  ------------------
 6561|  44.8k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 0, False: 44.8k]
  ------------------
 6562|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|      0|                           return;
 6564|      0|                        }
 6565|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6566|       |                        // "null: value" should parse as {null: value}, not as the null type
 6567|  44.8k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 43.9k, False: 956]
  |  Branch (6567:47): [True: 20.1k, False: 23.8k]
  ------------------
 6568|  20.1k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 294, False: 19.8k]
  |  Branch (6568:47): [True: 538, False: 19.2k]
  |  Branch (6568:63): [True: 17.7k, False: 1.50k]
  |  Branch (6568:80): [True: 542, False: 966]
  |  Branch (6568:97): [True: 966, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  20.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  20.1k|                           return;
 6572|  20.1k|                        }
 6573|  24.7k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  24.7k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  24.7k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 24.7k]
  ------------------
 6576|  24.7k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  24.7k|                        return;
 6578|  44.8k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  56.9k|                  }
 6581|  92.7k|               }
 6582|  47.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  92.7k|               return;
 6584|  2.89k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 2.89k, False: 9.83M]
  ------------------
 6585|       |               // Null indicator
 6586|  2.89k|               if constexpr (counts::n_null > 0) {
 6587|  2.89k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  2.89k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  2.89k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 2.89k]
  ------------------
 6590|  2.89k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  2.89k|                  return;
 6592|  2.89k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   308k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 308k, False: 9.52M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   308k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 6.64k, False: 302k]
  |  Branch (6596:41): [True: 179k, False: 122k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   186k|                  if constexpr (counts::n_array > 0) {
 6599|   186k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   186k|                                                                                                    end);
 6601|   186k|                     return;
 6602|   186k|                  }
 6603|   186k|               }
 6604|   308k|               if constexpr (counts::n_num > 0) {
 6605|   308k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 122k, False: 186k]
  |  Branch (6605:43): [True: 5.56k, False: 116k]
  |  Branch (6605:94): [True: 4.79k, False: 111k]
  ------------------
 6606|  10.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  10.3k|                     return;
 6608|  10.3k|                  }
 6609|   308k|               }
 6610|   298k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   308k|               return;
 6612|  47.9k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 47.9k, False: 9.78M]
  ------------------
 6613|   121k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 73.6k, False: 9.76M]
  ------------------
 6614|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6615|       |               // Try parsing as number speculatively, fall back to string on failure
 6616|   121k|               if constexpr (counts::n_num > 0) {
 6617|   121k|                  auto start_it = it;
 6618|   121k|                  auto temp_ctx = ctx.make_speculative();
 6619|   121k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|   121k|                                                                                               end);
 6621|   121k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|   121k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|   121k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 8.71k, False: 112k]
  ------------------
 6624|  8.71k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  8.71k|                     return; // Successfully parsed as number
 6626|  8.71k|                  }
 6627|   112k|                  it = start_it; // Restore and fall through to string
 6628|   112k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|   121k|               return;
 6631|  1.95M|            default:
  ------------------
  |  Branch (6631:13): [True: 1.95M, False: 7.87M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|  1.95M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 1.47M, False: 487k]
  |  Branch (6633:32): [True: 1.00M, False: 465k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  1.00M|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 29.6k, False: 975k]
  ------------------
 6636|  29.6k|                     return;
 6637|  29.6k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|   975k|                  if constexpr (counts::n_num > 0) {
 6640|   975k|                     auto start_it = it;
 6641|   975k|                     auto temp_ctx = ctx.make_speculative();
 6642|   975k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|   975k|                                                                                                  end);
 6644|   975k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|   975k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|   975k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 804k, False: 171k]
  ------------------
 6647|   804k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|   804k|                        return; // Successfully parsed as number
 6649|   804k|                     }
 6650|   171k|                     it = start_it; // Restore and fall through to string
 6651|   171k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|   975k|                  return;
 6655|  1.00M|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   953k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   953k|               return;
 6659|  9.83M|            }
 6660|  9.83M|         }
 6661|       |
 6662|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6663|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6664|       |
 6665|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6666|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6667|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6668|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6669|  9.83M|         error_code expansion_error{};
 6670|  9.83M|         std::string_view expansion_message{};
 6671|       |
 6672|  9.83M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  9.83M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  9.83M|            auto start = it;
 6675|       |
 6676|  9.83M|            V v{};
 6677|  9.83M|            auto temp_ctx = ctx.make_speculative();
 6678|  9.83M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  9.83M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  9.83M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  9.83M|            if (!bool(temp_ctx.error)) {
 6683|  9.83M|               value = std::move(v);
 6684|  9.83M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  9.83M|               return true;
 6686|  9.83M|            }
 6687|       |
 6688|  9.83M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  9.83M|               expansion_error = temp_ctx.error;
 6690|  9.83M|               expansion_message = temp_ctx.custom_error_message;
 6691|  9.83M|            }
 6692|  9.83M|            it = start;
 6693|  9.83M|            return false;
 6694|  9.83M|         };
 6695|       |
 6696|  9.83M|         bool parsed = false;
 6697|  9.83M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  9.83M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  9.83M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  9.83M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 9.83M]
  ------------------
 6702|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6702:17): [True: 0, False: 0]
  ------------------
 6703|      0|               ctx.error = expansion_error;
 6704|      0|               ctx.custom_error_message = expansion_message;
 6705|      0|            }
 6706|      0|            else {
 6707|      0|               ctx.error = error_code::no_matching_variant_type;
 6708|      0|            }
 6709|      0|         }
 6710|  9.83M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE10redispatchITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 6717|  2.57M|      {
 6718|  2.57M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|  2.57M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 476, False: 2.57M]
  ------------------
 6720|    476|            return;
 6721|  2.57M|         op<Opts>(value, ctx, it, end);
 6722|  2.57M|      }
_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|   731k|      {
  301|   731k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 731k]
  |  Branch (301:27): [True: 0, False: 731k]
  ------------------
  302|       |
  303|   731k|         ++it; // skip '*'
  304|   731k|         auto name = parse_anchor_name(it, end);
  305|   731k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 34, False: 731k]
  ------------------
  306|     34|            ctx.error = error_code::syntax_error;
  307|     34|            return true;
  308|     34|         }
  309|       |
  310|   731k|         auto anchor_it = ctx.anchors.find(name);
  311|   731k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 62, False: 731k]
  ------------------
  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|   731k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   731k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 173k, False: 557k]
  ------------------
  322|   173k|            return true;
  323|   173k|         }
  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|   557k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 440, False: 557k]
  ------------------
  329|    440|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    440|            return true;
  331|    440|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|   557k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   557k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 557k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   557k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 46, False: 557k]
  ------------------
  342|     46|            ctx.error = error_code::exceeded_max_expansion;
  343|     46|            ctx.custom_error_message = "alias expansion";
  344|     46|            return true;
  345|     46|         }
  346|       |
  347|   557k|         auto replay_it = span.begin;
  348|   557k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   557k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   557k|         ctx.indent_stack.clear();
  353|   557k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 50.5k, False: 506k]
  ------------------
  354|  50.5k|            ctx.push_indent(span.base_indent - 1);
  355|  50.5k|         }
  356|       |
  357|   557k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   557k|         using V = std::remove_cvref_t<T>;
  360|   557k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   557k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   557k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   557k|         return true;
  367|   557k|      }
_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_:
 5310|  1.52M|      {
 5311|  1.52M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  1.52M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  1.52M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  1.52M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  1.52M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 1.52M, False: 0]
  ------------------
 5321|  1.52M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  1.52M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|  1.55M|      {
 1961|  1.55M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 4.24k, False: 1.54M]
  ------------------
 1962|  4.24k|            return;
 1963|       |
 1964|  1.54M|         yaml::node_preamble_state preamble{};
 1965|  1.54M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 34.3k, False: 1.51M]
  ------------------
 1966|  1.54M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  34.3k|            return;
 1968|       |
 1969|  1.51M|         std::string str;
 1970|  1.51M|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|  1.51M|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 1.51M, False: 0]
  ------------------
 1973|  20.1k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 20.1k, False: 1.49M]
  ------------------
 1974|  20.1k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  20.1k|            break;
 1976|  2.97k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 2.97k, False: 1.51M]
  ------------------
 1977|  2.97k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  2.97k|            break;
 1979|  3.18k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 3.18k, False: 1.51M]
  ------------------
 1980|  10.6k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 7.47k, False: 1.50M]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  10.6k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  10.6k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 3.05k, False: 7.60k]
  ------------------
 1986|  10.6k|            break;
 1987|  1.48M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 1.48M, False: 33.7k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|       |               if (ctx.current_indent() >= 0) {
 1992|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|       |               }
 1994|       |               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|       |               }
 1998|       |            }
 1999|  1.48M|            else {
 2000|  1.48M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|  1.48M|            }
 2002|  1.48M|            break;
 2003|  1.51M|         }
 2004|       |
 2005|  1.51M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 1.51M, False: 208]
  ------------------
 2006|  1.51M|            value = std::move(str);
 2007|  1.51M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|  1.51M|         }
 2009|  1.51M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.54M|      {
  466|  1.54M|         skip_inline_ws(it, end);
  467|       |
  468|  1.54M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 1.54M]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|  1.54M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.54M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 10, False: 1.54M]
  ------------------
  477|     10|            ctx.error = error_code::syntax_error;
  478|     10|            return true;
  479|     10|         }
  480|  1.54M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.54M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.54M|         skip_inline_ws(it, end);
  486|       |
  487|  1.54M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.54M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.54M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 34.3k, False: 1.51M]
  ------------------
  495|  34.3k|            return true;
  496|  34.3k|         }
  497|       |
  498|  1.51M|         return false;
  499|  1.54M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|  1.54M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.54M|      {
  409|  1.54M|         state.has_anchor = false;
  410|  1.54M|         state.anchor_name.clear();
  411|  1.54M|         state.anchor_start = nullptr;
  412|  1.54M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.54M|         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.54M|            else {
  421|  1.54M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 34.3k, False: 1.51M]
  ------------------
  422|  1.54M|            }
  423|  1.54M|         }
  424|       |
  425|  1.54M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.51M, False: 34.3k]
  |  Branch (425:27): [True: 75.2k, False: 1.43M]
  ------------------
  426|  75.2k|            ++it;
  427|  75.2k|            auto name = parse_anchor_name(it, end);
  428|  75.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 75.2k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  75.2k|            skip_inline_ws(it, end);
  433|  75.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 75.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|  75.1k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  75.1k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 75.1k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  75.1k|            }
  445|  75.1k|            state.has_anchor = true;
  446|  75.1k|            state.anchor_name = std::string(name);
  447|  75.1k|            state.anchor_start = &*it;
  448|  75.1k|         }
  449|       |
  450|  1.54M|         return false;
  451|  1.54M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  1.54M|      {
  301|  1.54M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.54M]
  |  Branch (301:27): [True: 1.51M, False: 34.3k]
  ------------------
  302|       |
  303|  34.3k|         ++it; // skip '*'
  304|  34.3k|         auto name = parse_anchor_name(it, end);
  305|  34.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 34.2k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|  34.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  34.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 34, False: 34.2k]
  ------------------
  312|     34|            ctx.error = error_code::syntax_error; // undefined alias
  313|     34|            return true;
  314|     34|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  34.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  34.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.17k, False: 32.0k]
  ------------------
  322|  2.17k|            return true;
  323|  2.17k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  32.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 32.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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  32.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  32.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 18, False: 32.0k]
  ------------------
  339|     18|            return true;
  340|       |
  341|  32.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 28, False: 32.0k]
  ------------------
  342|     28|            ctx.error = error_code::exceeded_max_expansion;
  343|     28|            ctx.custom_error_message = "alias expansion";
  344|     28|            return true;
  345|     28|         }
  346|       |
  347|  32.0k|         auto replay_it = span.begin;
  348|  32.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  32.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  32.0k|         ctx.indent_stack.clear();
  353|  32.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 13.8k, False: 18.2k]
  ------------------
  354|  13.8k|            ctx.push_indent(span.base_indent - 1);
  355|  13.8k|         }
  356|       |
  357|  32.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  32.0k|         using V = std::remove_cvref_t<T>;
  360|  32.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  32.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  32.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  32.0k|         return true;
  367|  32.0k|      }
_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_:
 5310|  1.12M|      {
 5311|  1.12M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  1.12M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  1.12M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  1.12M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  1.12M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 1.12M, False: 0]
  ------------------
 5321|  1.12M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  1.12M|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|  1.12M|      {
 2116|  1.12M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 1.12M]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  1.12M|         yaml::node_preamble_state preamble{};
 2120|  1.12M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 12.2k, False: 1.11M]
  ------------------
 2121|  1.12M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  1.12M|                   return yaml::tag_valid_for_float(tag);
 2123|  1.12M|                }
 2124|  1.12M|                else {
 2125|  1.12M|                   return yaml::tag_valid_for_int(tag);
 2126|  1.12M|                }
 2127|  1.12M|             }))
 2128|  12.2k|            return;
 2129|       |
 2130|  1.11M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  1.11M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  1.11M|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  1.11M|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 76.7k, False: 1.04M]
  ------------------
 2138|  76.7k|               ++it;
 2139|  76.7k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 69.9k, False: 6.79k]
  |  Branch (2139:38): [True: 1.85k, False: 68.1k]
  |  Branch (2139:74): [True: 622, False: 67.4k]
  ------------------
 2140|  67.4k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 406, False: 67.0k]
  ------------------
 2141|  2.88k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  2.88k|                  it += 3;
 2143|  2.88k|                  finalize();
 2144|  2.88k|                  return;
 2145|  2.88k|               }
 2146|  73.8k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 67.0k, False: 6.79k]
  |  Branch (2146:38): [True: 1.24k, False: 65.8k]
  |  Branch (2146:74): [True: 968, False: 64.8k]
  ------------------
 2147|  64.8k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 2.68k, False: 62.1k]
  ------------------
 2148|  4.89k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  4.89k|                  it += 3;
 2150|  4.89k|                  finalize();
 2151|  4.89k|                  return;
 2152|  4.89k|               }
 2153|  68.9k|               it = start;
 2154|  68.9k|            }
 2155|       |
 2156|  1.10M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 10.7k, False: 1.09M]
  |  Branch (2156:31): [True: 47.9k, False: 1.05M]
  ------------------
 2157|  58.6k|               const char sign = *it;
 2158|  58.6k|               ++it;
 2159|  58.6k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 57.1k, False: 1.48k]
  |  Branch (2159:33): [True: 8.00k, False: 49.1k]
  ------------------
 2160|  8.00k|                  ++it;
 2161|  8.00k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 7.69k, False: 310]
  |  Branch (2161:41): [True: 3.10k, False: 4.58k]
  |  Branch (2161:77): [True: 1.25k, False: 3.33k]
  ------------------
 2162|  6.78k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 2.42k, False: 912]
  ------------------
 2163|  6.78k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 4.23k, False: 2.54k]
  ------------------
 2164|  4.23k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  4.23k|                     }
 2166|  2.54k|                     else {
 2167|  2.54k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  2.54k|                     }
 2169|  6.78k|                     it += 3;
 2170|  6.78k|                     finalize();
 2171|  6.78k|                     return;
 2172|  6.78k|                  }
 2173|  8.00k|               }
 2174|  51.8k|               it = start;
 2175|  51.8k|            }
 2176|  1.10M|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  1.10M|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  60.2M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 60.2M, False: 20.4k]
  ------------------
 2183|  60.2M|            const char c = *it;
 2184|  60.2M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 48.6k, False: 60.2M]
  |  Branch (2184:29): [True: 44.0k, False: 60.1M]
  |  Branch (2184:42): [True: 48.0k, False: 60.1M]
  |  Branch (2184:55): [True: 11.8k, False: 60.1M]
  |  Branch (2184:68): [True: 886k, False: 59.2M]
  |  Branch (2184:80): [True: 9.69k, False: 59.2M]
  |  Branch (2184:92): [True: 3.57k, False: 59.2M]
  |  Branch (2184:104): [True: 26.1k, False: 59.1M]
  ------------------
 2185|  1.07M|               break;
 2186|  1.07M|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  59.1M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 19.1M, False: 39.9M]
  ------------------
 2189|  19.1M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 2.51k, False: 19.1M]
  |  Branch (2189:39): [True: 12.4k, False: 19.1M]
  |  Branch (2189:59): [True: 412, False: 19.1M]
  |  Branch (2189:80): [True: 1.20k, False: 19.1M]
  |  Branch (2189:101): [True: 1.34k, False: 19.1M]
  ------------------
 2190|  17.9k|                  break;
 2191|  17.9k|               }
 2192|  19.1M|            }
 2193|  59.1M|            ++it;
 2194|  59.1M|         }
 2195|       |
 2196|  1.11M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  1.11M|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 898, False: 1.11M]
  ------------------
 2199|    898|            ctx.error = error_code::parse_number_failure;
 2200|    898|            return;
 2201|    898|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  1.11M|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  1.11M|            bool negative = false;
 2254|  1.11M|            std::string_view digits = num_str;
 2255|       |
 2256|  1.11M|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 1.10M, False: 14.5k]
  |  Branch (2256:37): [True: 45.3k, False: 1.05M]
  |  Branch (2256:62): [True: 6.49k, False: 1.05M]
  ------------------
 2257|  51.8k|               negative = (digits.front() == '-');
 2258|  51.8k|               digits.remove_prefix(1);
 2259|  51.8k|            }
 2260|       |
 2261|  1.11M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 221k, False: 895k]
  |  Branch (2261:38): [True: 78.4k, False: 142k]
  ------------------
 2262|  78.4k|               int base = 10;
 2263|  78.4k|               size_t offset = 0;
 2264|       |
 2265|  78.4k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 6.26k, False: 72.1k]
  |  Branch (2265:40): [True: 606, False: 71.5k]
  ------------------
 2266|  6.87k|                  base = 16;
 2267|  6.87k|                  offset = 2;
 2268|  6.87k|               }
 2269|  71.5k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 490, False: 71.0k]
  |  Branch (2269:45): [True: 2.59k, False: 68.4k]
  ------------------
 2270|  3.08k|                  base = 8;
 2271|  3.08k|                  offset = 2;
 2272|  3.08k|               }
 2273|  68.4k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 1.19k, False: 67.2k]
  |  Branch (2273:45): [True: 1.61k, False: 65.6k]
  ------------------
 2274|  2.80k|                  base = 2;
 2275|  2.80k|                  offset = 2;
 2276|  2.80k|               }
 2277|       |
 2278|  78.4k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 12.7k, False: 65.6k]
  ------------------
 2279|  12.7k|                  auto raw_digits = digits.substr(offset);
 2280|  12.7k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  12.7k|                  std::string clean_storage;
 2283|  12.7k|                  std::string_view clean_view;
 2284|  12.7k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 5.15k, False: 7.61k]
  ------------------
 2285|  5.15k|                     clean_storage.reserve(raw_digits.size());
 2286|  2.18M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 2.18M, False: 5.15k]
  ------------------
 2287|  2.18M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 2.16M, False: 14.9k]
  ------------------
 2288|  2.16M|                           clean_storage.push_back(c);
 2289|  2.16M|                        }
 2290|  2.18M|                     }
 2291|  5.15k|                     clean_view = clean_storage;
 2292|  5.15k|                  }
 2293|  7.61k|                  else {
 2294|  7.61k|                     clean_view = raw_digits;
 2295|  7.61k|                  }
 2296|       |
 2297|  12.7k|                  uint64_t parsed_int{};
 2298|  12.7k|                  auto [ptr, ec] =
 2299|  12.7k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  12.7k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 4.97k, False: 7.79k]
  |  Branch (2300:44): [True: 2.69k, False: 5.10k]
  ------------------
 2301|  7.66k|                     ctx.error = error_code::parse_number_failure;
 2302|  7.66k|                     finalize();
 2303|  7.66k|                     return;
 2304|  7.66k|                  }
 2305|       |
 2306|  5.10k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  5.10k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 2.92k, False: 2.18k]
  ------------------
 2308|  5.10k|                  finalize();
 2309|  5.10k|                  return;
 2310|  12.7k|               }
 2311|  78.4k|            }
 2312|  1.11M|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  1.10M|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  1.11M|         std::string clean_storage;
 2318|  1.11M|         std::string_view clean_view;
 2319|       |
 2320|  1.11M|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 7.55k, False: 1.10M]
  ------------------
 2321|  7.55k|            clean_storage.reserve(num_str.size());
 2322|  38.3M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 38.3M, False: 7.55k]
  ------------------
 2323|  38.3M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 38.2M, False: 40.6k]
  ------------------
 2324|  38.2M|                  clean_storage.push_back(c);
 2325|  38.2M|               }
 2326|  38.3M|            }
 2327|  7.55k|            clean_view = clean_storage;
 2328|  7.55k|         }
 2329|  1.10M|         else {
 2330|  1.10M|            clean_view = num_str;
 2331|  1.10M|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  1.11M|         auto parse_view = clean_view;
 2336|  1.11M|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 1.08M, False: 27.4k]
  |  Branch (2336:37): [True: 45.3k, False: 1.04M]
  ------------------
 2337|  45.3k|            parse_view.remove_prefix(1);
 2338|  45.3k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 16.0k, False: 29.3k]
  ------------------
 2339|  16.0k|               ctx.error = error_code::parse_number_failure;
 2340|  16.0k|               return;
 2341|  16.0k|            }
 2342|  45.3k|         }
 2343|       |
 2344|  1.10M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  1.10M|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  1.10M|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 101k, False: 998k]
  |  Branch (2347:45): [True: 182k, False: 816k]
  ------------------
 2348|   256k|               ctx.error = error_code::parse_number_failure;
 2349|   256k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  1.10M|         finalize();
 2360|  1.10M|      }
_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|  1.12M|      {
  466|  1.12M|         skip_inline_ws(it, end);
  467|       |
  468|  1.12M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 336, False: 1.12M]
  ------------------
  469|    336|            if constexpr (!AllowEmptyInput) {
  470|    336|               ctx.error = error_code::unexpected_end;
  471|    336|            }
  472|    336|            return true;
  473|    336|         }
  474|       |
  475|  1.12M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.12M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 150, False: 1.12M]
  ------------------
  477|    150|            ctx.error = error_code::syntax_error;
  478|    150|            return true;
  479|    150|         }
  480|  1.12M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 62, False: 1.12M]
  ------------------
  481|     62|            ctx.error = error_code::syntax_error;
  482|     62|            return true;
  483|     62|         }
  484|       |
  485|  1.12M|         skip_inline_ws(it, end);
  486|       |
  487|  1.12M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 152, False: 1.12M]
  ------------------
  488|    152|            if constexpr (!AllowEmptyInput) {
  489|    152|               ctx.error = error_code::unexpected_end;
  490|    152|            }
  491|    152|            return true;
  492|    152|         }
  493|       |
  494|  1.12M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.5k, False: 1.11M]
  ------------------
  495|  11.5k|            return true;
  496|  11.5k|         }
  497|       |
  498|  1.11M|         return false;
  499|  1.12M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|  1.12M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  1.12M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  1.12M|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  1.12M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.12M|      {
  409|  1.12M|         state.has_anchor = false;
  410|  1.12M|         state.anchor_name.clear();
  411|  1.12M|         state.anchor_start = nullptr;
  412|  1.12M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.12M|         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.12M|            else {
  421|  1.12M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.9k, False: 1.11M]
  ------------------
  422|  1.12M|            }
  423|  1.12M|         }
  424|       |
  425|  1.12M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.11M, False: 10.9k]
  |  Branch (425:27): [True: 6.05k, False: 1.11M]
  ------------------
  426|  6.05k|            ++it;
  427|  6.05k|            auto name = parse_anchor_name(it, end);
  428|  6.05k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 302, False: 5.75k]
  ------------------
  429|    302|               ctx.error = error_code::syntax_error;
  430|    302|               return true;
  431|    302|            }
  432|  5.75k|            skip_inline_ws(it, end);
  433|  5.75k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 284, False: 5.46k]
  ------------------
  434|    284|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    284|                  ctx.error = error_code::unexpected_end;
  436|    284|               }
  437|    284|               return true;
  438|    284|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.46k|            state.has_anchor = true;
  446|  5.46k|            state.anchor_name = std::string(name);
  447|  5.46k|            state.anchor_start = &*it;
  448|  5.46k|         }
  449|       |
  450|  1.12M|         return false;
  451|  1.12M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  1.12M|      {
  301|  1.12M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.12M]
  |  Branch (301:27): [True: 1.11M, False: 10.9k]
  ------------------
  302|       |
  303|  10.9k|         ++it; // skip '*'
  304|  10.9k|         auto name = parse_anchor_name(it, end);
  305|  10.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 312, False: 10.6k]
  ------------------
  306|    312|            ctx.error = error_code::syntax_error;
  307|    312|            return true;
  308|    312|         }
  309|       |
  310|  10.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 804, False: 9.85k]
  ------------------
  312|    804|            ctx.error = error_code::syntax_error; // undefined alias
  313|    804|            return true;
  314|    804|         }
  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|  9.85k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  9.85k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 992, False: 8.85k]
  ------------------
  322|    992|            return true;
  323|    992|         }
  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.85k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 158, False: 8.70k]
  ------------------
  329|    158|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    158|            return true;
  331|    158|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  8.70k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.70k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 8.69k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  8.69k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 8.69k]
  ------------------
  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|  8.69k|         auto replay_it = span.begin;
  348|  8.69k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.69k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.69k|         ctx.indent_stack.clear();
  353|  8.69k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.88k, False: 6.81k]
  ------------------
  354|  1.88k|            ctx.push_indent(span.base_indent - 1);
  355|  1.88k|         }
  356|       |
  357|  8.69k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.69k|         using V = std::remove_cvref_t<T>;
  360|  8.69k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.69k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.69k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.69k|         return true;
  367|  8.69k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  1.10M|         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_:
 5310|  52.2k|      {
 5311|  52.2k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  52.2k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  52.2k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  52.2k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  52.2k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 52.2k, False: 0]
  ------------------
 5321|  52.2k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  52.2k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  65.0k|      {
 2081|  65.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 65.0k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  65.0k|         yaml::node_preamble_state preamble{};
 2085|  65.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 13.5k, False: 51.5k]
  ------------------
 2086|  65.0k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  13.5k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  51.5k|         std::string str;
 2091|  51.5k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  51.5k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 6.97k, False: 44.5k]
  |  Branch (2093:31): [True: 3.25k, False: 41.2k]
  |  Branch (2093:48): [True: 1.02k, False: 40.2k]
  |  Branch (2093:65): [True: 1.13k, False: 39.1k]
  |  Branch (2093:81): [True: 846, False: 38.2k]
  |  Branch (2093:97): [True: 382, False: 37.9k]
  ------------------
 2094|  37.9k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 1.51k, False: 36.3k]
  |  Branch (2094:29): [True: 1.43k, False: 34.9k]
  |  Branch (2094:44): [True: 2.10k, False: 32.8k]
  ------------------
 2095|  18.6k|            value = true;
 2096|  18.6k|         }
 2097|  32.8k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 12.1k, False: 20.6k]
  |  Branch (2097:37): [True: 2.22k, False: 18.4k]
  |  Branch (2097:55): [True: 3.50k, False: 14.9k]
  |  Branch (2097:73): [True: 1.81k, False: 13.1k]
  |  Branch (2097:88): [True: 9.34k, False: 3.79k]
  |  Branch (2097:103): [True: 292, False: 3.50k]
  ------------------
 2098|  32.6k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 1.03k, False: 2.47k]
  |  Branch (2098:35): [True: 586, False: 1.88k]
  |  Branch (2098:51): [True: 1.69k, False: 194]
  ------------------
 2099|  32.6k|            value = false;
 2100|  32.6k|         }
 2101|    194|         else {
 2102|    194|            ctx.error = error_code::expected_true_or_false;
 2103|    194|         }
 2104|       |
 2105|  51.5k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  51.5k|      }
_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|  65.0k|      {
  466|  65.0k|         skip_inline_ws(it, end);
  467|       |
  468|  65.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 65.0k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  65.0k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  65.0k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 65.0k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  65.0k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 65.0k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  65.0k|         skip_inline_ws(it, end);
  486|       |
  487|  65.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 65.0k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  65.0k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.5k, False: 51.5k]
  ------------------
  495|  13.5k|            return true;
  496|  13.5k|         }
  497|       |
  498|  51.5k|         return false;
  499|  65.0k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  65.0k|                                             [](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|  65.0k|      {
  409|  65.0k|         state.has_anchor = false;
  410|  65.0k|         state.anchor_name.clear();
  411|  65.0k|         state.anchor_start = nullptr;
  412|  65.0k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  65.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|  65.0k|            else {
  421|  65.0k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 13.5k, False: 51.5k]
  ------------------
  422|  65.0k|            }
  423|  65.0k|         }
  424|       |
  425|  65.0k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 51.5k, False: 13.5k]
  |  Branch (425:27): [True: 12.3k, False: 39.2k]
  ------------------
  426|  12.3k|            ++it;
  427|  12.3k|            auto name = parse_anchor_name(it, end);
  428|  12.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 12.3k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  12.3k|            skip_inline_ws(it, end);
  433|  12.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 12.2k]
  ------------------
  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|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  12.2k|            state.has_anchor = true;
  446|  12.2k|            state.anchor_name = std::string(name);
  447|  12.2k|            state.anchor_start = &*it;
  448|  12.2k|         }
  449|       |
  450|  65.0k|         return false;
  451|  65.0k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  65.0k|      {
  301|  65.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 65.0k]
  |  Branch (301:27): [True: 51.5k, False: 13.5k]
  ------------------
  302|       |
  303|  13.5k|         ++it; // skip '*'
  304|  13.5k|         auto name = parse_anchor_name(it, end);
  305|  13.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 13.4k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  13.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  13.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 40, False: 13.4k]
  ------------------
  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|  13.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  13.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 658, False: 12.7k]
  ------------------
  322|    658|            return true;
  323|    658|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  12.7k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 0, False: 12.7k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  12.7k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.7k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 12.7k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  12.7k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 12.7k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  12.7k|         auto replay_it = span.begin;
  348|  12.7k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  12.7k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  12.7k|         ctx.indent_stack.clear();
  353|  12.7k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.75k, False: 10.0k]
  ------------------
  354|  2.75k|            ctx.push_indent(span.base_indent - 1);
  355|  2.75k|         }
  356|       |
  357|  12.7k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  12.7k|         using V = std::remove_cvref_t<T>;
  360|  12.7k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  12.7k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  12.7k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  12.7k|         return true;
  367|  12.7k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  30.1k|      {
 2467|  30.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 30.1k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  30.1k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  30.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 10, False: 30.1k]
  ------------------
 2473|     10|            ctx.error = error_code::unexpected_end;
 2474|     10|            return;
 2475|     10|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  30.1k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 2.89k, False: 27.2k]
  ------------------
 2479|  2.89k|            ++it;
 2480|  2.89k|            return;
 2481|  2.89k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  27.2k|         auto start = it;
 2485|   126k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 125k, False: 972]
  |  Branch (2485:30): [True: 99.1k, False: 26.2k]
  ------------------
 2486|  99.1k|            ++it;
 2487|  99.1k|         }
 2488|       |
 2489|  27.2k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  27.2k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 30, False: 27.2k]
  ------------------
 2491|     30|            ctx.error = error_code::syntax_error;
 2492|     30|         }
 2493|  27.2k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|  3.63M|      {
 5311|  3.63M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  3.63M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  3.63M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  3.63M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  3.63M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 3.63M, False: 0]
  ------------------
 5321|  3.63M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  3.63M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|  3.68M|      {
 4617|  3.68M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 3.68M]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|  3.68M|         yaml::node_preamble_state preamble{};
 4621|  3.68M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 52.6k, False: 3.62M]
  ------------------
 4622|  3.68M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  52.6k|            return;
 4624|       |
 4625|  3.62M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|  3.62M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 1.77k, False: 3.62M]
  ------------------
 4627|  1.77k|            return;
 4628|       |
 4629|  3.62M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|  3.62M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4631|       |
 4632|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4633|       |         // value of a key that existed before the read and adds new keys, while
 4634|       |         // pre-existing keys the document does not mention are preserved (like a
 4635|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4636|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4637|       |         // mappings disallow duplicate keys and the conformance suite expects
 4638|       |         // first-wins, which falls out of emplace into an empty map. Any
 4639|       |         // pre-existing entry the document leaves untouched is restored on scope
 4640|       |         // exit (including error paths). When the target starts empty (the common
 4641|       |         // case) this is a no-op with negligible cost.
 4642|  3.62M|         std::remove_cvref_t<T> preexisting_entries;
 4643|  3.62M|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 3.62M]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|  3.62M|         struct merge_restore_guard
 4648|  3.62M|         {
 4649|  3.62M|            std::remove_cvref_t<T>& target;
 4650|  3.62M|            std::remove_cvref_t<T>& saved;
 4651|  3.62M|            ~merge_restore_guard()
 4652|  3.62M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  3.62M|               for (auto& entry : saved) {
 4656|  3.62M|                  target.emplace(entry.first, std::move(entry.second));
 4657|  3.62M|               }
 4658|  3.62M|            }
 4659|  3.62M|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|  3.62M|         const bool treat_as_block_mapping =
 4662|  3.62M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [Folded, False: 3.62M]
  |  Branch (4662:48): [True: 0, False: 0]
  |  Branch (4662:62): [True: 0, False: 0]
  ------------------
 4663|       |
 4664|  3.62M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 2.65M, False: 969k]
  |  Branch (4664:28): [True: 0, Folded]
  ------------------
 4665|       |            // Flow mapping
 4666|  2.65M|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  2.65M|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  2.65M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 2.65M, False: 6.18k]
  |  Branch (4670:30): [True: 25.9k, False: 2.62M]
  ------------------
 4671|  25.9k|               ++it;
 4672|  25.9k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  25.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 6, False: 25.9k]
  ------------------
 4674|      6|                  return;
 4675|  25.9k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  25.9k|               return;
 4677|  25.9k|            }
 4678|       |
 4679|  7.25M|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 7.24M, False: 17.1k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  7.24M|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  7.24M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 7.24M, False: 0]
  |  Branch (4683:33): [True: 42.6k, False: 7.19M]
  ------------------
 4684|  42.6k|                  ++it;
 4685|  42.6k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  42.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 6, False: 42.6k]
  ------------------
 4687|      6|                     return;
 4688|  42.6k|                  break;
 4689|  42.6k|               }
 4690|       |
 4691|  7.19M|               bool explicit_flow_key = false;
 4692|  7.19M|               auto explicit_probe = it;
 4693|  7.19M|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  7.19M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 7.19M, False: 0]
  |  Branch (4694:45): [True: 126k, False: 7.07M]
  ------------------
 4695|   126k|                  const auto after_q = explicit_probe + 1;
 4696|   126k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 10, False: 126k]
  |  Branch (4696:41): [True: 65.2k, False: 60.8k]
  ------------------
 4697|  72.3k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 5.78k, False: 55.0k]
  |  Branch (4697:42): [True: 1.22k, False: 53.8k]
  ------------------
 4698|  72.3k|                     explicit_flow_key = true;
 4699|  72.3k|                     it = explicit_probe + 1;
 4700|  72.3k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  72.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 6, False: 72.3k]
  ------------------
 4702|      6|                        return;
 4703|  72.3k|                  }
 4704|   126k|               }
 4705|       |               // Parse key
 4706|  7.19M|               key_t key{};
 4707|  7.19M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  7.19M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 72.3k, False: 7.12M]
  |  Branch (4708:44): [True: 72.2k, False: 10]
  |  Branch (4708:58): [True: 2.07k, False: 70.2k]
  |  Branch (4708:72): [True: 46.5k, False: 23.6k]
  |  Branch (4708:86): [True: 1.37k, False: 22.2k]
  ------------------
 4709|  50.0k|                     key.clear();
 4710|  50.0k|                  }
 4711|  7.14M|                  else {
 4712|  7.14M|                     auto key_probe = it;
 4713|  7.14M|                     yaml::skip_inline_ws(key_probe, end);
 4714|       |
 4715|       |                     // Use full node parsing only for structurally complex flow keys.
 4716|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4717|  7.14M|                     bool parse_complex_flow_key = false;
 4718|  7.14M|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 7.14M, False: 10]
  ------------------
 4719|  7.14M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 44.1k, False: 7.10M]
  |  Branch (4719:50): [True: 67.3k, False: 7.03M]
  ------------------
 4720|   111k|                           parse_complex_flow_key = true;
 4721|   111k|                        }
 4722|  7.03M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 2.43M, False: 4.60M]
  ------------------
 4723|  2.43M|                           ++key_probe;
 4724|  2.43M|                           yaml::parse_anchor_name(key_probe, end);
 4725|  2.43M|                           yaml::skip_inline_ws(key_probe, end);
 4726|  2.43M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 2.43M, False: 38]
  |  Branch (4726:53): [True: 11.2k, False: 2.42M]
  |  Branch (4726:74): [True: 1.13M, False: 1.28M]
  ------------------
 4727|  1.14M|                              parse_complex_flow_key = true;
 4728|  1.14M|                           }
 4729|  2.43M|                        }
 4730|  7.14M|                     }
 4731|       |
 4732|  7.14M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 1.25M, False: 5.88M]
  ------------------
 4733|  1.25M|                        glz::generic key_node{};
 4734|  1.25M|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  1.25M|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 3.16k, False: 1.25M]
  ------------------
 4736|  3.16k|                           return;
 4737|  1.25M|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 10, False: 1.25M]
  ------------------
 4738|     10|                           return;
 4739|  1.25M|                     }
 4740|  5.88M|                     else {
 4741|  5.88M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 86.8k, False: 5.80M]
  ------------------
 4742|  86.8k|                           return;
 4743|  86.8k|                        }
 4744|  5.88M|                     }
 4745|  7.14M|                  }
 4746|       |               }
 4747|       |               else {
 4748|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4749|       |                     ctx.error = error_code::syntax_error;
 4750|       |                     return;
 4751|       |                  }
 4752|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4753|       |                  if (bool(ctx.error)) [[unlikely]]
 4754|       |                     return;
 4755|       |               }
 4756|       |
 4757|       |               // Separation between flow key and ':' may include comments/newlines.
 4758|       |               // In flow context, newlines are allowed between key and ':'.
 4759|  7.10M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  7.19M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 10, False: 7.19M]
  ------------------
 4761|     10|                  return;
 4762|       |
 4763|  7.19M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  7.19M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  7.19M|                     val = {};
 4766|  7.19M|                     return true;
 4767|  7.19M|                  }
 4768|  7.19M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  7.19M|                     val = glz::generic{};
 4770|  7.19M|                     return true;
 4771|  7.19M|                  }
 4772|  7.19M|                  else {
 4773|  7.19M|                     static constexpr std::string_view null_value{"null"};
 4774|  7.19M|                     auto null_it = null_value.data();
 4775|  7.19M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  7.19M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  7.19M|                     return !bool(ctx.error);
 4778|  7.19M|                  }
 4779|  7.19M|               };
 4780|       |
 4781|  7.19M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 7.10M, False: 90.1k]
  |  Branch (4781:34): [True: 2.74M, False: 4.36M]
  |  Branch (4781:48): [True: 1.75M, False: 2.60M]
  ------------------
 4782|  4.50M|                  val_t val{};
 4783|  4.50M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 4.50M]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|  4.50M|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|  4.50M|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 1.75M, False: 2.74M]
  ------------------
 4789|  1.75M|                     ++it;
 4790|  1.75M|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  1.75M|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 10, False: 1.75M]
  ------------------
 4792|     10|                        return;
 4793|  1.75M|                     break;
 4794|  1.75M|                  }
 4795|       |
 4796|  2.74M|                  ++it; // skip comma
 4797|  2.74M|                  yaml::skip_ws_and_newlines(it, end);
 4798|  2.74M|                  continue;
 4799|  4.50M|               }
 4800|       |
 4801|  2.69M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 90.1k, False: 2.60M]
  |  Branch (4801:33): [True: 44, False: 2.60M]
  ------------------
 4802|    146|                  ctx.error = error_code::syntax_error;
 4803|    146|                  return;
 4804|    146|               }
 4805|  2.69M|               ++it;
 4806|       |
 4807|  2.69M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  2.69M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 10, False: 2.69M]
  ------------------
 4809|     10|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  2.69M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 2.60M, False: 90.0k]
  |  Branch (4812:34): [True: 233k, False: 2.37M]
  |  Branch (4812:48): [True: 36.9k, False: 2.33M]
  ------------------
 4813|   270k|                  val_t val{};
 4814|   270k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 270k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|   270k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|   270k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 36.9k, False: 233k]
  ------------------
 4820|  36.9k|                     ++it;
 4821|  36.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  36.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 6, False: 36.9k]
  ------------------
 4823|      6|                        return;
 4824|  36.9k|                     break;
 4825|  36.9k|                  }
 4826|       |
 4827|   233k|                  ++it; // skip comma
 4828|   233k|                  yaml::skip_ws_and_newlines(it, end);
 4829|   233k|                  continue;
 4830|   270k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  2.42M|               val_t val{};
 4834|  2.42M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  2.42M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 2.57k, False: 2.42M]
  ------------------
 4836|  2.57k|                  return;
 4837|       |
 4838|  2.42M|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  2.42M|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  2.42M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 2.33M, False: 90.0k]
  |  Branch (4842:33): [True: 669k, False: 1.66M]
  ------------------
 4843|   669k|                  ++it;
 4844|   669k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|   669k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 6, False: 669k]
  ------------------
 4846|      6|                     return;
 4847|   669k|                  break;
 4848|   669k|               }
 4849|  1.75M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 1.66M, False: 90.0k]
  |  Branch (4849:38): [True: 1.56M, False: 99.7k]
  ------------------
 4850|  1.56M|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  1.56M|                  yaml::skip_ws_and_newlines(it, end);
 4853|  1.56M|               }
 4854|   189k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 99.7k, False: 90.0k]
  |  Branch (4854:39): [True: 58.6k, False: 41.1k]
  |  Branch (4854:54): [True: 41.1k, False: 12]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  99.7k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  99.7k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 99.7k, False: 20]
  |  Branch (4858:36): [True: 14.4k, False: 85.3k]
  ------------------
 4859|  14.4k|                     ++it;
 4860|  14.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  14.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 6, False: 14.3k]
  ------------------
 4862|      6|                        return;
 4863|  14.3k|                     break;
 4864|  14.4k|                  }
 4865|  85.3k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 85.3k, False: 20]
  |  Branch (4865:36): [True: 85.3k, False: 22]
  ------------------
 4866|  85.3k|                     ++it;
 4867|  85.3k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  85.3k|                     continue;
 4869|  85.3k|                  }
 4870|     42|                  ctx.error = error_code::syntax_error;
 4871|     42|                  return;
 4872|  85.3k|               }
 4873|  90.0k|               else {
 4874|  90.0k|                  ctx.error = error_code::syntax_error;
 4875|  90.0k|                  return;
 4876|  90.0k|               }
 4877|  2.42M|            }
 4878|  2.63M|         }
 4879|   969k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   969k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   969k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   969k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   969k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   969k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   969k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   969k|                           if (ctx.stream_begin) {
 4893|   969k|                              auto is_line_content_start = [&](auto pos) {
 4894|   969k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   969k|                              };
 4896|       |
 4897|   969k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   969k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   969k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   969k|                                 return line != end && *line == ':';
 4901|   969k|                              };
 4902|       |
 4903|   969k|                              if (!is_line_content_start(it) &&
 4904|   969k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   969k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   969k|                                 ctx.error = error_code::syntax_error;
 4907|   969k|                                 return false;
 4908|   969k|                              }
 4909|   969k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   969k|                           }
 4911|   969k|                        }
 4912|       |
 4913|   969k|                        if (*it == '-' &&
 4914|   969k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   969k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   969k|                           ctx.error = error_code::syntax_error;
 4918|   969k|                           return false;
 4919|   969k|                        }
 4920|       |
 4921|   969k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   969k|                           return false;
 4923|   969k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   969k|                        ctx.pop_indent();
 4925|   969k|                     }
 4926|   969k|                     else {
 4927|   969k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   969k|                        if (nested_indent >= 0) {
 4929|   969k|                           yaml::skip_to_content(it, end);
 4930|   969k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   969k|                              ctx.error = error_code::syntax_error;
 4932|   969k|                              return false;
 4933|   969k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   969k|                           const int32_t value_indent =
 4937|   969k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   969k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   969k|                              return false;
 4940|   969k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   969k|                           ctx.pop_indent();
 4942|   969k|                        }
 4943|   969k|                     }
 4944|   969k|                     return !bool(ctx.error);
 4945|   969k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   969k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   969k|                     ctx.error = error_code::syntax_error;
 4952|   969k|                     return false;
 4953|   969k|                  }
 4954|   969k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   969k|                     ++it; // skip '?'
 4956|   969k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   969k|                     const int32_t explicit_value_indicator_indent =
 4959|   969k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   969k|                     key_t key{};
 4962|   969k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   969k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   969k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   969k|                        };
 4966|       |
 4967|   969k|                        auto key_it = it;
 4968|   969k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   969k|                        auto content = key_it;
 4971|   969k|                        yaml::skip_to_content(content, end);
 4972|   969k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   969k|                        if (content != end && *content == '&') {
 4978|   969k|                           auto anchor_probe = content + 1;
 4979|   969k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   969k|                           if (!anchor_name.empty()) {
 4981|   969k|                              auto after_anchor = anchor_probe;
 4982|   969k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   969k|                              auto value_indicator = after_anchor;
 4985|   969k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   969k|                                 key.clear();
 4987|   969k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   969k|                                 it = value_indicator;
 4989|   969k|                                 handled_anchor_only_empty_key = true;
 4990|   969k|                              }
 4991|   969k|                              else {
 4992|   969k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   969k|                                    yaml::skip_comment(value_indicator, end);
 4994|   969k|                                 }
 4995|   969k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   969k|                                    yaml::skip_newline(value_indicator, end);
 4997|   969k|                                    auto value_line = value_indicator;
 4998|   969k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   969k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   969k|                                       return false;
 5001|   969k|                                    if (value_line != end && *value_line == ':' &&
 5002|   969k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   969k|                                       key.clear();
 5004|   969k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   969k|                                       it = value_line;
 5006|   969k|                                       handled_anchor_only_empty_key = true;
 5007|   969k|                                    }
 5008|   969k|                                    else if (value_line != end && *value_line == ':') {
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|   969k|                                       ctx.error = error_code::syntax_error;
 5013|   969k|                                       return false;
 5014|   969k|                                    }
 5015|   969k|                                 }
 5016|   969k|                              }
 5017|   969k|                           }
 5018|   969k|                        }
 5019|       |
 5020|   969k|                        const bool key_content_spans_lines = [&] {
 5021|   969k|                           auto scan = key_it;
 5022|   969k|                           while (scan != content && scan != end) {
 5023|   969k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   969k|                              ++scan;
 5025|   969k|                           }
 5026|   969k|                           return false;
 5027|   969k|                        }();
 5028|       |
 5029|   969k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   969k|                        }
 5032|   969k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   969k|                           key.clear();
 5034|   969k|                           it = content;
 5035|   969k|                        }
 5036|   969k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   969k|                           auto key_node_it = content;
 5042|   969k|                           auto key_node_end = end;
 5043|   969k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   969k|                              auto scan = content;
 5048|   969k|                              while (scan != end) {
 5049|   969k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   969k|                                    ++scan;
 5051|   969k|                                 }
 5052|   969k|                                 if (scan == end) {
 5053|   969k|                                    break;
 5054|   969k|                                 }
 5055|       |
 5056|   969k|                                 yaml::skip_newline(scan, end);
 5057|   969k|                                 auto line_start = scan;
 5058|       |
 5059|   969k|                                 int32_t indicator_indent = 0;
 5060|   969k|                                 while (scan != end && *scan == ' ') {
 5061|   969k|                                    ++indicator_indent;
 5062|   969k|                                    ++scan;
 5063|   969k|                                 }
 5064|       |
 5065|   969k|                                 if (scan != end && *scan == ':') {
 5066|   969k|                                    const auto after_colon = scan + 1;
 5067|   969k|                                    if ((after_colon == end ||
 5068|   969k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   969k|                                        indicator_indent <= line_indent) {
 5070|   969k|                                       key_node_end = line_start;
 5071|   969k|                                       break;
 5072|   969k|                                    }
 5073|   969k|                                 }
 5074|   969k|                              }
 5075|   969k|                           }
 5076|       |
 5077|   969k|                           glz::generic key_node{};
 5078|   969k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   969k|                           ctx.explicit_mapping_key_context = true;
 5080|   969k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   969k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   969k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   969k|                              return false;
 5084|   969k|                           it = key_node_it;
 5085|   969k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   969k|                              return false;
 5087|   969k|                        }
 5088|   969k|                     }
 5089|   969k|                     else {
 5090|   969k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   969k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   969k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   969k|                              return false;
 5094|   969k|                        }
 5095|   969k|                     }
 5096|       |
 5097|   969k|                     yaml::skip_inline_ws(it, end);
 5098|   969k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   969k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   969k|                        auto probe = it;
 5103|   969k|                        bool found_value_indicator = false;
 5104|       |
 5105|   969k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   969k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   969k|                           auto value_line = probe;
 5109|   969k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   969k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   969k|                              return false;
 5112|       |
 5113|   969k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   969k|                              probe = value_line;
 5115|   969k|                              continue; // blank line
 5116|   969k|                           }
 5117|   969k|                           if (*value_line == '#') {
 5118|   969k|                              yaml::skip_comment(value_line, end);
 5119|   969k|                              probe = value_line;
 5120|   969k|                              continue; // comment-only line
 5121|   969k|                           }
 5122|   969k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   969k|                              it = value_line;
 5124|   969k|                              found_value_indicator = true;
 5125|   969k|                           }
 5126|   969k|                           break;
 5127|   969k|                        }
 5128|       |
 5129|   969k|                        if (found_value_indicator) {
 5130|   969k|                           yaml::skip_inline_ws(it, end);
 5131|   969k|                        }
 5132|   969k|                     }
 5133|       |
 5134|   969k|                     val_t val{};
 5135|   969k|                     if (it != end && *it == ':') {
 5136|   969k|                        ++it;
 5137|   969k|                        if (it != end && *it == '\t') {
 5138|   969k|                           ctx.error = error_code::syntax_error;
 5139|   969k|                           return false;
 5140|   969k|                        }
 5141|   969k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   969k|                           auto probe = it;
 5143|   969k|                           yaml::skip_newline(probe, end);
 5144|   969k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   969k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   969k|                              ctx.error = error_code::syntax_error;
 5147|   969k|                              return false;
 5148|   969k|                           }
 5149|   969k|                        }
 5150|   969k|                        yaml::skip_inline_ws(it, end);
 5151|   969k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   969k|                           return false;
 5153|   969k|                     }
 5154|       |
 5155|   969k|                     value.emplace(std::move(key), std::move(val));
 5156|   969k|                     return true;
 5157|   969k|                  }
 5158|       |
 5159|   969k|                  key_t key{};
 5160|   969k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   969k|                     auto key_probe = it;
 5162|   969k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   969k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   969k|                     if (complex_flow_key) {
 5165|   969k|                        glz::generic key_node{};
 5166|   969k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   969k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   969k|                           return false;
 5169|   969k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   969k|                           return false;
 5171|   969k|                     }
 5172|   969k|                     else {
 5173|   969k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   969k|                           return false;
 5175|   969k|                        }
 5176|   969k|                     }
 5177|   969k|                  }
 5178|   969k|                  else {
 5179|   969k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   969k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   969k|                        return false;
 5182|   969k|                  }
 5183|       |
 5184|   969k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   969k|                  if (it == end || *it != ':') {
 5187|   969k|                     ctx.error = error_code::syntax_error;
 5188|   969k|                     return false;
 5189|   969k|                  }
 5190|   969k|                  ++it;
 5191|   969k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   969k|                  val_t val{};
 5194|   969k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   969k|                     return false;
 5196|       |
 5197|   969k|                  value.emplace(std::move(key), std::move(val));
 5198|   969k|                  return true;
 5199|   969k|               });
 5200|   969k|         }
 5201|       |
 5202|  3.50M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|  3.50M|      }
_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.68M|      {
  466|  3.68M|         skip_inline_ws(it, end);
  467|       |
  468|  3.68M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 3.68M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  3.68M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  3.68M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 3.68M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  3.68M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 3.68M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  3.68M|         skip_inline_ws(it, end);
  486|       |
  487|  3.68M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 3.68M]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|  3.68M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 52.6k, False: 3.62M]
  ------------------
  495|  52.6k|            return true;
  496|  52.6k|         }
  497|       |
  498|  3.62M|         return false;
  499|  3.68M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|  3.68M|                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.68M|      {
  409|  3.68M|         state.has_anchor = false;
  410|  3.68M|         state.anchor_name.clear();
  411|  3.68M|         state.anchor_start = nullptr;
  412|  3.68M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  3.68M|         if constexpr (Policy.allow_alias) {
  415|  3.68M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  3.68M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 3.67M, False: 982]
  ------------------
  417|  3.67M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 52.5k, False: 3.62M]
  ------------------
  418|  3.67M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  3.68M|         }
  424|       |
  425|  3.68M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 3.62M, False: 52.5k]
  |  Branch (425:27): [True: 35.3k, False: 3.59M]
  ------------------
  426|  35.3k|            ++it;
  427|  35.3k|            auto name = parse_anchor_name(it, end);
  428|  35.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 35.2k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  35.2k|            skip_inline_ws(it, end);
  433|  35.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 35.2k]
  ------------------
  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|  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|  3.68M|         return false;
  451|  3.68M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  3.67M|      {
  301|  3.67M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 3.67M]
  |  Branch (301:27): [True: 3.62M, False: 52.5k]
  ------------------
  302|       |
  303|  52.5k|         ++it; // skip '*'
  304|  52.5k|         auto name = parse_anchor_name(it, end);
  305|  52.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 16, False: 52.5k]
  ------------------
  306|     16|            ctx.error = error_code::syntax_error;
  307|     16|            return true;
  308|     16|         }
  309|       |
  310|  52.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  52.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 48, False: 52.5k]
  ------------------
  312|     48|            ctx.error = error_code::syntax_error; // undefined alias
  313|     48|            return true;
  314|     48|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  52.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  52.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.79k, False: 47.7k]
  ------------------
  322|  4.79k|            return true;
  323|  4.79k|         }
  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|  47.7k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 52, False: 47.6k]
  ------------------
  329|     52|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     52|            return true;
  331|     52|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  47.6k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  47.6k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 47.6k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  47.6k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 56, False: 47.6k]
  ------------------
  342|     56|            ctx.error = error_code::exceeded_max_expansion;
  343|     56|            ctx.custom_error_message = "alias expansion";
  344|     56|            return true;
  345|     56|         }
  346|       |
  347|  47.6k|         auto replay_it = span.begin;
  348|  47.6k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  47.6k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  47.6k|         ctx.indent_stack.clear();
  353|  47.6k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.87k, False: 44.7k]
  ------------------
  354|  2.87k|            ctx.push_indent(span.base_indent - 1);
  355|  2.87k|         }
  356|       |
  357|  47.6k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  47.6k|         using V = std::remove_cvref_t<T>;
  360|  47.6k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  47.6k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  47.6k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  47.6k|         return true;
  367|  47.6k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|  4.77M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|       |                     val = {};
 4766|       |                     return true;
 4767|       |                  }
 4768|  4.77M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  4.77M|                     val = glz::generic{};
 4770|  4.77M|                     return true;
 4771|       |                  }
 4772|       |                  else {
 4773|       |                     static constexpr std::string_view null_value{"null"};
 4774|       |                     auto null_it = null_value.data();
 4775|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|       |                     return !bool(ctx.error);
 4778|       |                  }
 4779|  4.77M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   969k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   969k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 969k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   969k|         const int32_t parent_indent = ctx.current_indent();
 3722|   969k|         const bool discover_indent = (mapping_indent < 0);
 3723|   969k|         bool first_key = !discover_indent;
 3724|   969k|         bool discovered_first_key_mid_line = false;
 3725|   969k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.29M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.40M, False: 882k]
  ------------------
 3728|  1.40M|            auto line_start = it;
 3729|  1.40M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.40M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.23M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 2.21M, False: 17.8k]
  ------------------
 3733|  2.21M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 32.2k, False: 2.18M]
  ------------------
 3734|  32.2k|                  skip_comment(it, end);
 3735|  32.2k|                  skip_newline(it, end);
 3736|  32.2k|                  first_key = false;
 3737|  32.2k|                  line_indent = 0;
 3738|  32.2k|               }
 3739|  2.18M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 45.7k, False: 2.13M]
  |  Branch (3739:40): [True: 674k, False: 1.46M]
  ------------------
 3740|   720k|                  skip_newline(it, end);
 3741|   720k|                  first_key = false;
 3742|   720k|                  line_indent = 0;
 3743|   720k|               }
 3744|  1.46M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 257k, False: 1.20M]
  ------------------
 3745|   257k|                  line_start = it;
 3746|   257k|                  line_indent = 0;
 3747|   651k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 646k, False: 5.08k]
  |  Branch (3747:39): [True: 394k, False: 252k]
  ------------------
 3748|   394k|                     ++line_indent;
 3749|   394k|                     ++it;
 3750|   394k|                  }
 3751|       |
 3752|   257k|                  bool saw_tab = false;
 3753|   266k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 259k, False: 6.77k]
  |  Branch (3753:40): [True: 2.61k, False: 257k]
  |  Branch (3753:54): [True: 6.74k, False: 250k]
  ------------------
 3754|  9.36k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 5.27k, False: 4.08k]
  |  Branch (3754:43): [True: 4.08k, False: 0]
  ------------------
 3755|  9.36k|                     ++it;
 3756|  9.36k|                  }
 3757|       |
 3758|   257k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 6.77k, False: 250k]
  |  Branch (3758:36): [True: 4.12k, False: 246k]
  |  Branch (3758:51): [True: 5.66k, False: 240k]
  |  Branch (3758:66): [True: 5.43k, False: 235k]
  ------------------
 3759|  21.9k|                     first_key = false;
 3760|  21.9k|                     line_indent = 0;
 3761|  21.9k|                     continue; // Blank or comment line
 3762|  21.9k|                  }
 3763|       |
 3764|   235k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 12, False: 235k]
  ------------------
 3765|     12|                     ctx.error = error_code::syntax_error;
 3766|     12|                     return;
 3767|     12|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   235k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 229k, False: 6.05k]
  |  Branch (3770:46): [True: 694, False: 228k]
  ------------------
 3771|    694|                     it = line_start;
 3772|    694|                     return;
 3773|    694|                  }
 3774|       |
 3775|   234k|                  first_key = false;
 3776|   234k|                  break; // Found content
 3777|   235k|               }
 3778|  1.20M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 51.3k, False: 1.15M]
  ------------------
 3779|  51.3k|                  line_start = it;
 3780|   111k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 111k, False: 702]
  |  Branch (3780:40): [True: 5.89k, False: 105k]
  |  Branch (3780:54): [True: 54.7k, False: 50.6k]
  ------------------
 3781|  51.3k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 702, False: 50.6k]
  |  Branch (3781:36): [True: 3.55k, False: 47.0k]
  |  Branch (3781:51): [True: 45.9k, False: 1.07k]
  |  Branch (3781:66): [True: 1.05k, False: 18]
  ------------------
 3782|  51.2k|                     first_key = false;
 3783|  51.2k|                     line_indent = 0;
 3784|  51.2k|                     continue; // Blank or comment-only line with tab indentation
 3785|  51.2k|                  }
 3786|     18|                  ctx.error = error_code::syntax_error;
 3787|     18|                  return;
 3788|  51.3k|               }
 3789|  1.15M|               else {
 3790|  1.15M|                  line_start = it;
 3791|  1.15M|                  break; // Content at column 0
 3792|  1.15M|               }
 3793|  2.21M|            }
 3794|       |
 3795|  1.40M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 17.8k, False: 1.39M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.39M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 3.70k, False: 1.38M]
  |  Branch (3799:45): [True: 1.48k, False: 1.38M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.38M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.38M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.38M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.38M, False: 0]
  |  Branch (3806:39): [True: 421k, False: 964k]
  |  Branch (3806:62): [True: 56.4k, False: 365k]
  |  Branch (3806:84): [True: 32.2k, False: 24.1k]
  ------------------
 3807|  32.2k|                  it = line_start;
 3808|  32.2k|                  return;
 3809|  32.2k|               }
 3810|  1.35M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 389k, False: 964k]
  |  Branch (3810:43): [True: 346, False: 388k]
  ------------------
 3811|    346|                  it = line_start;
 3812|    346|                  return;
 3813|    346|               }
 3814|  1.35M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.35M|            bool established_mapping_indent_this_line = false;
 3818|  1.35M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 964k, False: 388k]
  ------------------
 3819|   964k|               mapping_indent = line_indent;
 3820|   964k|               established_mapping_indent_this_line = true;
 3821|   964k|               discovered_first_key_visual_indent = line_indent;
 3822|   964k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   964k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 964k, False: 0]
  |  Branch (3823:43): [True: 964k, False: 0]
  ------------------
 3824|   964k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   964k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 78, False: 964k]
  ------------------
 3826|     78|                        ctx.error = error_code::syntax_error;
 3827|     78|                        return;
 3828|     78|                     }
 3829|       |
 3830|   964k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   964k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 957k, False: 6.05k]
  |  Branch (3831:49): [True: 802k, False: 155k]
  ------------------
 3832|   802k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   802k|                     }
 3834|   964k|                  }
 3835|   964k|               }
 3836|   964k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.35M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.35M, False: 78]
  |  Branch (3840:36): [True: 1.35M, False: 0]
  |  Branch (3840:59): [True: 388k, False: 964k]
  ------------------
 3841|   388k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 203k, False: 185k]
  ------------------
 3842|   203k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 203k, False: 298]
  |  Branch (3842:43): [True: 136k, False: 67.1k]
  ------------------
 3843|   136k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 46, False: 136k]
  ------------------
 3844|     46|                     ctx.error = error_code::syntax_error;
 3845|     46|                     return;
 3846|     46|                  }
 3847|   136k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 5.89k, False: 130k]
  ------------------
 3848|  5.89k|                     it = line_start;
 3849|  5.89k|                     return;
 3850|  5.89k|                  }
 3851|   136k|               }
 3852|  67.4k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 936, False: 66.5k]
  ------------------
 3853|    936|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 22, False: 914]
  |  Branch (3853:47): [True: 6, False: 908]
  ------------------
 3854|    908|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 908, False: 0]
  |  Branch (3854:49): [True: 908, False: 0]
  |  Branch (3854:72): [True: 6, False: 902]
  ------------------
 3855|     34|                  ctx.error = error_code::syntax_error;
 3856|     34|                  return;
 3857|     34|               }
 3858|   203k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.34M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.34M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.34M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.34M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.34M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 78, False: 1.34M]
  |  Branch (3876:32): [True: 0, False: 1.34M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.34M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 549k, False: 797k]
  |  Branch (3885:53): [True: 163k, False: 386k]
  |  Branch (3885:94): [True: 56.9k, False: 106k]
  ------------------
 3886|  56.9k|               const auto after_colon = it + 1;
 3887|  56.9k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 53.5k, False: 3.37k]
  ------------------
 3888|  56.9k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 526, False: 56.4k]
  |  Branch (3888:43): [True: 55.0k, False: 1.32k]
  ------------------
 3889|  55.5k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 1.31k, False: 54.2k]
  ------------------
 3890|  1.31k|                  it = line_start;
 3891|  1.31k|                  return;
 3892|  1.31k|               }
 3893|  56.9k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.34M|            int32_t effective_line_indent = line_indent;
 3897|  1.34M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.34M, False: 78]
  |  Branch (3897:36): [True: 964k, False: 381k]
  ------------------
 3898|   964k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 802k, False: 161k]
  ------------------
 3899|   802k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 545k, False: 256k]
  |  Branch (3899:52): [True: 376k, False: 168k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   425k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   425k|            }
 3912|       |
 3913|  1.34M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 23.9k, False: 1.32M]
  ------------------
 3914|  23.9k|               return;
 3915|  23.9k|            }
 3916|  1.32M|            first_key = false;
 3917|       |
 3918|  1.32M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.32M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|  1.32M|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|  1.32M|               auto flow_end = it;
 3925|  1.32M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|  1.32M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 10, False: 1.32M]
  ------------------
 3927|     10|                  return;
 3928|  1.32M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 1.11M, False: 205k]
  |  Branch (3928:40): [True: 560k, False: 556k]
  |  Branch (3928:60): [True: 20.2k, False: 535k]
  |  Branch (3928:80): [True: 108k, False: 427k]
  ------------------
 3929|   689k|                  it = flow_end;
 3930|   689k|                  return;
 3931|   689k|               }
 3932|  1.32M|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.32M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 459k, False: 862k]
  ------------------
 3938|   459k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 91.8k, False: 367k]
  |  Branch (3938:34): [True: 4.27k, False: 363k]
  ------------------
 3939|  96.1k|                  auto peek = it;
 3940|  96.1k|                  skip_inline_ws(peek, end);
 3941|  96.1k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 90.5k, False: 5.54k]
  |  Branch (3941:38): [True: 85.6k, False: 4.91k]
  |  Branch (3941:55): [True: 83.9k, False: 1.77k]
  |  Branch (3941:72): [True: 78.0k, False: 5.88k]
  ------------------
 3942|  78.0k|                     continue; // At leading indent of new line
 3943|  78.0k|                  }
 3944|  96.1k|               }
 3945|   381k|               skip_inline_ws(it, end);
 3946|   381k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 375k, False: 5.54k]
  |  Branch (3946:33): [True: 16.9k, False: 358k]
  ------------------
 3947|  16.9k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  16.9k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 16.9k, False: 0]
  ------------------
 3949|  16.9k|                        const char prev = *(it - 1);
 3950|  16.9k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 7.62k, False: 9.28k]
  |  Branch (3950:44): [True: 4.18k, False: 3.44k]
  |  Branch (3950:60): [True: 3.01k, False: 1.16k]
  |  Branch (3950:76): [True: 6, False: 3.01k]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  16.9k|                     }
 3955|  16.9k|                  }
 3956|  16.9k|               }
 3957|  16.9k|               skip_comment(it, end);
 3958|   381k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 375k, False: 5.56k]
  |  Branch (3958:34): [True: 67.5k, False: 308k]
  |  Branch (3958:49): [True: 177k, False: 131k]
  ------------------
 3959|   244k|                  skip_newline(it, end);
 3960|   244k|               }
 3961|   136k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 131k, False: 5.56k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   131k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   131k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 40, False: 131k]
  ------------------
 3968|     40|                        ctx.error = error_code::syntax_error;
 3969|     40|                        return;
 3970|     40|                     }
 3971|   131k|                  }
 3972|   131k|               }
 3973|   381k|            }
 3974|  1.32M|         }
 3975|   969k|      }
_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:
 4882|  1.34M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.34M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.34M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.34M|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|  1.34M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.34M|                           if (ctx.stream_begin) {
 4893|  1.34M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.34M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.34M|                              };
 4896|       |
 4897|  1.34M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.34M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.34M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.34M|                                 return line != end && *line == ':';
 4901|  1.34M|                              };
 4902|       |
 4903|  1.34M|                              if (!is_line_content_start(it) &&
 4904|  1.34M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.34M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.34M|                                 ctx.error = error_code::syntax_error;
 4907|  1.34M|                                 return false;
 4908|  1.34M|                              }
 4909|  1.34M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.34M|                           }
 4911|  1.34M|                        }
 4912|       |
 4913|  1.34M|                        if (*it == '-' &&
 4914|  1.34M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.34M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.34M|                           ctx.error = error_code::syntax_error;
 4918|  1.34M|                           return false;
 4919|  1.34M|                        }
 4920|       |
 4921|  1.34M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.34M|                           return false;
 4923|  1.34M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.34M|                        ctx.pop_indent();
 4925|  1.34M|                     }
 4926|  1.34M|                     else {
 4927|  1.34M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.34M|                        if (nested_indent >= 0) {
 4929|  1.34M|                           yaml::skip_to_content(it, end);
 4930|  1.34M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.34M|                              ctx.error = error_code::syntax_error;
 4932|  1.34M|                              return false;
 4933|  1.34M|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  1.34M|                           const int32_t value_indent =
 4937|  1.34M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.34M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.34M|                              return false;
 4940|  1.34M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.34M|                           ctx.pop_indent();
 4942|  1.34M|                        }
 4943|  1.34M|                     }
 4944|  1.34M|                     return !bool(ctx.error);
 4945|  1.34M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.34M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 564k, False: 781k]
  |  Branch (4950:37): [True: 562k, False: 1.39k]
  |  Branch (4950:58): [True: 6, False: 562k]
  ------------------
 4951|      6|                     ctx.error = error_code::syntax_error;
 4952|      6|                     return false;
 4953|      6|                  }
 4954|  1.34M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 564k, False: 781k]
  |  Branch (4954:38): [True: 1.39k, False: 562k]
  |  Branch (4954:57): [True: 171k, False: 391k]
  |  Branch (4954:77): [True: 245k, False: 145k]
  |  Branch (4954:98): [True: 113k, False: 32.3k]
  ------------------
 4955|   531k|                     ++it; // skip '?'
 4956|   531k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   531k|                     const int32_t explicit_value_indicator_indent =
 4959|   531k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 381k, False: 150k]
  ------------------
 4960|       |
 4961|   531k|                     key_t key{};
 4962|   531k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   531k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   531k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   531k|                        };
 4966|       |
 4967|   531k|                        auto key_it = it;
 4968|   531k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   531k|                        auto content = key_it;
 4971|   531k|                        yaml::skip_to_content(content, end);
 4972|   531k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   531k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 525k, False: 5.87k]
  |  Branch (4977:47): [True: 189k, False: 336k]
  ------------------
 4978|   189k|                           auto anchor_probe = content + 1;
 4979|   189k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   189k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 189k, False: 28]
  ------------------
 4981|   189k|                              auto after_anchor = anchor_probe;
 4982|   189k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   189k|                              auto value_indicator = after_anchor;
 4985|   189k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 182k, False: 6.89k]
  |  Branch (4985:61): [True: 9.99k, False: 172k]
  ------------------
 4986|  9.99k|                                 key.clear();
 4987|  9.99k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  9.99k|                                 it = value_indicator;
 4989|  9.99k|                                 handled_anchor_only_empty_key = true;
 4990|  9.99k|                              }
 4991|   179k|                              else {
 4992|   179k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 172k, False: 6.89k]
  |  Branch (4992:64): [True: 17.4k, False: 155k]
  ------------------
 4993|  17.4k|                                    yaml::skip_comment(value_indicator, end);
 4994|  17.4k|                                 }
 4995|   179k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 172k, False: 6.90k]
  |  Branch (4995:65): [True: 32.9k, False: 139k]
  |  Branch (4995:93): [True: 53.2k, False: 86.3k]
  ------------------
 4996|  86.2k|                                    yaml::skip_newline(value_indicator, end);
 4997|  86.2k|                                    auto value_line = value_indicator;
 4998|  86.2k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  86.2k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 6, False: 86.2k]
  ------------------
 5000|      6|                                       return false;
 5001|  86.2k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 81.5k, False: 4.72k]
  |  Branch (5001:62): [True: 8.42k, False: 73.0k]
  ------------------
 5002|  8.42k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 8.42k, False: 6]
  ------------------
 5003|  8.42k|                                       key.clear();
 5004|  8.42k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  8.42k|                                       it = value_line;
 5006|  8.42k|                                       handled_anchor_only_empty_key = true;
 5007|  8.42k|                                    }
 5008|  77.8k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 73.1k, False: 4.72k]
  |  Branch (5008:67): [True: 6, False: 73.0k]
  ------------------
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|      6|                                       ctx.error = error_code::syntax_error;
 5013|      6|                                       return false;
 5014|      6|                                    }
 5015|  86.2k|                                 }
 5016|   179k|                              }
 5017|   189k|                           }
 5018|   189k|                        }
 5019|       |
 5020|   531k|                        const bool key_content_spans_lines = [&] {
 5021|   531k|                           auto scan = key_it;
 5022|   531k|                           while (scan != content && scan != end) {
 5023|   531k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   531k|                              ++scan;
 5025|   531k|                           }
 5026|   531k|                           return false;
 5027|   531k|                        }();
 5028|       |
 5029|   531k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 18.4k, False: 513k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  18.4k|                        }
 5032|   513k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 5.87k, False: 507k]
  |  Branch (5032:53): [True: 12.5k, False: 494k]
  |  Branch (5032:72): [True: 7.49k, False: 5.08k]
  ------------------
 5033|  13.3k|                           key.clear();
 5034|  13.3k|                           it = content;
 5035|  13.3k|                        }
 5036|   499k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   499k|                           auto key_node_it = content;
 5042|   499k|                           auto key_node_end = end;
 5043|   499k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   499k|                              auto scan = content;
 5048|  2.65M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 2.58M, False: 63.5k]
  ------------------
 5049|   421M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 421M, False: 305k]
  |  Branch (5049:56): [True: 420M, False: 1.04M]
  |  Branch (5049:73): [True: 418M, False: 1.23M]
  ------------------
 5050|   418M|                                    ++scan;
 5051|   418M|                                 }
 5052|  2.58M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 305k, False: 2.28M]
  ------------------
 5053|   305k|                                    break;
 5054|   305k|                                 }
 5055|       |
 5056|  2.28M|                                 yaml::skip_newline(scan, end);
 5057|  2.28M|                                 auto line_start = scan;
 5058|       |
 5059|  2.28M|                                 int32_t indicator_indent = 0;
 5060|  3.62M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 3.55M, False: 63.5k]
  |  Branch (5060:56): [True: 1.33M, False: 2.22M]
  ------------------
 5061|  1.33M|                                    ++indicator_indent;
 5062|  1.33M|                                    ++scan;
 5063|  1.33M|                                 }
 5064|       |
 5065|  2.28M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 2.22M, False: 63.5k]
  |  Branch (5065:53): [True: 197k, False: 2.02M]
  ------------------
 5066|   197k|                                    const auto after_colon = scan + 1;
 5067|   197k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 4.60k, False: 193k]
  ------------------
 5068|   193k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 161k, False: 32.1k]
  ------------------
 5069|   165k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 130k, False: 34.8k]
  ------------------
 5070|   130k|                                       key_node_end = line_start;
 5071|   130k|                                       break;
 5072|   130k|                                    }
 5073|   197k|                                 }
 5074|  2.28M|                              }
 5075|   499k|                           }
 5076|       |
 5077|   499k|                           glz::generic key_node{};
 5078|   499k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   499k|                           ctx.explicit_mapping_key_context = true;
 5080|   499k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   499k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   499k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 4.64k, False: 495k]
  ------------------
 5083|  4.64k|                              return false;
 5084|   495k|                           it = key_node_it;
 5085|   495k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 16, False: 495k]
  ------------------
 5086|     16|                              return false;
 5087|   495k|                        }
 5088|       |                     }
 5089|       |                     else {
 5090|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|       |                           if (bool(ctx.error)) [[unlikely]]
 5093|       |                              return false;
 5094|       |                        }
 5095|       |                     }
 5096|       |
 5097|   527k|                     yaml::skip_inline_ws(it, end);
 5098|   531k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   531k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 448k, False: 83.7k]
  |  Branch (5101:40): [True: 46.2k, False: 401k]
  |  Branch (5101:55): [True: 107k, False: 294k]
  ------------------
 5102|   153k|                        auto probe = it;
 5103|   153k|                        bool found_value_indicator = false;
 5104|       |
 5105|   196k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 182k, False: 13.6k]
  |  Branch (5105:49): [True: 57.7k, False: 124k]
  |  Branch (5105:67): [True: 124k, False: 0]
  ------------------
 5106|   182k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   182k|                           auto value_line = probe;
 5109|   182k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   182k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 8, False: 182k]
  ------------------
 5111|      8|                              return false;
 5112|       |
 5113|   182k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 12.8k, False: 169k]
  |  Branch (5113:53): [True: 5.96k, False: 163k]
  |  Branch (5113:76): [True: 11.4k, False: 152k]
  ------------------
 5114|  30.2k|                              probe = value_line;
 5115|  30.2k|                              continue; // blank line
 5116|  30.2k|                           }
 5117|   152k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 12.4k, False: 139k]
  ------------------
 5118|  12.4k|                              yaml::skip_comment(value_line, end);
 5119|  12.4k|                              probe = value_line;
 5120|  12.4k|                              continue; // comment-only line
 5121|  12.4k|                           }
 5122|   139k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 63.6k, False: 76.2k]
  |  Branch (5122:54): [True: 11.0k, False: 52.6k]
  ------------------
 5123|  11.0k|                              it = value_line;
 5124|  11.0k|                              found_value_indicator = true;
 5125|  11.0k|                           }
 5126|   139k|                           break;
 5127|   152k|                        }
 5128|       |
 5129|   153k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 11.0k, False: 142k]
  ------------------
 5130|  11.0k|                           yaml::skip_inline_ws(it, end);
 5131|  11.0k|                        }
 5132|   153k|                     }
 5133|       |
 5134|   531k|                     val_t val{};
 5135|   531k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 448k, False: 83.7k]
  |  Branch (5135:39): [True: 146k, False: 301k]
  ------------------
 5136|   146k|                        ++it;
 5137|   146k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 142k, False: 3.97k]
  |  Branch (5137:42): [True: 6, False: 142k]
  ------------------
 5138|      6|                           ctx.error = error_code::syntax_error;
 5139|      6|                           return false;
 5140|      6|                        }
 5141|   146k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 142k, False: 3.97k]
  |  Branch (5141:43): [True: 19.3k, False: 122k]
  |  Branch (5141:58): [True: 34.6k, False: 88.1k]
  ------------------
 5142|  54.0k|                           auto probe = it;
 5143|  54.0k|                           yaml::skip_newline(probe, end);
 5144|   146k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 134k, False: 11.5k]
  |  Branch (5144:51): [True: 92.1k, False: 42.5k]
  ------------------
 5145|  54.0k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 42.5k, False: 11.5k]
  |  Branch (5145:48): [True: 12.4k, False: 30.0k]
  |  Branch (5145:65): [True: 9.34k, False: 3.08k]
  |  Branch (5145:89): [True: 6, False: 9.33k]
  ------------------
 5146|      6|                              ctx.error = error_code::syntax_error;
 5147|      6|                              return false;
 5148|      6|                           }
 5149|  54.0k|                        }
 5150|   146k|                        yaml::skip_inline_ws(it, end);
 5151|   146k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 252, False: 145k]
  ------------------
 5152|    252|                           return false;
 5153|   146k|                     }
 5154|       |
 5155|   531k|                     value.emplace(std::move(key), std::move(val));
 5156|   531k|                     return true;
 5157|   531k|                  }
 5158|       |
 5159|   813k|                  key_t key{};
 5160|   813k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   813k|                     auto key_probe = it;
 5162|   813k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   813k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 813k, False: 0]
  |  Branch (5163:74): [True: 2.12k, False: 811k]
  |  Branch (5163:95): [True: 5.71k, False: 806k]
  ------------------
 5164|   813k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 7.84k, False: 806k]
  ------------------
 5165|  7.84k|                        glz::generic key_node{};
 5166|  7.84k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  7.84k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 868, False: 6.97k]
  ------------------
 5168|    868|                           return false;
 5169|  6.97k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 6, False: 6.96k]
  ------------------
 5170|      6|                           return false;
 5171|  6.97k|                     }
 5172|   806k|                     else {
 5173|   806k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 15.9k, False: 790k]
  ------------------
 5174|  15.9k|                           return false;
 5175|  15.9k|                        }
 5176|   806k|                     }
 5177|       |                  }
 5178|       |                  else {
 5179|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|       |                     if (bool(ctx.error)) [[unlikely]]
 5181|       |                        return false;
 5182|       |                  }
 5183|       |
 5184|   797k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   813k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 16.9k, False: 796k]
  |  Branch (5186:36): [True: 74, False: 796k]
  ------------------
 5187|    244|                     ctx.error = error_code::syntax_error;
 5188|    244|                     return false;
 5189|    244|                  }
 5190|   813k|                  ++it;
 5191|   813k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   813k|                  val_t val{};
 5194|   813k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 1.91k, False: 811k]
  ------------------
 5195|  1.91k|                     return false;
 5196|       |
 5197|   811k|                  value.emplace(std::move(key), std::move(val));
 5198|   811k|                  return true;
 5199|   813k|               });
_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:
 5020|   531k|                        const bool key_content_spans_lines = [&] {
 5021|   531k|                           auto scan = key_it;
 5022|   539k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 370k, False: 168k]
  |  Branch (5022:54): [True: 370k, False: 0]
  ------------------
 5023|   370k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 247k, False: 123k]
  |  Branch (5023:52): [True: 115k, False: 7.38k]
  ------------------
 5024|  7.38k|                              ++scan;
 5025|  7.38k|                           }
 5026|   168k|                           return false;
 5027|   531k|                        }();
_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_:
 4963|   495k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   495k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   495k|                        };
_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_:
 4883|   943k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   943k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 926k, False: 16.2k]
  |  Branch (4884:39): [True: 722k, False: 204k]
  ------------------
 4885|   722k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   722k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   722k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 722k, False: 0]
  ------------------
 4893|   722k|                              auto is_line_content_start = [&](auto pos) {
 4894|   722k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   722k|                              };
 4896|       |
 4897|   722k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   722k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   722k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   722k|                                 return line != end && *line == ':';
 4901|   722k|                              };
 4902|       |
 4903|   722k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 722k, False: 0]
  ------------------
 4904|   722k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 23.8k, False: 698k]
  ------------------
 4905|  23.8k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 66, False: 23.7k]
  ------------------
 4906|     66|                                 ctx.error = error_code::syntax_error;
 4907|     66|                                 return false;
 4908|     66|                              }
 4909|   722k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   722k|                           }
 4911|   722k|                        }
 4912|       |
 4913|   722k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 8.34k, False: 714k]
  ------------------
 4914|  8.34k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 220, False: 8.12k]
  |  Branch (4914:49): [True: 1.92k, False: 6.19k]
  ------------------
 4915|  2.14k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 12, False: 2.13k]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     12|                           ctx.error = error_code::syntax_error;
 4918|     12|                           return false;
 4919|     12|                        }
 4920|       |
 4921|   722k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 722k]
  ------------------
 4922|      0|                           return false;
 4923|   722k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   722k|                        ctx.pop_indent();
 4925|   722k|                     }
 4926|   220k|                     else {
 4927|   220k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   220k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 69.8k, False: 150k]
  ------------------
 4929|  69.8k|                           yaml::skip_to_content(it, end);
 4930|  69.8k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 69.8k, False: 0]
  |  Branch (4930:45): [True: 0, False: 69.8k]
  |  Branch (4930:59): [True: 0, False: 0]
  |  Branch (4930:78): [True: 0, False: 0]
  ------------------
 4931|      0|                              ctx.error = error_code::syntax_error;
 4932|      0|                              return false;
 4933|      0|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  69.8k|                           const int32_t value_indent =
 4937|  69.8k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 69.8k]
  ------------------
 4938|  69.8k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 69.8k]
  ------------------
 4939|      0|                              return false;
 4940|  69.8k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  69.8k|                           ctx.pop_indent();
 4942|  69.8k|                        }
 4943|   220k|                     }
 4944|   943k|                     return !bool(ctx.error);
 4945|   943k|                  };
_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_:
 4893|   722k|                              auto is_line_content_start = [&](auto pos) {
 4894|   722k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   722k|                              };
_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_:
 4897|   746k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   746k|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.29M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 1.29M, False: 0]
  |  Branch (4899:57): [True: 547k, False: 746k]
  |  Branch (4899:73): [True: 236, False: 746k]
  ------------------
 4900|   746k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 746k, False: 0]
  |  Branch (4900:56): [True: 442k, False: 304k]
  ------------------
 4901|   746k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|  3.62M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  3.62M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 3.62M]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|  3.62M|            }
_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_:
 5310|   364k|      {
 5311|   364k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   364k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   364k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   364k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   364k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 364k, False: 0]
  ------------------
 5321|   364k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   364k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|   376k|      {
 4183|   376k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 376k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   376k|         auto peek = it;
 4188|   376k|         yaml::node_preamble_state preamble{};
 4189|   376k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 14.2k, False: 362k]
  ------------------
 4190|   376k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  14.2k|            it = peek;
 4192|  14.2k|            return;
 4193|  14.2k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   362k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   362k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 410, False: 362k]
  ------------------
 4198|    410|            return;
 4199|       |
 4200|   362k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 151k, False: 211k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|   151k|            it = peek;
 4203|   151k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|   151k|         }
 4205|   211k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 211k, False: 80]
  ------------------
 4206|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4207|       |            // But if there was a tag, we need to advance past it
 4208|   211k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 234, False: 210k]
  |  Branch (4208:57): [True: 4.13k, False: 206k]
  ------------------
 4209|  4.36k|               it = peek;
 4210|  4.36k|            }
 4211|   211k|            int32_t seq_indent = ctx.current_indent();
 4212|   211k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 210k, False: 198]
  |  Branch (4212:31): [True: 120k, False: 90.7k]
  ------------------
 4213|   120k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 37.3k, False: 82.8k]
  |  Branch (4213:62): [True: 33.2k, False: 4.10k]
  ------------------
 4214|   120k|                                                          : (ctx.current_indent() + 1);
 4215|   120k|            }
 4216|   211k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   211k|         }
 4218|     80|         else {
 4219|     80|            ctx.error = error_code::syntax_error;
 4220|     80|         }
 4221|       |
 4222|   362k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   362k|      }
_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|   376k|      {
  466|   376k|         skip_inline_ws(it, end);
  467|       |
  468|   376k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 376k]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|   376k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   376k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 12, False: 376k]
  ------------------
  477|     12|            ctx.error = error_code::syntax_error;
  478|     12|            return true;
  479|     12|         }
  480|   376k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 376k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   376k|         skip_inline_ws(it, end);
  486|       |
  487|   376k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 376k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   376k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 14.2k, False: 362k]
  ------------------
  495|  14.2k|            return true;
  496|  14.2k|         }
  497|       |
  498|   362k|         return false;
  499|   376k|      }
_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_:
 4190|   376k|                                             [](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|   376k|      {
  409|   376k|         state.has_anchor = false;
  410|   376k|         state.anchor_name.clear();
  411|   376k|         state.anchor_start = nullptr;
  412|   376k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   376k|         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|   376k|            else {
  421|   376k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 14.1k, False: 362k]
  ------------------
  422|   376k|            }
  423|   376k|         }
  424|       |
  425|   376k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 362k, False: 14.1k]
  |  Branch (425:27): [True: 8.57k, False: 354k]
  ------------------
  426|  8.57k|            ++it;
  427|  8.57k|            auto name = parse_anchor_name(it, end);
  428|  8.57k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 28, False: 8.54k]
  ------------------
  429|     28|               ctx.error = error_code::syntax_error;
  430|     28|               return true;
  431|     28|            }
  432|  8.54k|            skip_inline_ws(it, end);
  433|  8.54k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 8.53k]
  ------------------
  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|  8.53k|            state.has_anchor = true;
  446|  8.53k|            state.anchor_name = std::string(name);
  447|  8.53k|            state.anchor_start = &*it;
  448|  8.53k|         }
  449|       |
  450|   376k|         return false;
  451|   376k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   376k|      {
  301|   376k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 376k]
  |  Branch (301:27): [True: 362k, False: 14.1k]
  ------------------
  302|       |
  303|  14.1k|         ++it; // skip '*'
  304|  14.1k|         auto name = parse_anchor_name(it, end);
  305|  14.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 14.1k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  14.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  14.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 34, False: 14.1k]
  ------------------
  312|     34|            ctx.error = error_code::syntax_error; // undefined alias
  313|     34|            return true;
  314|     34|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  14.1k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  14.1k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.63k, False: 12.4k]
  ------------------
  322|  1.63k|            return true;
  323|  1.63k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  12.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 54, False: 12.4k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  12.4k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.4k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 12.4k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  12.4k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 12.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|  12.4k|         auto replay_it = span.begin;
  348|  12.4k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  12.4k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  12.4k|         ctx.indent_stack.clear();
  353|  12.4k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 6.27k, False: 6.15k]
  ------------------
  354|  6.27k|            ctx.push_indent(span.base_indent - 1);
  355|  6.27k|         }
  356|       |
  357|  12.4k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  12.4k|         using V = std::remove_cvref_t<T>;
  360|  12.4k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  12.4k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  12.4k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  12.4k|         return true;
  367|  12.4k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|   151k|      {
 2665|   151k|         using V = std::remove_cvref_t<T>;
 2666|   151k|         using value_type = typename V::value_type;
 2667|       |
 2668|   151k|         struct sequence_container_adapter
 2669|   151k|         {
 2670|   151k|            size_t index = 0;
 2671|       |
 2672|   151k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|   151k|            {
 2674|   151k|               if constexpr (!resizable<V>) {
 2675|   151k|                  return index >= container.size();
 2676|   151k|               }
 2677|   151k|               else {
 2678|   151k|                  (void)container;
 2679|   151k|                  return false;
 2680|   151k|               }
 2681|   151k|            }
 2682|       |
 2683|   151k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|   151k|            inline void append(V& container, value_type&& element) noexcept
 2686|   151k|            {
 2687|   151k|               if constexpr (emplace_backable<V>) {
 2688|   151k|                  container.emplace_back(std::move(element));
 2689|   151k|               }
 2690|   151k|               else if constexpr (emplaceable<V>) {
 2691|   151k|                  container.emplace(std::move(element));
 2692|   151k|               }
 2693|   151k|            }
 2694|   151k|         };
 2695|       |
 2696|   151k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 151k]
  |  Branch (2696:27): [True: 0, False: 151k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|   151k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|   151k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|   151k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|   151k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 8, False: 151k]
  ------------------
 2709|      8|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|   151k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 147k, False: 3.64k]
  |  Branch (2712:27): [True: 25.3k, False: 122k]
  ------------------
 2713|  25.3k|            ++it;
 2714|  25.3k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  25.3k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 6, False: 25.3k]
  ------------------
 2716|      6|               return;
 2717|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|       |               if (ctx.current_indent() < 0) {
 2719|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|       |               }
 2721|       |            }
 2722|  25.3k|            return;
 2723|  25.3k|         }
 2724|       |
 2725|   125k|         bool just_saw_comma = false;
 2726|   125k|         sequence_container_adapter adapter{};
 2727|       |
 2728|   125k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   208k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 203k, False: 4.49k]
  ------------------
 2731|   203k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   203k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 203k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   203k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 203k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   203k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 31.2k, False: 172k]
  ------------------
 2741|  31.2k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 31.2k, False: 0]
  ------------------
 2742|  31.2k|                     ++it;
 2743|  31.2k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  31.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 6, False: 31.2k]
  ------------------
 2745|      6|                        return;
 2746|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|       |                        if (ctx.current_indent() < 0) {
 2748|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|       |                        }
 2750|       |                     }
 2751|  31.2k|                     return;
 2752|  31.2k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  31.2k|               }
 2756|       |
 2757|   172k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 14, False: 172k]
  |  Branch (2757:34): [True: 16, False: 172k]
  ------------------
 2758|     30|                  ctx.error = error_code::syntax_error;
 2759|     30|                  return;
 2760|     30|               }
 2761|   172k|               just_saw_comma = false;
 2762|       |
 2763|   172k|               value_type element{};
 2764|   172k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   172k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 5.54k, False: 167k]
  ------------------
 2767|  5.54k|                  return;
 2768|       |
 2769|   167k|               bool saw_line_break_before_separator = false;
 2770|   167k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   167k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 8, False: 167k]
  ------------------
 2772|      8|                  return;
 2773|       |
 2774|   167k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 166k, False: 238]
  |  Branch (2774:33): [True: 17.1k, False: 149k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  17.1k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 6, False: 17.1k]
  ------------------
 2777|      6|                     ctx.error = error_code::syntax_error;
 2778|      6|                     return;
 2779|      6|                  }
 2780|  17.1k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  17.1k|                     glz::generic key_node = std::move(element);
 2782|  17.1k|                     ++it;
 2783|  17.1k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  17.1k|                     glz::generic mapped{};
 2786|  17.1k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  17.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 128, False: 17.0k]
  ------------------
 2788|    128|                        return;
 2789|       |
 2790|  17.0k|                     std::string key;
 2791|  17.0k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 4, False: 17.0k]
  ------------------
 2792|      4|                        return;
 2793|       |
 2794|  17.0k|                     glz::generic pair{};
 2795|  17.0k|                     pair[key] = std::move(mapped);
 2796|  17.0k|                     element = std::move(pair);
 2797|       |
 2798|  17.0k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  17.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 6, False: 17.0k]
  ------------------
 2800|      6|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  17.1k|               }
 2807|       |
 2808|   167k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   167k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 240, False: 166k]
  ------------------
 2811|    240|                  ctx.error = error_code::unexpected_end;
 2812|    240|                  return;
 2813|    240|               }
 2814|       |
 2815|   166k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 83.9k, False: 82.8k]
  ------------------
 2816|  83.9k|                  ++it;
 2817|  83.9k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  83.9k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 8, False: 83.9k]
  ------------------
 2819|      8|                     return;
 2820|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|       |                     if (ctx.current_indent() < 0) {
 2822|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|       |                     }
 2824|       |                  }
 2825|  83.9k|                  return;
 2826|  83.9k|               }
 2827|  82.8k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 82.6k, False: 196]
  ------------------
 2828|  82.6k|                  ++it;
 2829|  82.6k|                  just_saw_comma = true;
 2830|  82.6k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  82.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 6, False: 82.6k]
  ------------------
 2832|      6|                     return;
 2833|  82.6k|               }
 2834|    196|               else {
 2835|    196|                  ctx.error = error_code::syntax_error;
 2836|    196|                  return;
 2837|    196|               }
 2838|   166k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|   125k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   362k|      {
 2649|   362k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   362k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   362k|               value.clear();
 2653|   362k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   362k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|   166k|            {
 2687|   166k|               if constexpr (emplace_backable<V>) {
 2688|   166k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   166k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   211k|      {
 3160|   211k|         using V = std::remove_cvref_t<T>;
 3161|   211k|         using value_type = typename V::value_type;
 3162|       |
 3163|   211k|         struct sequence_container_adapter
 3164|   211k|         {
 3165|   211k|            size_t index = 0;
 3166|       |
 3167|   211k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   211k|            {
 3169|   211k|               if constexpr (!resizable<V>) {
 3170|   211k|                  return index >= container.size();
 3171|   211k|               }
 3172|   211k|               else {
 3173|   211k|                  (void)container;
 3174|   211k|                  return false;
 3175|   211k|               }
 3176|   211k|            }
 3177|       |
 3178|   211k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   211k|            inline void append(V& container, value_type&& element) noexcept
 3181|   211k|            {
 3182|   211k|               if constexpr (emplace_backable<V>) {
 3183|   211k|                  container.emplace_back(std::move(element));
 3184|   211k|               }
 3185|   211k|               else if constexpr (emplaceable<V>) {
 3186|   211k|                  container.emplace(std::move(element));
 3187|   211k|               }
 3188|   211k|            }
 3189|   211k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   211k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   211k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   211k|         bool first_item = true;
 3200|   211k|         bool has_pending_item_anchor = false;
 3201|   211k|         std::string pending_item_anchor_name{};
 3202|   211k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   513k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 462k, False: 50.9k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   462k|            int32_t line_indent = 0;
 3215|   462k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   462k|            auto line_start = it;
 3217|       |
 3218|   672k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 656k, False: 16.1k]
  ------------------
 3219|   656k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 43.0k, False: 613k]
  ------------------
 3220|  43.0k|                  skip_comment(it, end);
 3221|  43.0k|                  skip_newline(it, end);
 3222|  43.0k|                  line_start = it;
 3223|  43.0k|                  line_indent = 0;
 3224|  43.0k|               }
 3225|   613k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 54.4k, False: 559k]
  |  Branch (3225:40): [True: 78.4k, False: 480k]
  ------------------
 3226|   132k|                  skip_newline(it, end);
 3227|   132k|                  line_start = it;
 3228|   132k|                  line_indent = 0;
 3229|   132k|               }
 3230|   480k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 50.2k, False: 430k]
  ------------------
 3231|  50.2k|                  line_start = it;
 3232|  50.2k|                  line_indent = 0;
 3233|  4.52M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 4.52M, False: 3.68k]
  |  Branch (3233:39): [True: 4.47M, False: 46.5k]
  ------------------
 3234|  4.47M|                     ++line_indent;
 3235|  4.47M|                     ++it;
 3236|  4.47M|                  }
 3237|       |
 3238|  50.2k|                  bool saw_tab = false;
 3239|  60.0k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 55.4k, False: 4.53k]
  |  Branch (3239:40): [True: 5.30k, False: 50.1k]
  |  Branch (3239:54): [True: 4.46k, False: 45.6k]
  ------------------
 3240|  9.77k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 5.53k, False: 4.24k]
  |  Branch (3240:43): [True: 4.24k, False: 0]
  ------------------
 3241|  9.77k|                     ++it;
 3242|  9.77k|                  }
 3243|       |
 3244|  50.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 4.53k, False: 45.6k]
  |  Branch (3244:36): [True: 4.48k, False: 41.2k]
  |  Branch (3244:51): [True: 9.16k, False: 32.0k]
  |  Branch (3244:66): [True: 1.61k, False: 30.4k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  19.7k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 15.2k, False: 4.53k]
  |  Branch (3246:39): [True: 1.61k, False: 13.6k]
  ------------------
 3247|  1.61k|                        skip_comment(it, end);
 3248|  1.61k|                     }
 3249|  19.7k|                     line_indent = 0;
 3250|  19.7k|                     continue;
 3251|  19.7k|                  }
 3252|       |
 3253|  30.4k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 8, False: 30.4k]
  ------------------
 3254|      8|                     ctx.error = error_code::syntax_error;
 3255|      8|                     return;
 3256|      8|                  }
 3257|  30.4k|                  break; // Found content
 3258|  30.4k|               }
 3259|   430k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 14.2k, False: 416k]
  ------------------
 3260|  14.2k|                  line_start = it;
 3261|  39.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 38.9k, False: 502]
  |  Branch (3261:40): [True: 1.69k, False: 37.2k]
  |  Branch (3261:54): [True: 23.5k, False: 13.7k]
  ------------------
 3262|  14.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 502, False: 13.7k]
  |  Branch (3262:36): [True: 4.79k, False: 8.92k]
  |  Branch (3262:51): [True: 2.66k, False: 6.26k]
  |  Branch (3262:66): [True: 6.24k, False: 26]
  ------------------
 3263|  14.2k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 13.7k, False: 502]
  |  Branch (3263:39): [True: 6.24k, False: 7.45k]
  ------------------
 3264|  6.24k|                        skip_comment(it, end);
 3265|  6.24k|                     }
 3266|  14.2k|                     line_indent = 0;
 3267|  14.2k|                     continue;
 3268|  14.2k|                  }
 3269|     26|                  ctx.error = error_code::syntax_error;
 3270|     26|                  return;
 3271|  14.2k|               }
 3272|   416k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   416k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 211k, False: 205k]
  |  Branch (3276:37): [True: 210k, False: 190]
  ------------------
 3277|   210k|                     line_indent = sequence_indent;
 3278|   210k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   210k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 210k, False: 0]
  |  Branch (3279:49): [True: 210k, False: 0]
  ------------------
 3280|   210k|                           auto probe = it;
 3281|   210k|                           int32_t leading_ws = 0;
 3282|   210k|                           bool saw_tab = false;
 3283|   380k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 380k, False: 0]
  |  Branch (3283:64): [True: 147k, False: 233k]
  |  Branch (3283:87): [True: 22.5k, False: 210k]
  ------------------
 3284|   169k|                              --probe;
 3285|   169k|                              ++leading_ws;
 3286|   169k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 1.34k, False: 168k]
  |  Branch (3286:52): [True: 21.7k, False: 146k]
  ------------------
 3287|   169k|                           }
 3288|   210k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 210k]
  |  Branch (3288:61): [True: 21.5k, False: 189k]
  |  Branch (3288:85): [True: 71.7k, False: 117k]
  ------------------
 3289|  93.2k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 6, False: 93.2k]
  ------------------
 3290|      6|                                 ctx.error = error_code::syntax_error;
 3291|      6|                                 return;
 3292|      6|                              }
 3293|  93.2k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  93.2k|                           }
 3295|   210k|                        }
 3296|   210k|                     }
 3297|   210k|                  }
 3298|   210k|                  break;
 3299|   416k|               }
 3300|   656k|            }
 3301|       |
 3302|   462k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 16.1k, False: 446k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   446k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 11.0k, False: 435k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   435k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 58.7k, False: 376k]
  ------------------
 3309|  58.7k|               it = line_start;
 3310|  58.7k|               return;
 3311|  58.7k|            }
 3312|       |
 3313|   376k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 24.1k, False: 352k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  24.1k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 84, False: 24.0k]
  ------------------
 3318|     84|                  ctx.error = error_code::syntax_error;
 3319|     84|                  return;
 3320|     84|               }
 3321|       |
 3322|  24.0k|               ++it;
 3323|  24.0k|               auto pending_name = parse_anchor_name(it, end);
 3324|  24.0k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 18, False: 24.0k]
  ------------------
 3325|     18|                  ctx.error = error_code::syntax_error;
 3326|     18|                  return;
 3327|     18|               }
 3328|  24.0k|               skip_inline_ws(it, end);
 3329|  24.0k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 24.0k, False: 44]
  |  Branch (3329:33): [True: 3.19k, False: 20.8k]
  ------------------
 3330|  3.19k|                  skip_comment(it, end);
 3331|  3.19k|               }
 3332|       |
 3333|  24.0k|               has_pending_item_anchor = true;
 3334|  24.0k|               pending_item_anchor_name = std::string(pending_name);
 3335|  24.0k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  24.0k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 44, False: 24.0k]
  |  Branch (3337:34): [True: 16.3k, False: 7.65k]
  |  Branch (3337:49): [True: 28, False: 16.3k]
  ------------------
 3338|     72|                  ctx.error = error_code::syntax_error;
 3339|     72|                  return;
 3340|     72|               }
 3341|       |
 3342|  23.9k|               skip_newline(it, end);
 3343|  23.9k|               continue;
 3344|  24.0k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   352k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 67.7k, False: 285k]
  ------------------
 3348|  67.7k|               it = line_start;
 3349|  67.7k|               return;
 3350|  67.7k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   285k|            dash_col = line_indent;
 3356|   285k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   285k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 285k, False: 6]
  ------------------
 3358|   285k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   285k|               }
 3360|   285k|            }
 3361|       |
 3362|   285k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   285k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 277k, False: 8.04k]
  |  Branch (3365:30): [True: 5.19k, False: 271k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  5.19k|               it = line_start;
 3368|  5.19k|               return;
 3369|  5.19k|            }
 3370|       |
 3371|   279k|            bool saw_tab_after_dash = false;
 3372|   501k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 488k, False: 13.3k]
  |  Branch (3372:34): [True: 154k, False: 333k]
  |  Branch (3372:48): [True: 67.1k, False: 266k]
  ------------------
 3373|   221k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.74k, False: 216k]
  |  Branch (3373:59): [True: 65.3k, False: 151k]
  ------------------
 3374|   221k|               ++it;
 3375|   221k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   279k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 65.3k, False: 214k]
  |  Branch (3377:39): [True: 64.8k, False: 556]
  |  Branch (3377:52): [True: 850, False: 63.9k]
  ------------------
 3378|    850|               const auto after_dash = it + 1;
 3379|    850|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 6, False: 844]
  |  Branch (3379:41): [True: 6, False: 838]
  ------------------
 3380|     12|                  ctx.error = error_code::syntax_error;
 3381|     12|                  return;
 3382|     12|               }
 3383|    850|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   279k|            auto parse_element = [&](auto& element) {
 3387|   279k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   279k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   279k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   279k|                     return;
 3397|   279k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   279k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   279k|                  ctx.sequence_item_value_context = true;
 3400|   279k|                  ctx.sequence_dash_indent = dash_col;
 3401|   279k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   279k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   279k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   279k|                  ctx.pop_indent();
 3405|   279k|               }
 3406|   279k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   279k|                  skip_ws_and_comment(it, end);
 3409|   279k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   279k|                  auto nested_start = it;
 3413|   279k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   279k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   279k|                     return;
 3416|   279k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   279k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   279k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   279k|                     const int32_t element_indent =
 3428|   279k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   279k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   279k|                        return;
 3431|   279k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   279k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   279k|                     ctx.sequence_item_value_context = true;
 3434|   279k|                     ctx.sequence_dash_indent = dash_col;
 3435|   279k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   279k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   279k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   279k|                     ctx.pop_indent();
 3439|   279k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   279k|               }
 3442|       |
 3443|   279k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   279k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   279k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   279k|                                                                      pending_item_anchor_indent};
 3447|   279k|                  has_pending_item_anchor = false;
 3448|   279k|               }
 3449|   279k|            };
 3450|       |
 3451|   279k|            if constexpr (emplace_backable<V>) {
 3452|   279k|               auto& element = value.emplace_back();
 3453|   279k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   279k|            first_item = false;
 3472|       |
 3473|   279k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 1.14k, False: 278k]
  ------------------
 3474|  1.14k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   279k|         }
 3479|   211k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   279k|            auto parse_element = [&](auto& element) {
 3387|   279k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 266k, False: 13.3k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   279k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 266k, False: 13.3k]
  |  Branch (3390:33): [True: 165k, False: 101k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   165k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 165k]
  ------------------
 3396|      0|                     return;
 3397|   165k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   165k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   165k|                  ctx.sequence_item_value_context = true;
 3400|   165k|                  ctx.sequence_dash_indent = dash_col;
 3401|   165k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   165k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   165k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   165k|                  ctx.pop_indent();
 3405|   165k|               }
 3406|   114k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   114k|                  skip_ws_and_comment(it, end);
 3409|   114k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   114k|                  auto nested_start = it;
 3413|   114k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   114k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 14, False: 114k]
  ------------------
 3415|     14|                     return;
 3416|   114k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   114k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 4.12k, False: 110k]
  ------------------
 3422|   114k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 39.8k, False: 74.9k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  39.8k|                     const int32_t element_indent =
 3428|  39.8k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 39.8k]
  ------------------
 3429|  39.8k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 39.8k]
  ------------------
 3430|      0|                        return;
 3431|  39.8k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  39.8k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  39.8k|                     ctx.sequence_item_value_context = true;
 3434|  39.8k|                     ctx.sequence_dash_indent = dash_col;
 3435|  39.8k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  39.8k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  39.8k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  39.8k|                     ctx.pop_indent();
 3439|  39.8k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   114k|               }
 3442|       |
 3443|   279k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 12.5k, False: 267k]
  |  Branch (3443:47): [True: 12.2k, False: 214]
  ------------------
 3444|  12.2k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 11.1k, False: 1.13k]
  ------------------
 3445|  12.2k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  12.2k|                                                                      pending_item_anchor_indent};
 3447|  12.2k|                  has_pending_item_anchor = false;
 3448|  12.2k|               }
 3449|   279k|            };
_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_:
 5530|  1.54M|   {
 5531|  1.54M|      if constexpr (yaml::check_flow_context(Opts)) {
 5532|       |         // In flow context, only treat plain content as an implicit "key: value"
 5533|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5534|  1.54M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|  1.54M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|  1.54M|            bool at_node_start = true;
 5542|  1.54M|            int depth = 0;
 5543|  1.54M|            while (pos != stop) {
 5544|  1.54M|               const char c = *pos;
 5545|  1.54M|               if (c == ' ' || c == '\t') {
 5546|  1.54M|                  ++pos;
 5547|  1.54M|                  continue;
 5548|  1.54M|               }
 5549|  1.54M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  1.54M|               if ((c == '"' || c == '\'') && node_start) {
 5552|  1.54M|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|  1.54M|                  continue;
 5554|  1.54M|               }
 5555|  1.54M|               if (c == '[' || c == '{') {
 5556|  1.54M|                  ++depth;
 5557|  1.54M|                  at_node_start = true;
 5558|  1.54M|                  ++pos;
 5559|  1.54M|                  continue;
 5560|  1.54M|               }
 5561|  1.54M|               if (c == ']' || c == '}') {
 5562|  1.54M|                  if (depth == 0) return false;
 5563|  1.54M|                  --depth;
 5564|  1.54M|                  ++pos;
 5565|  1.54M|                  continue;
 5566|  1.54M|               }
 5567|  1.54M|               if (c == ',' && depth == 0) return false;
 5568|  1.54M|               if (c == ':' && depth == 0) {
 5569|  1.54M|                  auto next = pos + 1;
 5570|  1.54M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|  1.54M|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  1.54M|               if (c == ',' || c == ':') {
 5574|  1.54M|                  at_node_start = true;
 5575|  1.54M|                  ++pos;
 5576|  1.54M|                  continue;
 5577|  1.54M|               }
 5578|  1.54M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|  1.54M|                  at_node_start = true;
 5580|  1.54M|                  continue;
 5581|  1.54M|               }
 5582|  1.54M|               ++pos;
 5583|  1.54M|            }
 5584|  1.54M|            return false;
 5585|  1.54M|         };
 5586|       |
 5587|  1.54M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5587:14): [True: 562k, False: 986k]
  |  Branch (5587:49): [True: 19.7k, False: 966k]
  ------------------
 5588|   581k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5588:17): [True: 508k, False: 73.6k]
  ------------------
 5589|   508k|               return;
 5590|   508k|            }
 5591|  73.6k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5591:17): [True: 2.68k, False: 70.9k]
  ------------------
 5592|  2.68k|               return;
 5593|  2.68k|            }
 5594|  73.6k|         }
 5595|       |
 5596|  1.03M|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|  1.03M|         return;
 5598|  1.54M|      }
 5599|       |
 5600|  1.54M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 0, False: 1.54M]
  ------------------
 5601|      0|         return;
 5602|      0|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|  1.54M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 0, False: 1.54M]
  ------------------
 5605|      0|         return;
 5606|      0|      }
 5607|  1.54M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|  1.54M|   }
_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_:
 5534|  1.54M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|  1.54M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|  1.54M|            bool at_node_start = true;
 5542|  1.54M|            int depth = 0;
 5543|  18.5M|            while (pos != stop) {
  ------------------
  |  Branch (5543:20): [True: 18.3M, False: 221k]
  ------------------
 5544|  18.3M|               const char c = *pos;
 5545|  18.3M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5545:20): [True: 1.68M, False: 16.6M]
  |  Branch (5545:32): [True: 281k, False: 16.3M]
  ------------------
 5546|  1.96M|                  ++pos;
 5547|  1.96M|                  continue;
 5548|  1.96M|               }
 5549|  16.3M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  16.3M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5551:21): [True: 149k, False: 16.2M]
  |  Branch (5551:33): [True: 23.4k, False: 16.1M]
  |  Branch (5551:47): [True: 95.4k, False: 77.2k]
  ------------------
 5552|  95.4k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5552:23): [True: 23.8k, False: 71.5k]
  ------------------
 5553|  71.5k|                  continue;
 5554|  95.4k|               }
 5555|  16.2M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5555:20): [True: 109k, False: 16.1M]
  |  Branch (5555:32): [True: 142k, False: 16.0M]
  ------------------
 5556|   251k|                  ++depth;
 5557|   251k|                  at_node_start = true;
 5558|   251k|                  ++pos;
 5559|   251k|                  continue;
 5560|   251k|               }
 5561|  16.0M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5561:20): [True: 117k, False: 15.8M]
  |  Branch (5561:32): [True: 135k, False: 15.7M]
  ------------------
 5562|   253k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5562:23): [True: 143k, False: 109k]
  ------------------
 5563|   109k|                  --depth;
 5564|   109k|                  ++pos;
 5565|   109k|                  continue;
 5566|   253k|               }
 5567|  15.7M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5567:20): [True: 734k, False: 15.0M]
  |  Branch (5567:32): [True: 492k, False: 241k]
  ------------------
 5568|  15.2M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5568:20): [True: 949k, False: 14.3M]
  |  Branch (5568:32): [True: 666k, False: 283k]
  ------------------
 5569|   666k|                  auto next = pos + 1;
 5570|   666k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5570:26): [True: 8.58k, False: 657k]
  |  Branch (5570:41): [True: 427k, False: 230k]
  |  Branch (5570:57): [True: 46.4k, False: 183k]
  |  Branch (5570:74): [True: 40.7k, False: 143k]
  |  Branch (5570:91): [True: 39.1k, False: 103k]
  ------------------
 5571|   666k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  14.5M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5573:20): [True: 241k, False: 14.3M]
  |  Branch (5573:32): [True: 283k, False: 14.0M]
  ------------------
 5574|   524k|                  at_node_start = true;
 5575|   524k|                  ++pos;
 5576|   524k|                  continue;
 5577|   524k|               }
 5578|  14.0M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5578:20): [True: 1.64M, False: 12.4M]
  |  Branch (5578:34): [True: 159k, False: 1.48M]
  ------------------
 5579|   159k|                  at_node_start = true;
 5580|   159k|                  continue;
 5581|   159k|               }
 5582|  13.9M|               ++pos;
 5583|  13.9M|            }
 5584|   221k|            return false;
 5585|  1.54M|         };
_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_:
 5962|   134k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   134k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 1.94k, False: 132k]
  ------------------
 5964|  1.94k|                  return true;
 5965|  1.94k|               }
 5966|   132k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 75.7k, False: 57.0k]
  ------------------
 5967|  75.7k|                  auto next = ptr + 1;
 5968|  75.7k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 2.87k, False: 72.8k]
  |  Branch (5968:43): [True: 26.4k, False: 46.3k]
  |  Branch (5968:59): [True: 29.6k, False: 16.7k]
  |  Branch (5968:76): [True: 9.03k, False: 7.73k]
  |  Branch (5968:93): [True: 2.87k, False: 4.86k]
  ------------------
 5969|  75.7k|               }
 5970|  57.0k|               return is_plain_scalar_boundary(*ptr);
 5971|   132k|            };
_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:
 5888|  57.0k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  57.0k|               switch (ch) {
 5890|  2.92k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 2.92k, False: 54.0k]
  ------------------
 5891|  6.99k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 4.06k, False: 52.9k]
  ------------------
 5892|  10.2k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 3.24k, False: 53.7k]
  ------------------
 5893|  27.5k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 17.3k, False: 39.6k]
  ------------------
 5894|  36.0k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 8.47k, False: 48.5k]
  ------------------
 5895|  39.7k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 3.67k, False: 53.3k]
  ------------------
 5896|  40.9k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 1.25k, False: 55.7k]
  ------------------
 5897|  40.9k|                  return true;
 5898|  16.0k|               default:
  ------------------
  |  Branch (5898:16): [True: 16.0k, False: 40.9k]
  ------------------
 5899|  16.0k|                  return false;
 5900|  57.0k|               }
 5901|  57.0k|            };
_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_:
 5903|   113k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|   113k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|   113k|                  return false;
 5906|   113k|               }
 5907|   113k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 0, False: 113k]
  ------------------
 5908|      0|                  return false;
 5909|      0|               }
 5910|   113k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 113k, False: 0]
  |  Branch (5910:40): [True: 0, False: 0]
  |  Branch (5910:61): [True: 0, False: 0]
  ------------------
 5911|      0|                  return false;
 5912|      0|               }
 5913|       |
 5914|   113k|               auto look = word_end;
 5915|   113k|               yaml::skip_newline(look, end);
 5916|   113k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 0, False: 113k]
  ------------------
 5917|      0|                  int32_t line_indent = 0;
 5918|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 0, False: 0]
  |  Branch (5918:41): [True: 0, False: 0]
  ------------------
 5919|      0|                     ++line_indent;
 5920|      0|                     ++look;
 5921|      0|                  }
 5922|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 0, False: 0]
  |  Branch (5922:38): [True: 0, False: 0]
  ------------------
 5923|      0|                     return false;
 5924|      0|                  }
 5925|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 0, False: 0]
  |  Branch (5925:38): [True: 0, False: 0]
  |  Branch (5925:55): [True: 0, False: 0]
  ------------------
 5926|      0|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 0, False: 0]
  ------------------
 5927|      0|                        yaml::skip_newline(look, end);
 5928|      0|                        continue;
 5929|      0|                     }
 5930|      0|                     return false;
 5931|      0|                  }
 5932|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 0, False: 0]
  ------------------
 5933|      0|                     yaml::skip_comment(look, end);
 5934|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 0, False: 0]
  |  Branch (5934:42): [True: 0, False: 0]
  |  Branch (5934:59): [True: 0, False: 0]
  ------------------
 5935|      0|                        yaml::skip_newline(look, end);
 5936|      0|                        continue;
 5937|      0|                     }
 5938|      0|                     return false;
 5939|      0|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|      0|                  {
 5945|      0|                     auto scan = look;
 5946|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 0, False: 0]
  |  Branch (5946:44): [True: 0, False: 0]
  |  Branch (5946:61): [True: 0, False: 0]
  ------------------
 5947|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 0, False: 0]
  ------------------
 5948|      0|                           auto after_colon = scan + 1;
 5949|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 0, False: 0]
  |  Branch (5949:54): [True: 0, False: 0]
  |  Branch (5949:77): [True: 0, False: 0]
  ------------------
 5950|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 0, False: 0]
  |  Branch (5950:56): [True: 0, False: 0]
  ------------------
 5951|      0|                              return false;
 5952|      0|                           }
 5953|      0|                        }
 5954|      0|                        ++scan;
 5955|      0|                     }
 5956|      0|                  }
 5957|       |
 5958|      0|                  return line_indent > ctx.current_indent();
 5959|      0|               }
 5960|   113k|               return false;
 5961|   113k|            };
_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_:
 5484|  1.58M|   {
 5485|  1.58M|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|  1.58M|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|  1.58M|         const bool could_be_mapping = [&] {
 5493|  1.58M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  1.58M|               return line_could_be_flow_mapping(it, end);
 5495|  1.58M|            }
 5496|  1.58M|            else {
 5497|  1.58M|               return yaml::line_could_be_block_mapping(it, end);
 5498|  1.58M|            }
 5499|  1.58M|         }();
 5500|  1.58M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 1.04M, False: 545k]
  ------------------
 5501|  1.04M|            return false;
 5502|  1.04M|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   545k|         auto temp_ctx = ctx.make_speculative();
 5505|   545k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   545k|                                                                                               end);
 5507|   545k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   545k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   545k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 537k, False: 7.10k]
  ------------------
 5510|   537k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   537k|            return true;
 5512|   537k|         }
 5513|       |         // The line matched "key: value" pattern but parsing failed.
 5514|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5515|       |         // so propagate the error rather than silently falling back to string.
 5516|  7.10k|         ctx.error = temp_ctx.error;
 5517|  7.10k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  7.10k|         return false;
 5519|   545k|      }
 5520|  1.58M|   }
_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:
 5492|  1.58M|         const bool could_be_mapping = [&] {
 5493|  1.58M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  1.58M|               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|       |            else {
 5497|       |               return yaml::line_could_be_block_mapping(it, end);
 5498|       |            }
 5499|  1.58M|         }();
_ZN3glz4yaml15materialize_keyILb0ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  1.43M|   {
   39|       |      if constexpr (empty_on_null) {
   40|       |         if (key_node.is_null()) {
   41|       |            key.clear();
   42|       |            return true;
   43|       |         }
   44|       |      }
   45|  1.43M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 29.5k, False: 1.40M]
  ------------------
   46|  29.5k|         key = *s;
   47|  29.5k|         return true;
   48|  29.5k|      }
   49|  1.40M|      key.clear();
   50|  1.40M|      (void)glz::write_json(key_node, key);
   51|  1.40M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  1.40M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 70, False: 1.40M]
  ------------------
   53|     70|            ctx.error = error_code::exceeded_max_expansion;
   54|     70|            ctx.custom_error_message = "complex key expansion";
   55|     70|            return false;
   56|     70|         }
   57|  1.40M|      }
   58|  1.40M|      return true;
   59|  1.43M|   }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  2.10M|      {
  275|  2.10M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  2.10M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  2.10M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  2.10M|      }
_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_:
 5752|  2.61M|      {
 5753|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5754|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5755|  2.61M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  2.61M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  2.61M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  2.61M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  2.61M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 2.61M]
  ------------------
 5760|      0|            return;
 5761|       |
 5762|       |         // No depth is taken here: the sequence and mapping readers this dispatches to count the
 5763|       |         // levels, so a scalar at the bottom of a document costs nothing, as in JSON. The one way
 5764|       |         // back into this reader that opens no collection is `redispatch`, which counts itself.
 5765|       |
 5766|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5767|       |         // For nested values, only skip inline whitespace to preserve block structure
 5768|  2.61M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 1.38M, False: 1.23M]
  ------------------
 5769|  1.38M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  1.38M|         }
 5771|  1.23M|         else {
 5772|  1.23M|            yaml::skip_inline_ws(it, end);
 5773|  1.23M|         }
 5774|       |
 5775|  2.61M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 64, False: 2.61M]
  ------------------
 5776|     64|            ctx.error = error_code::unexpected_end;
 5777|     64|            return;
 5778|     64|         }
 5779|       |
 5780|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5781|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5782|       |         // same variant definitions round-trip across both formats.
 5783|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5784|       |            using V = std::remove_cvref_t<T>;
 5785|       |            const bool value_is_mapping =
 5786|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5787|       |            if (value_is_mapping) {
 5788|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5789|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5790|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5791|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5792|       |               auto tag_ctx = ctx.make_speculative();
 5793|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5794|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5795|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5796|       |               if (index < ids_v<V>.size()) {
 5797|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5798|       |                  emplace_runtime_variant(value, index);
 5799|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5800|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5801|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5802|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5803|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5804|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5805|       |                     return;
 5806|       |                  }
 5807|       |                  std::visit(
 5808|       |                     [&](auto&& alt) {
 5809|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5810|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5811|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5812|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5813|       |                        }
 5814|       |                        else if constexpr (custom_read<Alt>) {
 5815|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5816|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5817|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5818|       |                           // entry, then hand the remaining mapping to the custom handler.
 5819|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5820|       |                              ctx.error = error_code::feature_not_supported;
 5821|       |                              ctx.custom_error_message =
 5822|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5823|       |                           }
 5824|       |                           else {
 5825|       |                              ctx.scratch.clear();
 5826|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5827|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5828|       |                                    ctx.error = error_code::feature_not_supported;
 5829|       |                                    ctx.custom_error_message =
 5830|       |                                       "the tag must be the first key for a custom variant alternative";
 5831|       |                                 }
 5832|       |                                 else {
 5833|       |                                    yaml::skip_inline_ws(it, end);
 5834|       |                                    if (it == end || *it != ':') {
 5835|       |                                       ctx.error = error_code::syntax_error;
 5836|       |                                    }
 5837|       |                                    else {
 5838|       |                                       ++it;
 5839|       |                                       yaml::skip_inline_ws(it, end);
 5840|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5841|       |                                       if (!bool(ctx.error)) {
 5842|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5843|       |                                          // was the whole mapping: leave the alternative default.
 5844|       |                                          auto probe = it;
 5845|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5846|       |                                          if (probe == end) {
 5847|       |                                             it = probe;
 5848|       |                                          }
 5849|       |                                          else {
 5850|       |                                             // Publish the mapping's column so the custom handler's block
 5851|       |                                             // mapping (which would otherwise discover its own indent) reads
 5852|       |                                             // the remaining entries at the variant's indent and dedents
 5853|       |                                             // correctly in every context (root, sequence, nested).
 5854|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5855|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5856|       |                                             ctx.forced_block_mapping_indent = -1;
 5857|       |                                          }
 5858|       |                                       }
 5859|       |                                    }
 5860|       |                                 }
 5861|       |                              }
 5862|       |                           }
 5863|       |                        }
 5864|       |                        else {
 5865|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5866|       |                           // the value, but the mapping must still be consumed.
 5867|       |                           walk_tagged_mapping<Opts>(
 5868|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5869|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5870|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5871|       |                              });
 5872|       |                        }
 5873|       |                     },
 5874|       |                     value);
 5875|       |                  ctx.pop_indent();
 5876|       |                  return;
 5877|       |               }
 5878|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5879|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5880|       |               // otherwise the deduction path reports no_matching_variant_type.
 5881|       |            }
 5882|       |         }
 5883|       |
 5884|  2.61M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  2.61M|            using V = std::remove_cvref_t<T>;
 5886|  2.61M|            using counts = yaml_variant_type_count<V>;
 5887|  2.61M|            const char c = *it;
 5888|  2.61M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  2.61M|               switch (ch) {
 5890|  2.61M|               case ' ':
 5891|  2.61M|               case '\t':
 5892|  2.61M|               case '\n':
 5893|  2.61M|               case '\r':
 5894|  2.61M|               case ',':
 5895|  2.61M|               case ']':
 5896|  2.61M|               case '}':
 5897|  2.61M|                  return true;
 5898|  2.61M|               default:
 5899|  2.61M|                  return false;
 5900|  2.61M|               }
 5901|  2.61M|            };
 5902|       |
 5903|  2.61M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  2.61M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  2.61M|                  return false;
 5906|  2.61M|               }
 5907|  2.61M|               if (ctx.current_indent() < 0) {
 5908|  2.61M|                  return false;
 5909|  2.61M|               }
 5910|  2.61M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  2.61M|                  return false;
 5912|  2.61M|               }
 5913|       |
 5914|  2.61M|               auto look = word_end;
 5915|  2.61M|               yaml::skip_newline(look, end);
 5916|  2.61M|               while (look != end) {
 5917|  2.61M|                  int32_t line_indent = 0;
 5918|  2.61M|                  while (look != end && *look == ' ') {
 5919|  2.61M|                     ++line_indent;
 5920|  2.61M|                     ++look;
 5921|  2.61M|                  }
 5922|  2.61M|                  if (look != end && *look == '\t') {
 5923|  2.61M|                     return false;
 5924|  2.61M|                  }
 5925|  2.61M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  2.61M|                     if (look != end) {
 5927|  2.61M|                        yaml::skip_newline(look, end);
 5928|  2.61M|                        continue;
 5929|  2.61M|                     }
 5930|  2.61M|                     return false;
 5931|  2.61M|                  }
 5932|  2.61M|                  if (*look == '#') {
 5933|  2.61M|                     yaml::skip_comment(look, end);
 5934|  2.61M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  2.61M|                        yaml::skip_newline(look, end);
 5936|  2.61M|                        continue;
 5937|  2.61M|                     }
 5938|  2.61M|                     return false;
 5939|  2.61M|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  2.61M|                  {
 5945|  2.61M|                     auto scan = look;
 5946|  2.61M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  2.61M|                        if (*scan == ':') {
 5948|  2.61M|                           auto after_colon = scan + 1;
 5949|  2.61M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  2.61M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  2.61M|                              return false;
 5952|  2.61M|                           }
 5953|  2.61M|                        }
 5954|  2.61M|                        ++scan;
 5955|  2.61M|                     }
 5956|  2.61M|                  }
 5957|       |
 5958|  2.61M|                  return line_indent > ctx.current_indent();
 5959|  2.61M|               }
 5960|  2.61M|               return false;
 5961|  2.61M|            };
 5962|  2.61M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  2.61M|               if (ptr == end) {
 5964|  2.61M|                  return true;
 5965|  2.61M|               }
 5966|  2.61M|               if (*ptr == ':') {
 5967|  2.61M|                  auto next = ptr + 1;
 5968|  2.61M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  2.61M|               }
 5970|  2.61M|               return is_plain_scalar_boundary(*ptr);
 5971|  2.61M|            };
 5972|       |
 5973|  2.61M|            switch (c) {
 5974|   628k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 628k, False: 1.98M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   628k|               ++it;
 5977|   628k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   628k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 34, False: 628k]
  ------------------
 5979|     34|                  ctx.error = error_code::syntax_error;
 5980|     34|                  return;
 5981|     34|               }
 5982|   628k|               yaml::skip_inline_ws(it, end);
 5983|   628k|               bool anchor_on_same_line = true;
 5984|   628k|               bool value_is_indentless_sequence = false;
 5985|   628k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 14.8k, False: 613k]
  |  Branch (5985:33): [True: 64.2k, False: 549k]
  |  Branch (5985:48): [True: 125k, False: 423k]
  |  Branch (5985:63): [True: 20.4k, False: 403k]
  ------------------
 5986|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5987|       |                  // next line (indented past current context) or if this is an empty node.
 5988|   225k|                  bool value_on_next_line = false;
 5989|   225k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 210k, False: 14.8k]
  ------------------
 5990|   210k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|   210k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 20.4k, False: 189k]
  ------------------
 5993|   159k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 158k, False: 734]
  |  Branch (5993:47): [True: 147k, False: 11.3k]
  |  Branch (5993:64): [True: 139k, False: 8.41k]
  ------------------
 5994|  20.4k|                     }
 5995|       |                     // Skip newline
 5996|   210k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 209k, False: 734]
  |  Branch (5996:42): [True: 75.5k, False: 134k]
  |  Branch (5996:59): [True: 134k, False: 0]
  ------------------
 5997|   209k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   315k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 304k, False: 11.1k]
  |  Branch (5999:48): [True: 45.1k, False: 259k]
  |  Branch (5999:65): [True: 60.6k, False: 198k]
  ------------------
 6000|   105k|                           yaml::skip_newline(peek, end);
 6001|   105k|                        }
 6002|       |                        // Measure indent of next content line
 6003|   209k|                        int32_t next_indent = 0;
 6004|   396k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 383k, False: 13.5k]
  |  Branch (6004:47): [True: 187k, False: 195k]
  ------------------
 6005|   187k|                           ++next_indent;
 6006|   187k|                           ++peek;
 6007|   187k|                        }
 6008|   209k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 195k, False: 13.5k]
  |  Branch (6008:44): [True: 193k, False: 1.99k]
  |  Branch (6008:61): [True: 192k, False: 1.21k]
  ------------------
 6009|   192k|                           const bool indentless_sequence =
 6010|   192k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 189k, False: 2.86k]
  |  Branch (6010:69): [True: 50.5k, False: 139k]
  ------------------
 6011|  50.5k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 360, False: 50.1k]
  ------------------
 6012|  50.1k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 46.8k, False: 3.27k]
  ------------------
 6013|  47.2k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 3.54k, False: 43.6k]
  ------------------
 6014|  43.6k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 25.3k, False: 18.3k]
  |  Branch (6014:61): [True: 23.9k, False: 1.35k]
  ------------------
 6015|   192k|                           value_is_indentless_sequence = indentless_sequence;
 6016|   192k|                           const bool same_indent_property_node =
 6017|   192k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 17.9k, False: 174k]
  ------------------
 6018|  17.9k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 1.11k, False: 16.8k]
  |  Branch (6018:48): [True: 4.65k, False: 12.1k]
  |  Branch (6018:64): [True: 254, False: 11.9k]
  |  Branch (6018:80): [True: 762, False: 11.1k]
  |  Branch (6018:96): [True: 648, False: 10.5k]
  ------------------
 6019|  10.5k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 974, False: 9.52k]
  |  Branch (6019:48): [True: 350, False: 9.17k]
  |  Branch (6019:65): [True: 334, False: 8.84k]
  |  Branch (6019:81): [True: 3.83k, False: 5.00k]
  ------------------
 6020|   192k|                           value_on_next_line =
 6021|   192k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 134k, False: 58.3k]
  |  Branch (6021:71): [True: 27.5k, False: 30.8k]
  |  Branch (6021:94): [True: 12.9k, False: 17.9k]
  ------------------
 6022|   192k|                        }
 6023|   209k|                     }
 6024|   210k|                  }
 6025|   225k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 50.3k, False: 174k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  50.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  50.3k|                     return;
 6029|  50.3k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|   174k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 14.0k, False: 160k]
  ------------------
 6032|   102k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 102k, False: 0]
  |  Branch (6032:42): [True: 92.0k, False: 10.5k]
  |  Branch (6032:57): [True: 88.5k, False: 3.49k]
  ------------------
 6033|  14.0k|                  }
 6034|   174k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 174k, False: 0]
  ------------------
 6035|   247k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 247k, False: 0]
  |  Branch (6035:40): [True: 25.1k, False: 221k]
  |  Branch (6035:55): [True: 47.0k, False: 174k]
  ------------------
 6036|  72.2k|                     yaml::skip_newline(it, end);
 6037|  72.2k|                  }
 6038|   174k|                  yaml::skip_inline_ws(it, end);
 6039|   174k|                  anchor_on_same_line = false;
 6040|   174k|               }
 6041|       |
 6042|   577k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|   577k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6043:23): [True: 403k, False: 174k]
  |  Branch (6043:46): [True: 5.44k, False: 397k]
  ------------------
 6044|  5.44k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6044:24): [True: 6, False: 5.43k]
  |  Branch (6044:43): [True: 6, False: 5.42k]
  ------------------
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|     12|                     ctx.error = error_code::syntax_error;
 6047|     12|                     return;
 6048|     12|                  }
 6049|   577k|               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   577k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 577k, False: 28]
  |  Branch (6053:33): [True: 3.45k, False: 574k]
  |  Branch (6053:47): [True: 28, False: 3.42k]
  ------------------
 6054|     28|                  ctx.error = error_code::syntax_error;
 6055|     28|                  return;
 6056|     28|               }
 6057|       |
 6058|   577k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|   577k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6059:23): [True: 174k, False: 403k]
  |  Branch (6059:47): [True: 174k, False: 16]
  |  Branch (6059:60): [True: 10.6k, False: 164k]
  ------------------
 6060|  10.6k|                     auto probe = it + 1;
 6061|  10.6k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|  10.6k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6062:26): [True: 22, False: 10.6k]
  ------------------
 6063|     22|                        ctx.error = error_code::syntax_error;
 6064|     22|                        return;
 6065|     22|                     }
 6066|  10.6k|                     yaml::skip_inline_ws(probe, end);
 6067|       |                     // Allow nested anchor usage only when it clearly starts a
 6068|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6069|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6070|  10.6k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6070:26): [True: 80, False: 10.5k]
  ------------------
 6071|     80|                        ctx.error = error_code::syntax_error;
 6072|     80|                        return;
 6073|     80|                     }
 6074|  10.6k|                  }
 6075|   577k|               }
 6076|       |
 6077|   577k|               const char* anchor_start = &*it;
 6078|   577k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|   577k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6081|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6082|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6083|       |                  // next line, the anchor applies to the entire next-line content.
 6084|   577k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6084:23): [True: 403k, False: 174k]
  |  Branch (6084:46): [True: 111k, False: 291k]
  ------------------
 6085|   111k|                     auto key_start = it;
 6086|   111k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6086:26): [True: 3.69k, False: 107k]
  ------------------
 6087|  3.69k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|  3.69k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6088:29): [True: 6, False: 3.68k]
  |  Branch (6088:67): [True: 6, False: 3.68k]
  ------------------
 6089|     12|                           ctx.error = error_code::syntax_error;
 6090|     12|                           return;
 6091|     12|                        }
 6092|  3.68k|                        yaml::skip_inline_ws(key_start, end);
 6093|  3.68k|                        if (key_start == end) {
  ------------------
  |  Branch (6093:29): [True: 10, False: 3.67k]
  ------------------
 6094|     10|                           ctx.error = error_code::unexpected_end;
 6095|     10|                           return;
 6096|     10|                        }
 6097|  3.67k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6097:29): [True: 6, False: 3.66k]
  |  Branch (6097:51): [True: 6, False: 3.66k]
  ------------------
 6098|     12|                           ctx.error = error_code::syntax_error;
 6099|     12|                           return;
 6100|     12|                        }
 6101|       |
 6102|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6103|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6104|       |                        // key-span registration below while the untagged spelling was rejected;
 6105|       |                        // an alias node carries no other properties either way.
 6106|  3.66k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6106:29): [True: 1.22k, False: 2.43k]
  |  Branch (6106:50): [True: 6, False: 1.21k]
  ------------------
 6107|      6|                           ctx.error = error_code::syntax_error;
 6108|      6|                           return;
 6109|      6|                        }
 6110|  3.66k|                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|   111k|                     auto key_scan = key_start;
 6114|   111k|                     auto key_end = key_start;
 6115|   111k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6115:26): [True: 922, False: 110k]
  |  Branch (6115:46): [True: 358, False: 110k]
  ------------------
 6116|       |                        // Quoted key: skip to closing quote
 6117|  1.28k|                        const char quote = *key_scan;
 6118|  1.28k|                        ++key_scan;
 6119|  9.64k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6119:32): [True: 9.64k, False: 0]
  |  Branch (6119:51): [True: 8.36k, False: 1.28k]
  ------------------
 6120|  8.36k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6120:32): [True: 442, False: 7.92k]
  |  Branch (6120:53): [True: 224, False: 218]
  ------------------
 6121|    224|                              ++key_scan;
 6122|    224|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6122:35): [True: 224, False: 0]
  ------------------
 6123|    224|                           }
 6124|  8.14k|                           else {
 6125|  8.14k|                              ++key_scan;
 6126|  8.14k|                           }
 6127|  8.36k|                        }
 6128|  1.28k|                        if (key_scan == end) {
  ------------------
  |  Branch (6128:29): [True: 0, False: 1.28k]
  ------------------
 6129|      0|                           ctx.error = error_code::syntax_error;
 6130|      0|                           return;
 6131|      0|                        }
 6132|  1.28k|                        ++key_scan; // past closing quote
 6133|  1.28k|                        key_end = key_scan;
 6134|  1.28k|                        yaml::skip_inline_ws(key_scan, end);
 6135|  1.28k|                     }
 6136|   110k|                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|  1.49M|                        while (key_scan != end) {
  ------------------
  |  Branch (6138:32): [True: 1.49M, False: 6]
  ------------------
 6139|  1.49M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6139:32): [True: 146k, False: 1.34M]
  ------------------
 6140|   146k|                              auto next = key_scan + 1;
 6141|   146k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6141:35): [True: 24.2k, False: 122k]
  |  Branch (6141:50): [True: 49.2k, False: 72.9k]
  |  Branch (6141:66): [True: 14.9k, False: 57.9k]
  |  Branch (6141:83): [True: 17.3k, False: 40.6k]
  |  Branch (6141:100): [True: 4.30k, False: 36.3k]
  ------------------
 6142|   110k|                                 break;
 6143|   110k|                              }
 6144|   146k|                           }
 6145|  1.38M|                           ++key_scan;
 6146|  1.38M|                        }
 6147|   110k|                        key_end = key_scan;
 6148|   127k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6148:32): [True: 111k, False: 15.2k]
  |  Branch (6148:57): [True: 16.2k, False: 95.6k]
  |  Branch (6148:82): [True: 800, False: 94.8k]
  ------------------
 6149|  17.0k|                           --key_end;
 6150|  17.0k|                        }
 6151|   110k|                     }
 6152|   111k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6152:26): [True: 12, False: 111k]
  |  Branch (6152:45): [True: 60, False: 111k]
  ------------------
 6153|     72|                        ctx.error = error_code::syntax_error;
 6154|     72|                        return;
 6155|     72|                     }
 6156|       |                     // Store anchor with just the key text span
 6157|   111k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|   111k|                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|   111k|                     if constexpr (counts::n_object > 0) {
 6161|   111k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|   111k|                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|   111k|                     return;
 6168|   111k|                  }
 6169|   577k|               }
 6170|       |
 6171|   466k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   577k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   577k|               redispatch<Opts>(value, ctx, it, end);
 6174|   577k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   577k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 434k, False: 143k]
  ------------------
 6176|   434k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|   434k|               }
 6178|   577k|               return;
 6179|   577k|            }
 6180|  29.2k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 29.2k, False: 2.58M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|  29.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|  29.2k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6183:23): [True: 7.62k, False: 21.6k]
  ------------------
 6184|  7.62k|                     if constexpr (counts::n_object > 0) {
 6185|  7.62k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|  7.62k|                                                                                                        end);
 6187|  7.62k|                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|  7.62k|                  }
 6194|  29.2k|               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|  29.2k|               return;
 6199|   577k|            }
 6200|   233k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 233k, False: 2.38M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   233k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   233k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 22, False: 233k]
  ------------------
 6204|     22|                  ctx.error = error_code::syntax_error;
 6205|     22|                  return;
 6206|     22|               }
 6207|   233k|               yaml::skip_inline_ws(it, end);
 6208|   233k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 228k, False: 5.65k]
  |  Branch (6208:33): [True: 42.7k, False: 185k]
  ------------------
 6209|  42.7k|                  yaml::skip_comment(it, end);
 6210|  42.7k|               }
 6211|   233k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 226k, False: 6.80k]
  |  Branch (6211:34): [True: 49.9k, False: 176k]
  |  Branch (6211:49): [True: 64.7k, False: 112k]
  ------------------
 6212|   114k|                  auto content = it;
 6213|   114k|                  yaml::skip_newline(content, end);
 6214|   114k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|   114k|                  bool consume_following_content = false;
 6217|   114k|                  auto content_token = content;
 6218|   114k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 97.1k, False: 17.5k]
  ------------------
 6219|  97.1k|                     auto indent_probe = content;
 6220|  97.1k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  97.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 8, False: 97.1k]
  ------------------
 6222|      8|                        return;
 6223|  97.1k|                     content_token = indent_probe;
 6224|       |
 6225|       |                     // A tag at the end of a sequence/map entry has an empty value
 6226|       |                     // unless the next non-empty content is nested under the current node.
 6227|  97.1k|                     bool tagged_indentless_sequence = false;
 6228|  97.1k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 20.0k, False: 77.1k]
  |  Branch (6228:56): [True: 20.0k, False: 0]
  |  Branch (6228:79): [True: 18.5k, False: 1.44k]
  ------------------
 6229|  18.5k|                        const auto after_dash = indent_probe + 1;
 6230|  18.5k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 2.29k, False: 16.2k]
  ------------------
 6231|  17.7k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 15.4k, False: 802]
  ------------------
 6232|  17.7k|                           tagged_indentless_sequence =
 6233|  17.7k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 2.09k, False: 15.6k]
  ------------------
 6234|  15.6k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 11.0k, False: 4.59k]
  |  Branch (6234:60): [True: 830, False: 10.2k]
  ------------------
 6235|  17.7k|                        }
 6236|  18.5k|                     }
 6237|       |
 6238|  97.1k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 25.3k, False: 71.8k]
  ------------------
 6239|  71.8k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 27.3k, False: 44.5k]
  |  Branch (6239:93): [True: 2.92k, False: 41.5k]
  ------------------
 6240|  97.1k|                  }
 6241|       |
 6242|   114k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 55.5k, False: 59.1k]
  ------------------
 6243|  55.5k|                     it = content_token;
 6244|  55.5k|                  }
 6245|  59.1k|                  else {
 6246|  59.1k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 8.09k, False: 51.0k]
  ------------------
 6247|  8.09k|                        if constexpr (counts::n_str > 0) {
 6248|  8.09k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  8.09k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  8.09k|                           value = StrType{};
 6251|  8.09k|                           return;
 6252|  8.09k|                        }
 6253|  8.09k|                     }
 6254|  59.1k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 332, False: 58.7k]
  ------------------
 6255|    332|                        if constexpr (counts::n_null > 0) {
 6256|    332|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    332|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    332|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 332]
  ------------------
 6259|    332|                           return;
 6260|    332|                        }
 6261|    332|                     }
 6262|  59.1k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 43.3k, False: 15.8k]
  ------------------
 6263|  43.3k|                        if constexpr (counts::n_null > 0) {
 6264|  43.3k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  43.3k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  43.3k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 43.3k]
  ------------------
 6267|  43.3k|                           return;
 6268|  43.3k|                        }
 6269|  43.3k|                     }
 6270|  59.1k|                  }
 6271|   114k|               }
 6272|   233k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6273|       |                  // In block context, a comma immediately after a tag token is malformed
 6274|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6275|   233k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6275:23): [True: 175k, False: 58.5k]
  |  Branch (6275:36): [True: 6, False: 175k]
  ------------------
 6276|      6|                     ctx.error = error_code::syntax_error;
 6277|      6|                     return;
 6278|      6|                  }
 6279|   233k|                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|   233k|                     const bool starts_block_sequence_entry =
 6282|   233k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6282:26): [True: 175k, False: 58.5k]
  |  Branch (6282:39): [True: 26.6k, False: 148k]
  ------------------
 6283|  26.6k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6283:26): [True: 3.01k, False: 23.6k]
  |  Branch (6283:45): [True: 21.8k, False: 1.79k]
  ------------------
 6284|   233k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6284:26): [True: 157k, False: 76.6k]
  |  Branch (6284:58): [True: 8.94k, False: 148k]
  ------------------
 6285|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6286|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6287|  8.94k|                        redispatch<Opts>(value, ctx, it, end);
 6288|  8.94k|                        return;
 6289|  8.94k|                     }
 6290|   233k|                  }
 6291|   233k|               }
 6292|   233k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 6.80k, False: 226k]
  ------------------
 6293|  6.80k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 2.59k, False: 4.20k]
  ------------------
 6294|  2.59k|                     if constexpr (counts::n_str > 0) {
 6295|  2.59k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|  2.59k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|  2.59k|                        value = StrType{};
 6298|  2.59k|                        return;
 6299|  2.59k|                     }
 6300|  2.59k|                  }
 6301|  6.80k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 4.20k, False: 2.60k]
  ------------------
 6302|  4.20k|                     if constexpr (counts::n_null > 0) {
 6303|  4.20k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  4.20k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  4.20k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 4.20k]
  ------------------
 6306|  4.20k|                        return;
 6307|  4.20k|                     }
 6308|  4.20k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  6.80k|                  return;
 6311|  6.80k|               }
 6312|   226k|               switch (tag) {
 6313|  3.10k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 3.10k, False: 223k]
  ------------------
 6314|  3.10k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  3.10k|                  return;
 6316|  5.69k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 5.69k, False: 221k]
  ------------------
 6317|  5.90k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 216, False: 226k]
  ------------------
 6318|  5.90k|                  if constexpr (counts::n_num > 0) {
 6319|  5.90k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  5.90k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  39.0k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 33.1k, False: 193k]
  ------------------
 6327|  39.0k|                  if constexpr (counts::n_bool > 0) {
 6328|  39.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  39.0k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  39.7k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 608, False: 226k]
  ------------------
 6336|  39.7k|                  if constexpr (counts::n_null > 0) {
 6337|  39.7k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  39.7k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  39.7k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 39.7k]
  ------------------
 6340|  39.7k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  39.7k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  62.6k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 22.9k, False: 203k]
  ------------------
 6348|  62.6k|                  if constexpr (counts::n_object > 0) {
 6349|  62.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  62.6k|                                                                                                     end);
 6351|  62.6k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  96.2k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 33.6k, False: 193k]
  ------------------
 6358|  96.2k|                  if constexpr (counts::n_array > 0) {
 6359|  96.2k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|  96.2k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|  96.2k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6361:29): [True: 33.6k, False: 62.6k]
  |  Branch (6361:42): [True: 18.2k, False: 15.4k]
  ------------------
 6362|  18.2k|                           ctx.allow_indentless_sequence = true;
 6363|  18.2k|                        }
 6364|  96.2k|                     }
 6365|  96.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  96.2k|                                                                                                    end);
 6367|  96.2k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  96.2k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   163k|               default: {
  ------------------
  |  Branch (6374:16): [True: 66.8k, False: 160k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   163k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 66.8k, False: 96.2k]
  |  Branch (6377:36): [True: 12.8k, False: 53.9k]
  ------------------
 6378|  12.8k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  12.8k|                     return;
 6380|  12.8k|                  }
 6381|       |
 6382|   150k|                  if constexpr (counts::n_array > 0) {
 6383|   150k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 53.9k, False: 96.2k]
  |  Branch (6383:39): [True: 1.24k, False: 52.7k]
  ------------------
 6384|  1.24k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  1.24k|                                                                                                       end);
 6386|  1.24k|                        return;
 6387|  1.24k|                     }
 6388|   150k|                  }
 6389|   150k|                  if constexpr (counts::n_object > 0) {
 6390|   150k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 52.7k, False: 97.5k]
  |  Branch (6390:39): [True: 3.90k, False: 48.8k]
  ------------------
 6391|  3.90k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  3.90k|                                                                                                        end);
 6393|  3.90k|                        return;
 6394|  3.90k|                     }
 6395|   150k|                  }
 6396|       |
 6397|   150k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|   150k|                     if constexpr (counts::n_array > 0) {
 6399|   150k|                        const bool starts_block_sequence_entry =
 6400|   150k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6400:29): [True: 48.8k, False: 101k]
  |  Branch (6400:42): [True: 7.76k, False: 41.0k]
  ------------------
 6401|  7.76k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6401:29): [True: 716, False: 7.04k]
  |  Branch (6401:48): [True: 6.25k, False: 788]
  ------------------
 6402|   150k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6402:29): [True: 6.97k, False: 143k]
  ------------------
 6403|  6.97k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|  6.97k|                                                                                                          it, end);
 6405|  6.97k|                           return;
 6406|  6.97k|                        }
 6407|   150k|                     }
 6408|   150k|                     if constexpr (counts::n_object > 0) {
 6409|   150k|                        const bool starts_explicit_mapping_indicator =
 6410|   150k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6410:29): [True: 41.8k, False: 108k]
  |  Branch (6410:43): [True: 2.44k, False: 39.4k]
  |  Branch (6410:57): [True: 2.38k, False: 37.0k]
  ------------------
 6411|  4.83k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6411:29): [True: 200, False: 4.63k]
  |  Branch (6411:48): [True: 1.67k, False: 2.95k]
  ------------------
 6412|   150k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6412:29): [True: 1.87k, False: 148k]
  ------------------
 6413|  1.87k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|  1.87k|                                                                                                           it, end);
 6415|  1.87k|                           return;
 6416|  1.87k|                        }
 6417|   148k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6417:29): [True: 0, False: 148k]
  ------------------
 6418|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6419|      0|                                                                                                           it, end);
 6420|      0|                           return;
 6421|      0|                        }
 6422|   148k|                     }
 6423|   150k|                  }
 6424|       |
 6425|   150k|                  if constexpr (counts::n_str > 0) {
 6426|   150k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   150k|                     return;
 6428|   150k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   150k|                  return;
 6433|   163k|               }
 6434|   226k|               }
 6435|      0|               return;
 6436|   226k|            }
 6437|   136k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 136k, False: 2.47M]
  ------------------
 6438|   136k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|   136k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6440:23): [True: 98.9k, False: 37.2k]
  |  Branch (6440:51): [True: 12.5k, False: 86.3k]
  ------------------
 6441|  12.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|  12.5k|                                                                                                     end);
 6443|  12.5k|                     return;
 6444|  12.5k|                  }
 6445|   136k|               }
 6446|       |               // Flow mapping - object type
 6447|   123k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|   136k|               return;
 6449|  69.4k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 69.4k, False: 2.54M]
  ------------------
 6450|  69.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|  69.4k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6452:23): [True: 38.7k, False: 30.6k]
  |  Branch (6452:51): [True: 1.06k, False: 37.6k]
  ------------------
 6453|  1.06k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|  1.06k|                                                                                                     end);
 6455|  1.06k|                     return;
 6456|  1.06k|                  }
 6457|  69.4k|               }
 6458|       |               // Flow sequence - array type
 6459|  68.3k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  69.4k|               return;
 6461|   508k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 508k, False: 2.10M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   508k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 505k, False: 2.88k]
  |  Branch (6463:39): [True: 10, False: 505k]
  ------------------
 6464|     10|                  ctx.error = error_code::syntax_error;
 6465|     10|                  return;
 6466|     10|               }
 6467|   508k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 505k, False: 2.88k]
  |  Branch (6467:40): [True: 166k, False: 338k]
  |  Branch (6467:56): [True: 238k, False: 99.9k]
  |  Branch (6467:73): [True: 75.9k, False: 24.0k]
  ------------------
 6468|   481k|                  if constexpr (counts::n_object > 0) {
 6469|   481k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   481k|                                                                                                     end);
 6471|   481k|                     return;
 6472|   481k|                  }
 6473|   481k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   508k|               return;
 6476|      8|            case '%':
  ------------------
  |  Branch (6476:13): [True: 8, False: 2.61M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|      8|               ctx.error = error_code::syntax_error;
 6479|      8|               return;
 6480|  15.3k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 15.3k, False: 2.59M]
  ------------------
 6481|  18.0k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 2.75k, False: 2.61M]
  ------------------
 6482|       |               // Could be a quoted string OR a quoted key in a block mapping
 6483|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6484|  18.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  18.0k|               return;
 6486|  42.2k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 42.2k, False: 2.57M]
  ------------------
 6487|  84.3k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 42.1k, False: 2.57M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  84.3k|               if constexpr (counts::n_bool > 0) {
 6490|  84.3k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 80.7k, False: 3.54k]
  |  Branch (6490:44): [True: 42.4k, False: 38.3k]
  |  Branch (6490:60): [True: 40.4k, False: 1.99k]
  |  Branch (6490:76): [True: 33.1k, False: 7.37k]
  ------------------
 6491|  47.6k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 7.28k, False: 40.3k]
  |  Branch (6491:60): [True: 4.58k, False: 2.70k]
  |  Branch (6491:76): [True: 3.10k, False: 1.47k]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  36.2k|                     const auto after_true = it + 4;
 6494|  36.2k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  36.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 34.4k, False: 1.79k]
  ------------------
 6497|  34.4k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 340, False: 34.0k]
  ------------------
 6498|    340|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|    340|                           return;
 6500|    340|                        }
 6501|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6502|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6503|  34.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 33.0k, False: 1.06k]
  |  Branch (6503:47): [True: 20.3k, False: 12.6k]
  ------------------
 6504|  20.3k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 16.4k, False: 3.90k]
  |  Branch (6504:47): [True: 692, False: 3.21k]
  |  Branch (6504:63): [True: 1.13k, False: 2.07k]
  |  Branch (6504:80): [True: 1.37k, False: 700]
  |  Branch (6504:97): [True: 700, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  20.3k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  20.3k|                           return;
 6508|  20.3k|                        }
 6509|  13.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  13.7k|                                                                                                      end);
 6511|  13.7k|                        return;
 6512|  34.0k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  36.2k|                  }
 6515|  84.3k|               }
 6516|  49.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  84.3k|               return;
 6518|  62.4k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 62.4k, False: 2.55M]
  ------------------
 6519|  74.5k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 12.0k, False: 2.60M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  74.5k|               if constexpr (counts::n_bool > 0) {
 6522|  74.5k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 72.3k, False: 2.15k]
  |  Branch (6522:44): [True: 60.3k, False: 11.9k]
  |  Branch (6522:60): [True: 50.6k, False: 9.71k]
  |  Branch (6522:76): [True: 44.8k, False: 5.83k]
  |  Branch (6522:92): [True: 41.3k, False: 3.49k]
  ------------------
 6523|  42.0k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 2.87k, False: 28.1k]
  |  Branch (6523:60): [True: 2.13k, False: 740]
  |  Branch (6523:76): [True: 956, False: 1.17k]
  |  Branch (6523:92): [True: 666, False: 290]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  42.0k|                     const auto after_false = it + 5;
 6526|  42.0k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  42.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 36.4k, False: 5.54k]
  ------------------
 6529|  36.4k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 246, False: 36.2k]
  ------------------
 6530|    246|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|    246|                           return;
 6532|    246|                        }
 6533|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6534|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6535|  36.2k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 35.3k, False: 860]
  |  Branch (6535:47): [True: 26.8k, False: 8.55k]
  ------------------
 6536|  26.8k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 3.39k, False: 23.4k]
  |  Branch (6536:47): [True: 2.71k, False: 20.7k]
  |  Branch (6536:63): [True: 5.08k, False: 15.6k]
  |  Branch (6536:80): [True: 14.8k, False: 736]
  |  Branch (6536:97): [True: 736, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  26.8k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  26.8k|                           return;
 6540|  26.8k|                        }
 6541|  9.41k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  9.41k|                                                                                                      end);
 6543|  9.41k|                        return;
 6544|  36.2k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  42.0k|                  }
 6547|  74.5k|               }
 6548|  38.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  74.5k|               return;
 6550|  23.7k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 23.7k, False: 2.59M]
  ------------------
 6551|  50.7k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 26.9k, False: 2.58M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  50.7k|               if constexpr (counts::n_null > 0) {
 6554|  50.7k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 49.1k, False: 1.58k]
  |  Branch (6554:44): [True: 25.0k, False: 24.1k]
  |  Branch (6554:60): [True: 23.6k, False: 1.34k]
  |  Branch (6554:76): [True: 21.4k, False: 2.20k]
  ------------------
 6555|  31.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 11.7k, False: 15.9k]
  |  Branch (6555:60): [True: 10.8k, False: 878]
  |  Branch (6555:76): [True: 10.3k, False: 490]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  31.8k|                     const auto after_null = it + 4;
 6558|  31.8k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  31.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 26.6k, False: 5.20k]
  ------------------
 6561|  26.6k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 1.78k, False: 24.8k]
  ------------------
 6562|  1.78k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|  1.78k|                           return;
 6564|  1.78k|                        }
 6565|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6566|       |                        // "null: value" should parse as {null: value}, not as the null type
 6567|  24.8k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 23.8k, False: 1.02k]
  |  Branch (6567:47): [True: 4.99k, False: 18.8k]
  ------------------
 6568|  4.99k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 1.26k, False: 3.72k]
  |  Branch (6568:47): [True: 774, False: 2.95k]
  |  Branch (6568:63): [True: 246, False: 2.70k]
  |  Branch (6568:80): [True: 782, False: 1.92k]
  |  Branch (6568:97): [True: 1.92k, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  4.99k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  4.99k|                           return;
 6572|  4.99k|                        }
 6573|  19.8k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  19.8k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  19.8k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 19.8k]
  ------------------
 6576|  19.8k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  19.8k|                        return;
 6578|  24.8k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  31.8k|                  }
 6581|  50.7k|               }
 6582|  24.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  50.7k|               return;
 6584|  6.49k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 6.49k, False: 2.60M]
  ------------------
 6585|       |               // Null indicator
 6586|  6.49k|               if constexpr (counts::n_null > 0) {
 6587|  6.49k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  6.49k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  6.49k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 6.49k]
  ------------------
 6590|  6.49k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  6.49k|                  return;
 6592|  6.49k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   247k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 247k, False: 2.36M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   247k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 15.9k, False: 231k]
  |  Branch (6596:41): [True: 182k, False: 48.9k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   198k|                  if constexpr (counts::n_array > 0) {
 6599|   198k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   198k|                                                                                                    end);
 6601|   198k|                     return;
 6602|   198k|                  }
 6603|   198k|               }
 6604|   247k|               if constexpr (counts::n_num > 0) {
 6605|   247k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 48.9k, False: 198k]
  |  Branch (6605:43): [True: 4.28k, False: 44.6k]
  |  Branch (6605:94): [True: 4.19k, False: 40.4k]
  ------------------
 6606|  8.48k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  8.48k|                     return;
 6608|  8.48k|                  }
 6609|   247k|               }
 6610|   238k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   247k|               return;
 6612|  20.3k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 20.3k, False: 2.59M]
  ------------------
 6613|  62.4k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 42.1k, False: 2.57M]
  ------------------
 6614|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6615|       |               // Try parsing as number speculatively, fall back to string on failure
 6616|  62.4k|               if constexpr (counts::n_num > 0) {
 6617|  62.4k|                  auto start_it = it;
 6618|  62.4k|                  auto temp_ctx = ctx.make_speculative();
 6619|  62.4k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  62.4k|                                                                                               end);
 6621|  62.4k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  62.4k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  62.4k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 9.79k, False: 52.6k]
  ------------------
 6624|  9.79k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  9.79k|                     return; // Successfully parsed as number
 6626|  9.79k|                  }
 6627|  52.6k|                  it = start_it; // Restore and fall through to string
 6628|  52.6k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  62.4k|               return;
 6631|   465k|            default:
  ------------------
  |  Branch (6631:13): [True: 465k, False: 2.14M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|   465k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 288k, False: 177k]
  |  Branch (6633:32): [True: 82.5k, False: 205k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  82.5k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 10.6k, False: 71.8k]
  ------------------
 6636|  10.6k|                     return;
 6637|  10.6k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  71.8k|                  if constexpr (counts::n_num > 0) {
 6640|  71.8k|                     auto start_it = it;
 6641|  71.8k|                     auto temp_ctx = ctx.make_speculative();
 6642|  71.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  71.8k|                                                                                                  end);
 6644|  71.8k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  71.8k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  71.8k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 16.8k, False: 55.0k]
  ------------------
 6647|  16.8k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  16.8k|                        return; // Successfully parsed as number
 6649|  16.8k|                     }
 6650|  55.0k|                     it = start_it; // Restore and fall through to string
 6651|  55.0k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|  71.8k|                  return;
 6655|  82.5k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   383k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   383k|               return;
 6659|  2.61M|            }
 6660|  2.61M|         }
 6661|       |
 6662|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6663|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6664|       |
 6665|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6666|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6667|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6668|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6669|  2.61M|         error_code expansion_error{};
 6670|  2.61M|         std::string_view expansion_message{};
 6671|       |
 6672|  2.61M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  2.61M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  2.61M|            auto start = it;
 6675|       |
 6676|  2.61M|            V v{};
 6677|  2.61M|            auto temp_ctx = ctx.make_speculative();
 6678|  2.61M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  2.61M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  2.61M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  2.61M|            if (!bool(temp_ctx.error)) {
 6683|  2.61M|               value = std::move(v);
 6684|  2.61M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  2.61M|               return true;
 6686|  2.61M|            }
 6687|       |
 6688|  2.61M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  2.61M|               expansion_error = temp_ctx.error;
 6690|  2.61M|               expansion_message = temp_ctx.custom_error_message;
 6691|  2.61M|            }
 6692|  2.61M|            it = start;
 6693|  2.61M|            return false;
 6694|  2.61M|         };
 6695|       |
 6696|  2.61M|         bool parsed = false;
 6697|  2.61M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  2.61M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  2.61M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  2.61M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 2.61M]
  ------------------
 6702|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6702:17): [True: 0, False: 0]
  ------------------
 6703|      0|               ctx.error = expansion_error;
 6704|      0|               ctx.custom_error_message = expansion_message;
 6705|      0|            }
 6706|      0|            else {
 6707|      0|               ctx.error = error_code::no_matching_variant_type;
 6708|      0|            }
 6709|      0|         }
 6710|  2.61M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|  1.08M|      {
 5311|  1.08M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  1.08M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  1.08M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  1.08M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  1.08M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 1.08M, False: 0]
  ------------------
 5321|  1.08M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  1.08M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|  1.09M|      {
 4617|  1.09M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 1.09M]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|  1.09M|         yaml::node_preamble_state preamble{};
 4621|  1.09M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 8.57k, False: 1.08M]
  ------------------
 4622|  1.09M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  8.57k|            return;
 4624|       |
 4625|  1.08M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|  1.08M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 2.52k, False: 1.08M]
  ------------------
 4627|  2.52k|            return;
 4628|       |
 4629|  1.08M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|  1.08M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4631|       |
 4632|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4633|       |         // value of a key that existed before the read and adds new keys, while
 4634|       |         // pre-existing keys the document does not mention are preserved (like a
 4635|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4636|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4637|       |         // mappings disallow duplicate keys and the conformance suite expects
 4638|       |         // first-wins, which falls out of emplace into an empty map. Any
 4639|       |         // pre-existing entry the document leaves untouched is restored on scope
 4640|       |         // exit (including error paths). When the target starts empty (the common
 4641|       |         // case) this is a no-op with negligible cost.
 4642|  1.08M|         std::remove_cvref_t<T> preexisting_entries;
 4643|  1.08M|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 1.08M]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|  1.08M|         struct merge_restore_guard
 4648|  1.08M|         {
 4649|  1.08M|            std::remove_cvref_t<T>& target;
 4650|  1.08M|            std::remove_cvref_t<T>& saved;
 4651|  1.08M|            ~merge_restore_guard()
 4652|  1.08M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  1.08M|               for (auto& entry : saved) {
 4656|  1.08M|                  target.emplace(entry.first, std::move(entry.second));
 4657|  1.08M|               }
 4658|  1.08M|            }
 4659|  1.08M|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|  1.08M|         const bool treat_as_block_mapping =
 4662|  1.08M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [True: 1.08M, Folded]
  |  Branch (4662:48): [True: 155k, False: 930k]
  |  Branch (4662:62): [True: 2.52k, False: 153k]
  ------------------
 4663|       |
 4664|  1.08M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 155k, False: 930k]
  |  Branch (4664:28): [True: 153k, False: 2.52k]
  ------------------
 4665|       |            // Flow mapping
 4666|   153k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|   153k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|   153k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 145k, False: 8.08k]
  |  Branch (4670:30): [True: 8.28k, False: 137k]
  ------------------
 4671|  8.28k|               ++it;
 4672|  8.28k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  8.28k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 6, False: 8.28k]
  ------------------
 4674|      6|                  return;
 4675|  8.28k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  8.28k|               return;
 4677|  8.28k|            }
 4678|       |
 4679|   636k|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 616k, False: 19.4k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|   616k|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|   616k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 616k, False: 0]
  |  Branch (4683:33): [True: 18.8k, False: 598k]
  ------------------
 4684|  18.8k|                  ++it;
 4685|  18.8k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  18.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 6, False: 18.7k]
  ------------------
 4687|      6|                     return;
 4688|  18.7k|                  break;
 4689|  18.8k|               }
 4690|       |
 4691|   598k|               bool explicit_flow_key = false;
 4692|   598k|               auto explicit_probe = it;
 4693|   598k|               yaml::skip_inline_ws(explicit_probe, end);
 4694|   598k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 598k, False: 0]
  |  Branch (4694:45): [True: 12.6k, False: 585k]
  ------------------
 4695|  12.6k|                  const auto after_q = explicit_probe + 1;
 4696|  12.6k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 10, False: 12.6k]
  |  Branch (4696:41): [True: 7.35k, False: 5.31k]
  ------------------
 4697|  8.39k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 724, False: 4.58k]
  |  Branch (4697:42): [True: 310, False: 4.27k]
  ------------------
 4698|  8.39k|                     explicit_flow_key = true;
 4699|  8.39k|                     it = explicit_probe + 1;
 4700|  8.39k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  8.39k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 6, False: 8.39k]
  ------------------
 4702|      6|                        return;
 4703|  8.39k|                  }
 4704|  12.6k|               }
 4705|       |               // Parse key
 4706|   598k|               key_t key{};
 4707|   598k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|   598k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 8.39k, False: 589k]
  |  Branch (4708:44): [True: 8.37k, False: 12]
  |  Branch (4708:58): [True: 1.00k, False: 7.37k]
  |  Branch (4708:72): [True: 1.64k, False: 5.72k]
  |  Branch (4708:86): [True: 766, False: 4.95k]
  ------------------
 4709|  3.42k|                     key.clear();
 4710|  3.42k|                  }
 4711|   594k|                  else {
 4712|   594k|                     auto key_probe = it;
 4713|   594k|                     yaml::skip_inline_ws(key_probe, end);
 4714|       |
 4715|       |                     // Use full node parsing only for structurally complex flow keys.
 4716|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4717|   594k|                     bool parse_complex_flow_key = false;
 4718|   594k|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 594k, False: 12]
  ------------------
 4719|   594k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 1.23k, False: 593k]
  |  Branch (4719:50): [True: 7.03k, False: 586k]
  ------------------
 4720|  8.26k|                           parse_complex_flow_key = true;
 4721|  8.26k|                        }
 4722|   586k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 69.0k, False: 517k]
  ------------------
 4723|  69.0k|                           ++key_probe;
 4724|  69.0k|                           yaml::parse_anchor_name(key_probe, end);
 4725|  69.0k|                           yaml::skip_inline_ws(key_probe, end);
 4726|  69.0k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 69.0k, False: 50]
  |  Branch (4726:53): [True: 340, False: 68.6k]
  |  Branch (4726:74): [True: 33.9k, False: 34.7k]
  ------------------
 4727|  34.3k|                              parse_complex_flow_key = true;
 4728|  34.3k|                           }
 4729|  69.0k|                        }
 4730|   594k|                     }
 4731|       |
 4732|   594k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 42.5k, False: 552k]
  ------------------
 4733|  42.5k|                        glz::generic key_node{};
 4734|  42.5k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  42.5k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 2.31k, False: 40.2k]
  ------------------
 4736|  2.31k|                           return;
 4737|  40.2k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 10, False: 40.2k]
  ------------------
 4738|     10|                           return;
 4739|  40.2k|                     }
 4740|   552k|                     else {
 4741|   552k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 21.2k, False: 530k]
  ------------------
 4742|  21.2k|                           return;
 4743|  21.2k|                        }
 4744|   552k|                     }
 4745|   594k|                  }
 4746|       |               }
 4747|       |               else {
 4748|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4749|       |                     ctx.error = error_code::syntax_error;
 4750|       |                     return;
 4751|       |                  }
 4752|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4753|       |                  if (bool(ctx.error)) [[unlikely]]
 4754|       |                     return;
 4755|       |               }
 4756|       |
 4757|       |               // Separation between flow key and ':' may include comments/newlines.
 4758|       |               // In flow context, newlines are allowed between key and ':'.
 4759|   574k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|   598k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 6, False: 598k]
  ------------------
 4761|      6|                  return;
 4762|       |
 4763|   598k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|   598k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|   598k|                     val = {};
 4766|   598k|                     return true;
 4767|   598k|                  }
 4768|   598k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   598k|                     val = glz::generic{};
 4770|   598k|                     return true;
 4771|   598k|                  }
 4772|   598k|                  else {
 4773|   598k|                     static constexpr std::string_view null_value{"null"};
 4774|   598k|                     auto null_it = null_value.data();
 4775|   598k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|   598k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|   598k|                     return !bool(ctx.error);
 4778|   598k|                  }
 4779|   598k|               };
 4780|       |
 4781|   598k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 574k, False: 23.6k]
  |  Branch (4781:34): [True: 205k, False: 369k]
  |  Branch (4781:48): [True: 33.4k, False: 335k]
  ------------------
 4782|   238k|                  val_t val{};
 4783|   238k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 238k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|   238k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|   238k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 33.4k, False: 205k]
  ------------------
 4789|  33.4k|                     ++it;
 4790|  33.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  33.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 6, False: 33.4k]
  ------------------
 4792|      6|                        return;
 4793|  33.4k|                     break;
 4794|  33.4k|                  }
 4795|       |
 4796|   205k|                  ++it; // skip comma
 4797|   205k|                  yaml::skip_ws_and_newlines(it, end);
 4798|   205k|                  continue;
 4799|   238k|               }
 4800|       |
 4801|   359k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 23.6k, False: 335k]
  |  Branch (4801:33): [True: 62, False: 335k]
  ------------------
 4802|    156|                  ctx.error = error_code::syntax_error;
 4803|    156|                  return;
 4804|    156|               }
 4805|   359k|               ++it;
 4806|       |
 4807|   359k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|   359k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 6, False: 359k]
  ------------------
 4809|      6|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|   359k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 335k, False: 23.5k]
  |  Branch (4812:34): [True: 14.3k, False: 321k]
  |  Branch (4812:48): [True: 14.9k, False: 306k]
  ------------------
 4813|  29.3k|                  val_t val{};
 4814|  29.3k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 29.3k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  29.3k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  29.3k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 14.9k, False: 14.3k]
  ------------------
 4820|  14.9k|                     ++it;
 4821|  14.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  14.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 6, False: 14.9k]
  ------------------
 4823|      6|                        return;
 4824|  14.9k|                     break;
 4825|  14.9k|                  }
 4826|       |
 4827|  14.3k|                  ++it; // skip comma
 4828|  14.3k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  14.3k|                  continue;
 4830|  29.3k|               }
 4831|       |
 4832|       |               // Parse value
 4833|   329k|               val_t val{};
 4834|   329k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|   329k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 1.11k, False: 328k]
  ------------------
 4836|  1.11k|                  return;
 4837|       |
 4838|   328k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|   328k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|   328k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 305k, False: 23.5k]
  |  Branch (4842:33): [True: 31.2k, False: 273k]
  ------------------
 4843|  31.2k|                  ++it;
 4844|  31.2k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|  31.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 6, False: 31.2k]
  ------------------
 4846|      6|                     return;
 4847|  31.2k|                  break;
 4848|  31.2k|               }
 4849|   297k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 273k, False: 23.5k]
  |  Branch (4849:38): [True: 266k, False: 7.98k]
  ------------------
 4850|   266k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|   266k|                  yaml::skip_ws_and_newlines(it, end);
 4853|   266k|               }
 4854|  31.5k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 7.98k, False: 23.5k]
  |  Branch (4854:39): [True: 3.10k, False: 4.88k]
  |  Branch (4854:54): [True: 4.85k, False: 38]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  7.95k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  7.95k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 7.93k, False: 14]
  |  Branch (4858:36): [True: 2.26k, False: 5.67k]
  ------------------
 4859|  2.26k|                     ++it;
 4860|  2.26k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  2.26k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 6, False: 2.25k]
  ------------------
 4862|      6|                        return;
 4863|  2.25k|                     break;
 4864|  2.26k|                  }
 4865|  5.68k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 5.67k, False: 14]
  |  Branch (4865:36): [True: 5.66k, False: 10]
  ------------------
 4866|  5.66k|                     ++it;
 4867|  5.66k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  5.66k|                     continue;
 4869|  5.66k|                  }
 4870|     24|                  ctx.error = error_code::syntax_error;
 4871|     24|                  return;
 4872|  5.68k|               }
 4873|  23.6k|               else {
 4874|  23.6k|                  ctx.error = error_code::syntax_error;
 4875|  23.6k|                  return;
 4876|  23.6k|               }
 4877|   328k|            }
 4878|   145k|         }
 4879|   933k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   933k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   933k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   933k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   933k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   933k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   933k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   933k|                           if (ctx.stream_begin) {
 4893|   933k|                              auto is_line_content_start = [&](auto pos) {
 4894|   933k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   933k|                              };
 4896|       |
 4897|   933k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   933k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   933k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   933k|                                 return line != end && *line == ':';
 4901|   933k|                              };
 4902|       |
 4903|   933k|                              if (!is_line_content_start(it) &&
 4904|   933k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   933k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   933k|                                 ctx.error = error_code::syntax_error;
 4907|   933k|                                 return false;
 4908|   933k|                              }
 4909|   933k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   933k|                           }
 4911|   933k|                        }
 4912|       |
 4913|   933k|                        if (*it == '-' &&
 4914|   933k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   933k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   933k|                           ctx.error = error_code::syntax_error;
 4918|   933k|                           return false;
 4919|   933k|                        }
 4920|       |
 4921|   933k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   933k|                           return false;
 4923|   933k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   933k|                        ctx.pop_indent();
 4925|   933k|                     }
 4926|   933k|                     else {
 4927|   933k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   933k|                        if (nested_indent >= 0) {
 4929|   933k|                           yaml::skip_to_content(it, end);
 4930|   933k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   933k|                              ctx.error = error_code::syntax_error;
 4932|   933k|                              return false;
 4933|   933k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   933k|                           const int32_t value_indent =
 4937|   933k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   933k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   933k|                              return false;
 4940|   933k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   933k|                           ctx.pop_indent();
 4942|   933k|                        }
 4943|   933k|                     }
 4944|   933k|                     return !bool(ctx.error);
 4945|   933k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   933k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   933k|                     ctx.error = error_code::syntax_error;
 4952|   933k|                     return false;
 4953|   933k|                  }
 4954|   933k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   933k|                     ++it; // skip '?'
 4956|   933k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   933k|                     const int32_t explicit_value_indicator_indent =
 4959|   933k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   933k|                     key_t key{};
 4962|   933k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   933k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   933k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   933k|                        };
 4966|       |
 4967|   933k|                        auto key_it = it;
 4968|   933k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   933k|                        auto content = key_it;
 4971|   933k|                        yaml::skip_to_content(content, end);
 4972|   933k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   933k|                        if (content != end && *content == '&') {
 4978|   933k|                           auto anchor_probe = content + 1;
 4979|   933k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   933k|                           if (!anchor_name.empty()) {
 4981|   933k|                              auto after_anchor = anchor_probe;
 4982|   933k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   933k|                              auto value_indicator = after_anchor;
 4985|   933k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   933k|                                 key.clear();
 4987|   933k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   933k|                                 it = value_indicator;
 4989|   933k|                                 handled_anchor_only_empty_key = true;
 4990|   933k|                              }
 4991|   933k|                              else {
 4992|   933k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   933k|                                    yaml::skip_comment(value_indicator, end);
 4994|   933k|                                 }
 4995|   933k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   933k|                                    yaml::skip_newline(value_indicator, end);
 4997|   933k|                                    auto value_line = value_indicator;
 4998|   933k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   933k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   933k|                                       return false;
 5001|   933k|                                    if (value_line != end && *value_line == ':' &&
 5002|   933k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   933k|                                       key.clear();
 5004|   933k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   933k|                                       it = value_line;
 5006|   933k|                                       handled_anchor_only_empty_key = true;
 5007|   933k|                                    }
 5008|   933k|                                    else if (value_line != end && *value_line == ':') {
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|   933k|                                       ctx.error = error_code::syntax_error;
 5013|   933k|                                       return false;
 5014|   933k|                                    }
 5015|   933k|                                 }
 5016|   933k|                              }
 5017|   933k|                           }
 5018|   933k|                        }
 5019|       |
 5020|   933k|                        const bool key_content_spans_lines = [&] {
 5021|   933k|                           auto scan = key_it;
 5022|   933k|                           while (scan != content && scan != end) {
 5023|   933k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   933k|                              ++scan;
 5025|   933k|                           }
 5026|   933k|                           return false;
 5027|   933k|                        }();
 5028|       |
 5029|   933k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   933k|                        }
 5032|   933k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   933k|                           key.clear();
 5034|   933k|                           it = content;
 5035|   933k|                        }
 5036|   933k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   933k|                           auto key_node_it = content;
 5042|   933k|                           auto key_node_end = end;
 5043|   933k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   933k|                              auto scan = content;
 5048|   933k|                              while (scan != end) {
 5049|   933k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   933k|                                    ++scan;
 5051|   933k|                                 }
 5052|   933k|                                 if (scan == end) {
 5053|   933k|                                    break;
 5054|   933k|                                 }
 5055|       |
 5056|   933k|                                 yaml::skip_newline(scan, end);
 5057|   933k|                                 auto line_start = scan;
 5058|       |
 5059|   933k|                                 int32_t indicator_indent = 0;
 5060|   933k|                                 while (scan != end && *scan == ' ') {
 5061|   933k|                                    ++indicator_indent;
 5062|   933k|                                    ++scan;
 5063|   933k|                                 }
 5064|       |
 5065|   933k|                                 if (scan != end && *scan == ':') {
 5066|   933k|                                    const auto after_colon = scan + 1;
 5067|   933k|                                    if ((after_colon == end ||
 5068|   933k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   933k|                                        indicator_indent <= line_indent) {
 5070|   933k|                                       key_node_end = line_start;
 5071|   933k|                                       break;
 5072|   933k|                                    }
 5073|   933k|                                 }
 5074|   933k|                              }
 5075|   933k|                           }
 5076|       |
 5077|   933k|                           glz::generic key_node{};
 5078|   933k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   933k|                           ctx.explicit_mapping_key_context = true;
 5080|   933k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   933k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   933k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   933k|                              return false;
 5084|   933k|                           it = key_node_it;
 5085|   933k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   933k|                              return false;
 5087|   933k|                        }
 5088|   933k|                     }
 5089|   933k|                     else {
 5090|   933k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   933k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   933k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   933k|                              return false;
 5094|   933k|                        }
 5095|   933k|                     }
 5096|       |
 5097|   933k|                     yaml::skip_inline_ws(it, end);
 5098|   933k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   933k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   933k|                        auto probe = it;
 5103|   933k|                        bool found_value_indicator = false;
 5104|       |
 5105|   933k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   933k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   933k|                           auto value_line = probe;
 5109|   933k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   933k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   933k|                              return false;
 5112|       |
 5113|   933k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   933k|                              probe = value_line;
 5115|   933k|                              continue; // blank line
 5116|   933k|                           }
 5117|   933k|                           if (*value_line == '#') {
 5118|   933k|                              yaml::skip_comment(value_line, end);
 5119|   933k|                              probe = value_line;
 5120|   933k|                              continue; // comment-only line
 5121|   933k|                           }
 5122|   933k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   933k|                              it = value_line;
 5124|   933k|                              found_value_indicator = true;
 5125|   933k|                           }
 5126|   933k|                           break;
 5127|   933k|                        }
 5128|       |
 5129|   933k|                        if (found_value_indicator) {
 5130|   933k|                           yaml::skip_inline_ws(it, end);
 5131|   933k|                        }
 5132|   933k|                     }
 5133|       |
 5134|   933k|                     val_t val{};
 5135|   933k|                     if (it != end && *it == ':') {
 5136|   933k|                        ++it;
 5137|   933k|                        if (it != end && *it == '\t') {
 5138|   933k|                           ctx.error = error_code::syntax_error;
 5139|   933k|                           return false;
 5140|   933k|                        }
 5141|   933k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   933k|                           auto probe = it;
 5143|   933k|                           yaml::skip_newline(probe, end);
 5144|   933k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   933k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   933k|                              ctx.error = error_code::syntax_error;
 5147|   933k|                              return false;
 5148|   933k|                           }
 5149|   933k|                        }
 5150|   933k|                        yaml::skip_inline_ws(it, end);
 5151|   933k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   933k|                           return false;
 5153|   933k|                     }
 5154|       |
 5155|   933k|                     value.emplace(std::move(key), std::move(val));
 5156|   933k|                     return true;
 5157|   933k|                  }
 5158|       |
 5159|   933k|                  key_t key{};
 5160|   933k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   933k|                     auto key_probe = it;
 5162|   933k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   933k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   933k|                     if (complex_flow_key) {
 5165|   933k|                        glz::generic key_node{};
 5166|   933k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   933k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   933k|                           return false;
 5169|   933k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   933k|                           return false;
 5171|   933k|                     }
 5172|   933k|                     else {
 5173|   933k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   933k|                           return false;
 5175|   933k|                        }
 5176|   933k|                     }
 5177|   933k|                  }
 5178|   933k|                  else {
 5179|   933k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   933k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   933k|                        return false;
 5182|   933k|                  }
 5183|       |
 5184|   933k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   933k|                  if (it == end || *it != ':') {
 5187|   933k|                     ctx.error = error_code::syntax_error;
 5188|   933k|                     return false;
 5189|   933k|                  }
 5190|   933k|                  ++it;
 5191|   933k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   933k|                  val_t val{};
 5194|   933k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   933k|                     return false;
 5196|       |
 5197|   933k|                  value.emplace(std::move(key), std::move(val));
 5198|   933k|                  return true;
 5199|   933k|               });
 5200|   933k|         }
 5201|       |
 5202|  1.05M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|  1.05M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.09M|      {
  466|  1.09M|         skip_inline_ws(it, end);
  467|       |
  468|  1.09M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 1.09M]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  1.09M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.09M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 1.09M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  1.09M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.09M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.09M|         skip_inline_ws(it, end);
  486|       |
  487|  1.09M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.09M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.09M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 8.54k, False: 1.08M]
  ------------------
  495|  8.54k|            return true;
  496|  8.54k|         }
  497|       |
  498|  1.08M|         return false;
  499|  1.09M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|  1.09M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.09M|      {
  409|  1.09M|         state.has_anchor = false;
  410|  1.09M|         state.anchor_name.clear();
  411|  1.09M|         state.anchor_start = nullptr;
  412|  1.09M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.09M|         if constexpr (Policy.allow_alias) {
  415|  1.09M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  1.09M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 1.08M, False: 12.0k]
  ------------------
  417|  1.08M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 8.50k, False: 1.07M]
  ------------------
  418|  1.08M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  1.09M|         }
  424|       |
  425|  1.09M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.08M, False: 8.50k]
  |  Branch (425:27): [True: 36.2k, False: 1.05M]
  ------------------
  426|  36.2k|            ++it;
  427|  36.2k|            auto name = parse_anchor_name(it, end);
  428|  36.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 22, False: 36.2k]
  ------------------
  429|     22|               ctx.error = error_code::syntax_error;
  430|     22|               return true;
  431|     22|            }
  432|  36.2k|            skip_inline_ws(it, end);
  433|  36.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 36.2k]
  ------------------
  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|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  36.2k|            state.has_anchor = true;
  446|  36.2k|            state.anchor_name = std::string(name);
  447|  36.2k|            state.anchor_start = &*it;
  448|  36.2k|         }
  449|       |
  450|  1.09M|         return false;
  451|  1.09M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_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: 1.07M, False: 8.50k]
  ------------------
  302|       |
  303|  8.50k|         ++it; // skip '*'
  304|  8.50k|         auto name = parse_anchor_name(it, end);
  305|  8.50k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 24, False: 8.48k]
  ------------------
  306|     24|            ctx.error = error_code::syntax_error;
  307|     24|            return true;
  308|     24|         }
  309|       |
  310|  8.48k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.48k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 42, False: 8.43k]
  ------------------
  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|  8.43k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.43k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 302, False: 8.13k]
  ------------------
  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.13k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 62, False: 8.07k]
  ------------------
  329|     62|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     62|            return true;
  331|     62|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  8.07k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.07k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 10, False: 8.06k]
  ------------------
  339|     10|            return true;
  340|       |
  341|  8.06k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 8.06k]
  ------------------
  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|  8.06k|         auto replay_it = span.begin;
  348|  8.06k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.06k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.06k|         ctx.indent_stack.clear();
  353|  8.06k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.07k, False: 4.98k]
  ------------------
  354|  3.07k|            ctx.push_indent(span.base_indent - 1);
  355|  3.07k|         }
  356|       |
  357|  8.06k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.06k|         using V = std::remove_cvref_t<T>;
  360|  8.06k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.06k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.06k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.06k|         return true;
  367|  8.06k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|   268k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|       |                     val = {};
 4766|       |                     return true;
 4767|       |                  }
 4768|   268k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   268k|                     val = glz::generic{};
 4770|   268k|                     return true;
 4771|       |                  }
 4772|       |                  else {
 4773|       |                     static constexpr std::string_view null_value{"null"};
 4774|       |                     auto null_it = null_value.data();
 4775|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|       |                     return !bool(ctx.error);
 4778|       |                  }
 4779|   268k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   933k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   933k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 933k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   933k|         const int32_t parent_indent = ctx.current_indent();
 3722|   933k|         const bool discover_indent = (mapping_indent < 0);
 3723|   933k|         bool first_key = !discover_indent;
 3724|   933k|         bool discovered_first_key_mid_line = false;
 3725|   933k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.17M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.62M, False: 550k]
  ------------------
 3728|  1.62M|            auto line_start = it;
 3729|  1.62M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.62M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.10M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 2.05M, False: 55.2k]
  ------------------
 3733|  2.05M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 79.4k, False: 1.97M]
  ------------------
 3734|  79.4k|                  skip_comment(it, end);
 3735|  79.4k|                  skip_newline(it, end);
 3736|  79.4k|                  first_key = false;
 3737|  79.4k|                  line_indent = 0;
 3738|  79.4k|               }
 3739|  1.97M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 242k, False: 1.72M]
  |  Branch (3739:40): [True: 83.6k, False: 1.64M]
  ------------------
 3740|   325k|                  skip_newline(it, end);
 3741|   325k|                  first_key = false;
 3742|   325k|                  line_indent = 0;
 3743|   325k|               }
 3744|  1.64M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 182k, False: 1.46M]
  ------------------
 3745|   182k|                  line_start = it;
 3746|   182k|                  line_indent = 0;
 3747|   782k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 767k, False: 14.2k]
  |  Branch (3747:39): [True: 599k, False: 168k]
  ------------------
 3748|   599k|                     ++line_indent;
 3749|   599k|                     ++it;
 3750|   599k|                  }
 3751|       |
 3752|   182k|                  bool saw_tab = false;
 3753|   198k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 178k, False: 19.9k]
  |  Branch (3753:40): [True: 3.90k, False: 174k]
  |  Branch (3753:54): [True: 11.8k, False: 162k]
  ------------------
 3754|  15.7k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 6.14k, False: 9.60k]
  |  Branch (3754:43): [True: 9.60k, False: 0]
  ------------------
 3755|  15.7k|                     ++it;
 3756|  15.7k|                  }
 3757|       |
 3758|   182k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 19.9k, False: 162k]
  |  Branch (3758:36): [True: 12.3k, False: 150k]
  |  Branch (3758:51): [True: 6.81k, False: 143k]
  |  Branch (3758:66): [True: 18.9k, False: 124k]
  ------------------
 3759|  58.0k|                     first_key = false;
 3760|  58.0k|                     line_indent = 0;
 3761|  58.0k|                     continue; // Blank or comment line
 3762|  58.0k|                  }
 3763|       |
 3764|   124k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 12, False: 124k]
  ------------------
 3765|     12|                     ctx.error = error_code::syntax_error;
 3766|     12|                     return;
 3767|     12|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   124k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 117k, False: 7.12k]
  |  Branch (3770:46): [True: 750, False: 116k]
  ------------------
 3771|    750|                     it = line_start;
 3772|    750|                     return;
 3773|    750|                  }
 3774|       |
 3775|   123k|                  first_key = false;
 3776|   123k|                  break; // Found content
 3777|   124k|               }
 3778|  1.46M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 15.1k, False: 1.44M]
  ------------------
 3779|  15.1k|                  line_start = it;
 3780|  72.0k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 63.2k, False: 8.85k]
  |  Branch (3780:40): [True: 23.3k, False: 39.8k]
  |  Branch (3780:54): [True: 33.5k, False: 6.32k]
  ------------------
 3781|  15.1k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 8.85k, False: 6.32k]
  |  Branch (3781:36): [True: 4.05k, False: 2.27k]
  |  Branch (3781:51): [True: 1.21k, False: 1.06k]
  |  Branch (3781:66): [True: 1.04k, False: 18]
  ------------------
 3782|  15.1k|                     first_key = false;
 3783|  15.1k|                     line_indent = 0;
 3784|  15.1k|                     continue; // Blank or comment-only line with tab indentation
 3785|  15.1k|                  }
 3786|     18|                  ctx.error = error_code::syntax_error;
 3787|     18|                  return;
 3788|  15.1k|               }
 3789|  1.44M|               else {
 3790|  1.44M|                  line_start = it;
 3791|  1.44M|                  break; // Content at column 0
 3792|  1.44M|               }
 3793|  2.05M|            }
 3794|       |
 3795|  1.62M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 55.2k, False: 1.57M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.57M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 5.25k, False: 1.56M]
  |  Branch (3799:45): [True: 1.46k, False: 1.56M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.56M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.56M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.56M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.56M, False: 0]
  |  Branch (3806:39): [True: 633k, False: 931k]
  |  Branch (3806:62): [True: 171k, False: 462k]
  |  Branch (3806:84): [True: 132k, False: 39.4k]
  ------------------
 3807|   132k|                  it = line_start;
 3808|   132k|                  return;
 3809|   132k|               }
 3810|  1.43M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 501k, False: 931k]
  |  Branch (3810:43): [True: 740, False: 500k]
  ------------------
 3811|    740|                  it = line_start;
 3812|    740|                  return;
 3813|    740|               }
 3814|  1.43M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.43M|            bool established_mapping_indent_this_line = false;
 3818|  1.43M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 931k, False: 500k]
  ------------------
 3819|   931k|               mapping_indent = line_indent;
 3820|   931k|               established_mapping_indent_this_line = true;
 3821|   931k|               discovered_first_key_visual_indent = line_indent;
 3822|   931k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   931k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 931k, False: 0]
  |  Branch (3823:43): [True: 931k, False: 0]
  ------------------
 3824|   931k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   931k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 66, False: 930k]
  ------------------
 3826|     66|                        ctx.error = error_code::syntax_error;
 3827|     66|                        return;
 3828|     66|                     }
 3829|       |
 3830|   930k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   930k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 923k, False: 7.12k]
  |  Branch (3831:49): [True: 693k, False: 230k]
  ------------------
 3832|   693k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   693k|                     }
 3834|   930k|                  }
 3835|   931k|               }
 3836|   931k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.43M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.43M, False: 66]
  |  Branch (3840:36): [True: 1.43M, False: 0]
  |  Branch (3840:59): [True: 500k, False: 930k]
  ------------------
 3841|   500k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 177k, False: 323k]
  ------------------
 3842|   177k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 176k, False: 578]
  |  Branch (3842:43): [True: 20.2k, False: 156k]
  ------------------
 3843|  20.2k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 54, False: 20.1k]
  ------------------
 3844|     54|                     ctx.error = error_code::syntax_error;
 3845|     54|                     return;
 3846|     54|                  }
 3847|  20.1k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 7.25k, False: 12.9k]
  ------------------
 3848|  7.25k|                     it = line_start;
 3849|  7.25k|                     return;
 3850|  7.25k|                  }
 3851|  20.1k|               }
 3852|   157k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 3.92k, False: 153k]
  ------------------
 3853|  3.92k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 56, False: 3.86k]
  |  Branch (3853:47): [True: 6, False: 3.85k]
  ------------------
 3854|  3.85k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 3.85k, False: 0]
  |  Branch (3854:49): [True: 3.85k, False: 0]
  |  Branch (3854:72): [True: 18, False: 3.84k]
  ------------------
 3855|     80|                  ctx.error = error_code::syntax_error;
 3856|     80|                  return;
 3857|     80|               }
 3858|   177k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.42M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.42M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.42M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.42M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.42M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 66, False: 1.42M]
  |  Branch (3876:32): [True: 0, False: 1.42M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.42M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 454k, False: 969k]
  |  Branch (3885:53): [True: 108k, False: 346k]
  |  Branch (3885:94): [True: 17.3k, False: 91.1k]
  ------------------
 3886|  17.3k|               const auto after_colon = it + 1;
 3887|  17.3k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 9.17k, False: 8.22k]
  ------------------
 3888|  17.3k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 3.56k, False: 13.8k]
  |  Branch (3888:43): [True: 8.91k, False: 4.92k]
  ------------------
 3889|  12.4k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 4.46k, False: 8.01k]
  ------------------
 3890|  4.46k|                  it = line_start;
 3891|  4.46k|                  return;
 3892|  4.46k|               }
 3893|  17.3k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.41M|            int32_t effective_line_indent = line_indent;
 3897|  1.41M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.41M, False: 66]
  |  Branch (3897:36): [True: 930k, False: 488k]
  ------------------
 3898|   930k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 693k, False: 237k]
  ------------------
 3899|   693k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 607k, False: 85.5k]
  |  Branch (3899:52): [True: 349k, False: 258k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   344k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   344k|            }
 3912|       |
 3913|  1.41M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 175k, False: 1.24M]
  ------------------
 3914|   175k|               return;
 3915|   175k|            }
 3916|  1.24M|            first_key = false;
 3917|       |
 3918|  1.24M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.24M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|       |               auto flow_end = it;
 3925|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|       |               if (bool(ctx.error)) [[unlikely]]
 3927|       |                  return;
 3928|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3929|       |                  it = flow_end;
 3930|       |                  return;
 3931|       |               }
 3932|       |            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.24M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 787k, False: 456k]
  ------------------
 3938|   787k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 87.5k, False: 700k]
  |  Branch (3938:34): [True: 13.6k, False: 686k]
  ------------------
 3939|   101k|                  auto peek = it;
 3940|   101k|                  skip_inline_ws(peek, end);
 3941|   101k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 80.4k, False: 20.7k]
  |  Branch (3941:38): [True: 67.6k, False: 12.8k]
  |  Branch (3941:55): [True: 62.5k, False: 5.10k]
  |  Branch (3941:72): [True: 57.4k, False: 5.04k]
  ------------------
 3942|  57.4k|                     continue; // At leading indent of new line
 3943|  57.4k|                  }
 3944|   101k|               }
 3945|   730k|               skip_inline_ws(it, end);
 3946|   730k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 709k, False: 20.7k]
  |  Branch (3946:33): [True: 30.3k, False: 679k]
  ------------------
 3947|  30.3k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  30.3k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 30.3k, False: 0]
  ------------------
 3949|  30.3k|                        const char prev = *(it - 1);
 3950|  30.3k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 15.3k, False: 15.0k]
  |  Branch (3950:44): [True: 12.2k, False: 3.08k]
  |  Branch (3950:60): [True: 7.63k, False: 4.59k]
  |  Branch (3950:76): [True: 6, False: 7.62k]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  30.3k|                     }
 3955|  30.3k|                  }
 3956|  30.3k|               }
 3957|  30.3k|               skip_comment(it, end);
 3958|   730k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 708k, False: 21.8k]
  |  Branch (3958:34): [True: 212k, False: 495k]
  |  Branch (3958:49): [True: 233k, False: 262k]
  ------------------
 3959|   445k|                  skip_newline(it, end);
 3960|   445k|               }
 3961|   284k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 262k, False: 21.8k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   262k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   262k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 36, False: 262k]
  ------------------
 3968|     36|                        ctx.error = error_code::syntax_error;
 3969|     36|                        return;
 3970|     36|                     }
 3971|   262k|                  }
 3972|   262k|               }
 3973|   730k|            }
 3974|  1.24M|         }
 3975|   933k|      }
_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:
 4882|  1.41M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.41M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.41M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.41M|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|  1.41M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.41M|                           if (ctx.stream_begin) {
 4893|  1.41M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.41M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.41M|                              };
 4896|       |
 4897|  1.41M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.41M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.41M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.41M|                                 return line != end && *line == ':';
 4901|  1.41M|                              };
 4902|       |
 4903|  1.41M|                              if (!is_line_content_start(it) &&
 4904|  1.41M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.41M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.41M|                                 ctx.error = error_code::syntax_error;
 4907|  1.41M|                                 return false;
 4908|  1.41M|                              }
 4909|  1.41M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.41M|                           }
 4911|  1.41M|                        }
 4912|       |
 4913|  1.41M|                        if (*it == '-' &&
 4914|  1.41M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.41M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.41M|                           ctx.error = error_code::syntax_error;
 4918|  1.41M|                           return false;
 4919|  1.41M|                        }
 4920|       |
 4921|  1.41M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.41M|                           return false;
 4923|  1.41M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.41M|                        ctx.pop_indent();
 4925|  1.41M|                     }
 4926|  1.41M|                     else {
 4927|  1.41M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.41M|                        if (nested_indent >= 0) {
 4929|  1.41M|                           yaml::skip_to_content(it, end);
 4930|  1.41M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.41M|                              ctx.error = error_code::syntax_error;
 4932|  1.41M|                              return false;
 4933|  1.41M|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  1.41M|                           const int32_t value_indent =
 4937|  1.41M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.41M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.41M|                              return false;
 4940|  1.41M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.41M|                           ctx.pop_indent();
 4942|  1.41M|                        }
 4943|  1.41M|                     }
 4944|  1.41M|                     return !bool(ctx.error);
 4945|  1.41M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.41M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 650k, False: 769k]
  |  Branch (4950:37): [True: 649k, False: 1.23k]
  |  Branch (4950:58): [True: 8, False: 649k]
  ------------------
 4951|      8|                     ctx.error = error_code::syntax_error;
 4952|      8|                     return false;
 4953|      8|                  }
 4954|  1.41M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 650k, False: 769k]
  |  Branch (4954:38): [True: 1.23k, False: 649k]
  |  Branch (4954:57): [True: 244k, False: 404k]
  |  Branch (4954:77): [True: 274k, False: 129k]
  |  Branch (4954:98): [True: 104k, False: 25.1k]
  ------------------
 4955|   625k|                     ++it; // skip '?'
 4956|   625k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   625k|                     const int32_t explicit_value_indicator_indent =
 4959|   625k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 432k, False: 193k]
  ------------------
 4960|       |
 4961|   625k|                     key_t key{};
 4962|   625k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   625k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   625k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   625k|                        };
 4966|       |
 4967|   625k|                        auto key_it = it;
 4968|   625k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   625k|                        auto content = key_it;
 4971|   625k|                        yaml::skip_to_content(content, end);
 4972|   625k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   625k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 617k, False: 7.32k]
  |  Branch (4977:47): [True: 167k, False: 450k]
  ------------------
 4978|   167k|                           auto anchor_probe = content + 1;
 4979|   167k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   167k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 167k, False: 14]
  ------------------
 4981|   167k|                              auto after_anchor = anchor_probe;
 4982|   167k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   167k|                              auto value_indicator = after_anchor;
 4985|   167k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 161k, False: 5.54k]
  |  Branch (4985:61): [True: 13.7k, False: 147k]
  ------------------
 4986|  13.7k|                                 key.clear();
 4987|  13.7k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  13.7k|                                 it = value_indicator;
 4989|  13.7k|                                 handled_anchor_only_empty_key = true;
 4990|  13.7k|                              }
 4991|   153k|                              else {
 4992|   153k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 147k, False: 5.54k]
  |  Branch (4992:64): [True: 9.90k, False: 138k]
  ------------------
 4993|  9.90k|                                    yaml::skip_comment(value_indicator, end);
 4994|  9.90k|                                 }
 4995|   153k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 147k, False: 5.82k]
  |  Branch (4995:65): [True: 24.7k, False: 122k]
  |  Branch (4995:93): [True: 51.5k, False: 71.4k]
  ------------------
 4996|  76.2k|                                    yaml::skip_newline(value_indicator, end);
 4997|  76.2k|                                    auto value_line = value_indicator;
 4998|  76.2k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  76.2k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 6, False: 76.2k]
  ------------------
 5000|      6|                                       return false;
 5001|  76.2k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 71.5k, False: 4.70k]
  |  Branch (5001:62): [True: 4.63k, False: 66.9k]
  ------------------
 5002|  4.63k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 4.62k, False: 10]
  ------------------
 5003|  4.62k|                                       key.clear();
 5004|  4.62k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  4.62k|                                       it = value_line;
 5006|  4.62k|                                       handled_anchor_only_empty_key = true;
 5007|  4.62k|                                    }
 5008|  71.6k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 66.9k, False: 4.70k]
  |  Branch (5008:67): [True: 10, False: 66.9k]
  ------------------
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|     10|                                       ctx.error = error_code::syntax_error;
 5013|     10|                                       return false;
 5014|     10|                                    }
 5015|  76.2k|                                 }
 5016|   153k|                              }
 5017|   167k|                           }
 5018|   167k|                        }
 5019|       |
 5020|   625k|                        const bool key_content_spans_lines = [&] {
 5021|   625k|                           auto scan = key_it;
 5022|   625k|                           while (scan != content && scan != end) {
 5023|   625k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   625k|                              ++scan;
 5025|   625k|                           }
 5026|   625k|                           return false;
 5027|   625k|                        }();
 5028|       |
 5029|   625k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 18.3k, False: 606k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  18.3k|                        }
 5032|   606k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 7.32k, False: 599k]
  |  Branch (5032:53): [True: 17.4k, False: 582k]
  |  Branch (5032:72): [True: 8.29k, False: 9.15k]
  ------------------
 5033|  15.6k|                           key.clear();
 5034|  15.6k|                           it = content;
 5035|  15.6k|                        }
 5036|   591k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   591k|                           auto key_node_it = content;
 5042|   591k|                           auto key_node_end = end;
 5043|   591k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   591k|                              auto scan = content;
 5048|  5.82M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 5.62M, False: 197k]
  ------------------
 5049|   682M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 682M, False: 302k]
  |  Branch (5049:56): [True: 679M, False: 2.56M]
  |  Branch (5049:73): [True: 677M, False: 2.76M]
  ------------------
 5050|   677M|                                    ++scan;
 5051|   677M|                                 }
 5052|  5.62M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 302k, False: 5.32M]
  ------------------
 5053|   302k|                                    break;
 5054|   302k|                                 }
 5055|       |
 5056|  5.32M|                                 yaml::skip_newline(scan, end);
 5057|  5.32M|                                 auto line_start = scan;
 5058|       |
 5059|  5.32M|                                 int32_t indicator_indent = 0;
 5060|  8.54M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 8.34M, False: 197k]
  |  Branch (5060:56): [True: 3.21M, False: 5.12M]
  ------------------
 5061|  3.21M|                                    ++indicator_indent;
 5062|  3.21M|                                    ++scan;
 5063|  3.21M|                                 }
 5064|       |
 5065|  5.32M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 5.12M, False: 197k]
  |  Branch (5065:53): [True: 200k, False: 4.92M]
  ------------------
 5066|   200k|                                    const auto after_colon = scan + 1;
 5067|   200k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 6.92k, False: 193k]
  ------------------
 5068|   193k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 118k, False: 75.1k]
  ------------------
 5069|   125k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 91.8k, False: 33.7k]
  ------------------
 5070|  91.8k|                                       key_node_end = line_start;
 5071|  91.8k|                                       break;
 5072|  91.8k|                                    }
 5073|   200k|                                 }
 5074|  5.32M|                              }
 5075|   591k|                           }
 5076|       |
 5077|   591k|                           glz::generic key_node{};
 5078|   591k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   591k|                           ctx.explicit_mapping_key_context = true;
 5080|   591k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   591k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   591k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 22.4k, False: 568k]
  ------------------
 5083|  22.4k|                              return false;
 5084|   568k|                           it = key_node_it;
 5085|   568k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 12, False: 568k]
  ------------------
 5086|     12|                              return false;
 5087|   568k|                        }
 5088|       |                     }
 5089|       |                     else {
 5090|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|       |                           if (bool(ctx.error)) [[unlikely]]
 5093|       |                              return false;
 5094|       |                        }
 5095|       |                     }
 5096|       |
 5097|   602k|                     yaml::skip_inline_ws(it, end);
 5098|   625k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   625k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 420k, False: 204k]
  |  Branch (5101:40): [True: 122k, False: 298k]
  |  Branch (5101:55): [True: 134k, False: 163k]
  ------------------
 5102|   256k|                        auto probe = it;
 5103|   256k|                        bool found_value_indicator = false;
 5104|       |
 5105|   373k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 322k, False: 50.9k]
  |  Branch (5105:49): [True: 150k, False: 172k]
  |  Branch (5105:67): [True: 172k, False: 0]
  ------------------
 5106|   322k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   322k|                           auto value_line = probe;
 5109|   322k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   322k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 6, False: 322k]
  ------------------
 5111|      6|                              return false;
 5112|       |
 5113|   322k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 49.3k, False: 273k]
  |  Branch (5113:53): [True: 15.7k, False: 257k]
  |  Branch (5113:76): [True: 27.4k, False: 230k]
  ------------------
 5114|  92.6k|                              probe = value_line;
 5115|  92.6k|                              continue; // blank line
 5116|  92.6k|                           }
 5117|   230k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 24.1k, False: 205k]
  ------------------
 5118|  24.1k|                              yaml::skip_comment(value_line, end);
 5119|  24.1k|                              probe = value_line;
 5120|  24.1k|                              continue; // comment-only line
 5121|  24.1k|                           }
 5122|   205k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 31.6k, False: 174k]
  |  Branch (5122:54): [True: 22.2k, False: 9.39k]
  ------------------
 5123|  22.2k|                              it = value_line;
 5124|  22.2k|                              found_value_indicator = true;
 5125|  22.2k|                           }
 5126|   205k|                           break;
 5127|   230k|                        }
 5128|       |
 5129|   256k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 22.2k, False: 234k]
  ------------------
 5130|  22.2k|                           yaml::skip_inline_ws(it, end);
 5131|  22.2k|                        }
 5132|   256k|                     }
 5133|       |
 5134|   625k|                     val_t val{};
 5135|   625k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 420k, False: 204k]
  |  Branch (5135:39): [True: 137k, False: 283k]
  ------------------
 5136|   137k|                        ++it;
 5137|   137k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 136k, False: 830]
  |  Branch (5137:42): [True: 12, False: 136k]
  ------------------
 5138|     12|                           ctx.error = error_code::syntax_error;
 5139|     12|                           return false;
 5140|     12|                        }
 5141|   137k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 136k, False: 830]
  |  Branch (5141:43): [True: 16.7k, False: 119k]
  |  Branch (5141:58): [True: 51.5k, False: 68.2k]
  ------------------
 5142|  68.2k|                           auto probe = it;
 5143|  68.2k|                           yaml::skip_newline(probe, end);
 5144|   345k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 333k, False: 11.2k]
  |  Branch (5144:51): [True: 276k, False: 57.0k]
  ------------------
 5145|  68.2k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 57.0k, False: 11.2k]
  |  Branch (5145:48): [True: 15.0k, False: 42.0k]
  |  Branch (5145:65): [True: 10.8k, False: 4.15k]
  |  Branch (5145:89): [True: 6, False: 10.8k]
  ------------------
 5146|      6|                              ctx.error = error_code::syntax_error;
 5147|      6|                              return false;
 5148|      6|                           }
 5149|  68.2k|                        }
 5150|   137k|                        yaml::skip_inline_ws(it, end);
 5151|   137k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 2.48k, False: 134k]
  ------------------
 5152|  2.48k|                           return false;
 5153|   137k|                     }
 5154|       |
 5155|   622k|                     value.emplace(std::move(key), std::move(val));
 5156|   622k|                     return true;
 5157|   625k|                  }
 5158|       |
 5159|   794k|                  key_t key{};
 5160|   794k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   794k|                     auto key_probe = it;
 5162|   794k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   794k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 794k, False: 0]
  |  Branch (5163:74): [True: 6.48k, False: 788k]
  |  Branch (5163:95): [True: 8.65k, False: 779k]
  ------------------
 5164|   794k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 15.1k, False: 779k]
  ------------------
 5165|  15.1k|                        glz::generic key_node{};
 5166|  15.1k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  15.1k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 1.05k, False: 14.0k]
  ------------------
 5168|  1.05k|                           return false;
 5169|  14.0k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 6, False: 14.0k]
  ------------------
 5170|      6|                           return false;
 5171|  14.0k|                     }
 5172|   779k|                     else {
 5173|   779k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 139k, False: 640k]
  ------------------
 5174|   139k|                           return false;
 5175|   139k|                        }
 5176|   779k|                     }
 5177|       |                  }
 5178|       |                  else {
 5179|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|       |                     if (bool(ctx.error)) [[unlikely]]
 5181|       |                        return false;
 5182|       |                  }
 5183|       |
 5184|   654k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   794k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 140k, False: 654k]
  |  Branch (5186:36): [True: 30, False: 654k]
  ------------------
 5187|    132|                     ctx.error = error_code::syntax_error;
 5188|    132|                     return false;
 5189|    132|                  }
 5190|   794k|                  ++it;
 5191|   794k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   794k|                  val_t val{};
 5194|   794k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 10.1k, False: 784k]
  ------------------
 5195|  10.1k|                     return false;
 5196|       |
 5197|   784k|                  value.emplace(std::move(key), std::move(val));
 5198|   784k|                  return true;
 5199|   794k|               });
_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:
 5020|   625k|                        const bool key_content_spans_lines = [&] {
 5021|   625k|                           auto scan = key_it;
 5022|   656k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 425k, False: 230k]
  |  Branch (5022:54): [True: 425k, False: 0]
  ------------------
 5023|   425k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 278k, False: 146k]
  |  Branch (5023:52): [True: 115k, False: 31.0k]
  ------------------
 5024|  31.0k|                              ++scan;
 5025|  31.0k|                           }
 5026|   230k|                           return false;
 5027|   625k|                        }();
_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_:
 4963|   568k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   568k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   568k|                        };
_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_:
 4883|   791k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   791k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 737k, False: 54.6k]
  |  Branch (4884:39): [True: 430k, False: 306k]
  ------------------
 4885|   430k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   430k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   430k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 430k, False: 0]
  ------------------
 4893|   430k|                              auto is_line_content_start = [&](auto pos) {
 4894|   430k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   430k|                              };
 4896|       |
 4897|   430k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   430k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   430k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   430k|                                 return line != end && *line == ':';
 4901|   430k|                              };
 4902|       |
 4903|   430k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 430k, False: 0]
  ------------------
 4904|   430k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 19.8k, False: 410k]
  ------------------
 4905|  19.8k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 30, False: 19.8k]
  ------------------
 4906|     30|                                 ctx.error = error_code::syntax_error;
 4907|     30|                                 return false;
 4908|     30|                              }
 4909|   430k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   430k|                           }
 4911|   430k|                        }
 4912|       |
 4913|   430k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 16.8k, False: 413k]
  ------------------
 4914|  16.8k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 604, False: 16.2k]
  |  Branch (4914:49): [True: 2.28k, False: 13.9k]
  ------------------
 4915|  2.88k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 12, False: 2.87k]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     12|                           ctx.error = error_code::syntax_error;
 4918|     12|                           return false;
 4919|     12|                        }
 4920|       |
 4921|   430k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 430k]
  ------------------
 4922|      0|                           return false;
 4923|   430k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   430k|                        ctx.pop_indent();
 4925|   430k|                     }
 4926|   361k|                     else {
 4927|   361k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   361k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 76.8k, False: 284k]
  ------------------
 4929|  76.8k|                           yaml::skip_to_content(it, end);
 4930|  76.8k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 76.8k, False: 0]
  |  Branch (4930:45): [True: 0, False: 76.8k]
  |  Branch (4930:59): [True: 0, False: 0]
  |  Branch (4930:78): [True: 0, False: 0]
  ------------------
 4931|      0|                              ctx.error = error_code::syntax_error;
 4932|      0|                              return false;
 4933|      0|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  76.8k|                           const int32_t value_indent =
 4937|  76.8k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 76.8k]
  ------------------
 4938|  76.8k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 76.8k]
  ------------------
 4939|      0|                              return false;
 4940|  76.8k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  76.8k|                           ctx.pop_indent();
 4942|  76.8k|                        }
 4943|   361k|                     }
 4944|   791k|                     return !bool(ctx.error);
 4945|   791k|                  };
_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_:
 4893|   430k|                              auto is_line_content_start = [&](auto pos) {
 4894|   430k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   430k|                              };
_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_:
 4897|   450k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   450k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   940k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 940k, False: 0]
  |  Branch (4899:57): [True: 488k, False: 451k]
  |  Branch (4899:73): [True: 1.18k, False: 450k]
  ------------------
 4900|   450k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 450k, False: 0]
  |  Branch (4900:56): [True: 172k, False: 277k]
  ------------------
 4901|   450k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|  1.08M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  1.08M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 1.08M]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|  1.08M|            }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE10redispatchITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 6717|   475k|      {
 6718|   475k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|   475k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 428, False: 474k]
  ------------------
 6720|    428|            return;
 6721|   474k|         op<Opts>(value, ctx, it, end);
 6722|   474k|      }
_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|  34.4k|      {
  301|  34.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 34.4k]
  |  Branch (301:27): [True: 0, False: 34.4k]
  ------------------
  302|       |
  303|  34.4k|         ++it; // skip '*'
  304|  34.4k|         auto name = parse_anchor_name(it, end);
  305|  34.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 36, False: 34.4k]
  ------------------
  306|     36|            ctx.error = error_code::syntax_error;
  307|     36|            return true;
  308|     36|         }
  309|       |
  310|  34.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  34.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 60, False: 34.3k]
  ------------------
  312|     60|            ctx.error = error_code::syntax_error; // undefined alias
  313|     60|            return true;
  314|     60|         }
  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|  34.3k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  34.3k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 606, False: 33.7k]
  ------------------
  322|    606|            return true;
  323|    606|         }
  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|  33.7k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 800, False: 32.9k]
  ------------------
  329|    800|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    800|            return true;
  331|    800|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  32.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  32.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 32.9k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  32.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 4, False: 32.9k]
  ------------------
  342|      4|            ctx.error = error_code::exceeded_max_expansion;
  343|      4|            ctx.custom_error_message = "alias expansion";
  344|      4|            return true;
  345|      4|         }
  346|       |
  347|  32.9k|         auto replay_it = span.begin;
  348|  32.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  32.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  32.9k|         ctx.indent_stack.clear();
  353|  32.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 20.3k, False: 12.5k]
  ------------------
  354|  20.3k|            ctx.push_indent(span.base_indent - 1);
  355|  20.3k|         }
  356|       |
  357|  32.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  32.9k|         using V = std::remove_cvref_t<T>;
  360|  32.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  32.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  32.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  32.9k|         return true;
  367|  32.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_strEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   490k|      {
 5311|   490k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   490k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   490k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   490k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   490k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 490k, False: 0]
  ------------------
 5321|   490k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   490k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   500k|      {
 1961|   500k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 15.0k, False: 485k]
  ------------------
 1962|  15.0k|            return;
 1963|       |
 1964|   485k|         yaml::node_preamble_state preamble{};
 1965|   485k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 10.8k, False: 474k]
  ------------------
 1966|   485k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  10.8k|            return;
 1968|       |
 1969|   474k|         std::string str;
 1970|   474k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   474k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 474k, False: 0]
  ------------------
 1973|  13.9k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 13.9k, False: 460k]
  ------------------
 1974|  13.9k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  13.9k|            break;
 1976|  2.57k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 2.57k, False: 472k]
  ------------------
 1977|  2.57k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  2.57k|            break;
 1979|  4.81k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 4.81k, False: 470k]
  ------------------
 1980|  23.1k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 18.3k, False: 456k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  23.1k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  23.1k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 8.17k, False: 15.0k]
  ------------------
 1986|  23.1k|            break;
 1987|   435k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 435k, False: 39.7k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   435k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   435k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 254k, False: 180k]
  ------------------
 1992|   254k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|   254k|               }
 1994|   180k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|   180k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|   180k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   435k|            break;
 2003|   474k|         }
 2004|       |
 2005|   474k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 474k, False: 178]
  ------------------
 2006|   474k|            value = std::move(str);
 2007|   474k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   474k|         }
 2009|   474k|      }
_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|   485k|      {
  466|   485k|         skip_inline_ws(it, end);
  467|       |
  468|   485k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 16, False: 485k]
  ------------------
  469|     16|            if constexpr (!AllowEmptyInput) {
  470|     16|               ctx.error = error_code::unexpected_end;
  471|     16|            }
  472|     16|            return true;
  473|     16|         }
  474|       |
  475|   485k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   485k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 485k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   485k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 485k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   485k|         skip_inline_ws(it, end);
  486|       |
  487|   485k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 485k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   485k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 10.8k, False: 474k]
  ------------------
  495|  10.8k|            return true;
  496|  10.8k|         }
  497|       |
  498|   474k|         return false;
  499|   485k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   485k|                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|   485k|      {
  409|   485k|         state.has_anchor = false;
  410|   485k|         state.anchor_name.clear();
  411|   485k|         state.anchor_start = nullptr;
  412|   485k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   485k|         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|   485k|            else {
  421|   485k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.7k, False: 474k]
  ------------------
  422|   485k|            }
  423|   485k|         }
  424|       |
  425|   485k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 474k, False: 10.7k]
  |  Branch (425:27): [True: 14.0k, False: 460k]
  ------------------
  426|  14.0k|            ++it;
  427|  14.0k|            auto name = parse_anchor_name(it, end);
  428|  14.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 28, False: 13.9k]
  ------------------
  429|     28|               ctx.error = error_code::syntax_error;
  430|     28|               return true;
  431|     28|            }
  432|  13.9k|            skip_inline_ws(it, end);
  433|  13.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 26, False: 13.9k]
  ------------------
  434|     26|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     26|                  ctx.error = error_code::unexpected_end;
  436|     26|               }
  437|     26|               return true;
  438|     26|            }
  439|  13.9k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  13.9k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 13.9k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  13.9k|            }
  445|  13.9k|            state.has_anchor = true;
  446|  13.9k|            state.anchor_name = std::string(name);
  447|  13.9k|            state.anchor_start = &*it;
  448|  13.9k|         }
  449|       |
  450|   485k|         return false;
  451|   485k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   485k|      {
  301|   485k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 485k]
  |  Branch (301:27): [True: 474k, False: 10.7k]
  ------------------
  302|       |
  303|  10.7k|         ++it; // skip '*'
  304|  10.7k|         auto name = parse_anchor_name(it, end);
  305|  10.7k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 10.7k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  10.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 58, False: 10.7k]
  ------------------
  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|  10.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  10.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 722, False: 10.0k]
  ------------------
  322|    722|            return true;
  323|    722|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  10.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 9.99k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  9.99k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.99k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 9.98k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  9.98k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 8, False: 9.98k]
  ------------------
  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|  9.98k|         auto replay_it = span.begin;
  348|  9.98k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.98k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.98k|         ctx.indent_stack.clear();
  353|  9.98k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.18k, False: 7.80k]
  ------------------
  354|  2.18k|            ctx.push_indent(span.base_indent - 1);
  355|  2.18k|         }
  356|       |
  357|  9.98k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.98k|         using V = std::remove_cvref_t<T>;
  360|  9.98k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.98k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.98k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.98k|         return true;
  367|  9.98k|      }
_ZN3glz4yaml28parse_plain_scalar_multilineINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1178|   883k|      {
 1179|   883k|         value.clear();
 1180|       |
 1181|  4.48M|         while (it != end) {
  ------------------
  |  Branch (1181:17): [True: 4.46M, False: 12.0k]
  ------------------
 1182|  4.46M|            {
 1183|  4.46M|               const auto run_start = it;
 1184|   150M|               while (it != end && !plain_scalar_block_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1184:23): [True: 150M, False: 118k]
  |  Branch (1184:36): [True: 145M, False: 4.34M]
  ------------------
 1185|   145M|                  ++it;
 1186|   145M|               }
 1187|  4.46M|               if (it != run_start) {
  ------------------
  |  Branch (1187:20): [True: 4.06M, False: 404k]
  ------------------
 1188|  4.06M|                  value.append(run_start, it);
 1189|  4.06M|               }
 1190|  4.46M|               if (it == end) break;
  ------------------
  |  Branch (1190:20): [True: 118k, False: 4.34M]
  ------------------
 1191|  4.46M|            }
 1192|       |
 1193|  4.34M|            const char c = *it;
 1194|       |
 1195|  4.34M|            if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1195:17): [True: 12.6k, False: 4.33M]
  ------------------
 1196|  12.6k|               ctx.error = error_code::invalid_control_character;
 1197|  12.6k|               return;
 1198|  12.6k|            }
 1199|       |
 1200|       |            // Check for newline - potential continuation
 1201|  4.33M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1201:17): [True: 367k, False: 3.96M]
  |  Branch (1201:30): [True: 520k, False: 3.44M]
  ------------------
 1202|       |               // Trim trailing whitespace from current line
 1203|  1.34M|               while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1203:23): [True: 1.12M, False: 221k]
  |  Branch (1203:42): [True: 384k, False: 736k]
  |  Branch (1203:65): [True: 70.6k, False: 666k]
  ------------------
 1204|   454k|                  value.pop_back();
 1205|   454k|               }
 1206|       |
 1207|       |               // Count consecutive blank lines
 1208|   888k|               int blank_lines = 0;
 1209|   888k|               auto lookahead = it;
 1210|       |
 1211|  2.13M|               while (lookahead != end) {
  ------------------
  |  Branch (1211:23): [True: 2.04M, False: 89.0k]
  ------------------
 1212|       |                  // Skip the newline
 1213|  2.04M|                  if (*lookahead == '\r' && (lookahead + 1) != end && *(lookahead + 1) == '\n') {
  ------------------
  |  Branch (1213:23): [True: 1.22M, False: 819k]
  |  Branch (1213:45): [True: 1.18M, False: 41.0k]
  |  Branch (1213:71): [True: 44.9k, False: 1.13M]
  ------------------
 1214|  44.9k|                     ++lookahead;
 1215|  44.9k|                  }
 1216|  2.04M|                  if (lookahead != end && (*lookahead == '\n' || *lookahead == '\r')) {
  ------------------
  |  Branch (1216:23): [True: 2.04M, False: 0]
  |  Branch (1216:44): [True: 864k, False: 1.17M]
  |  Branch (1216:66): [True: 1.17M, False: 0]
  ------------------
 1217|  2.04M|                     ++lookahead;
 1218|  2.04M|                  }
 1219|      0|                  else {
 1220|      0|                     break;
 1221|      0|                  }
 1222|       |
 1223|       |                  // Check if this is a blank line or comment-only line
 1224|  2.04M|                  int32_t line_indent = 0;
 1225|       |
 1226|  3.69M|                  while (lookahead != end && (*lookahead == ' ' || *lookahead == '\t')) {
  ------------------
  |  Branch (1226:26): [True: 3.60M, False: 89.0k]
  |  Branch (1226:47): [True: 1.61M, False: 1.98M]
  |  Branch (1226:68): [True: 35.2k, False: 1.95M]
  ------------------
 1227|  1.65M|                     ++line_indent;
 1228|  1.65M|                     ++lookahead;
 1229|  1.65M|                  }
 1230|       |
 1231|  2.04M|                  if (lookahead == end || *lookahead == '\n' || *lookahead == '\r') {
  ------------------
  |  Branch (1231:23): [True: 89.0k, False: 1.95M]
  |  Branch (1231:43): [True: 452k, False: 1.50M]
  |  Branch (1231:65): [True: 703k, False: 799k]
  ------------------
 1232|       |                     // Blank line
 1233|  1.24M|                     ++blank_lines;
 1234|  1.24M|                     continue;
 1235|  1.24M|                  }
 1236|       |
 1237|   799k|                  if (*lookahead == '#') {
  ------------------
  |  Branch (1237:23): [True: 50.6k, False: 748k]
  ------------------
 1238|       |                     // Comments end plain scalars per YAML spec
 1239|  50.6k|                     return;
 1240|  50.6k|                  }
 1241|       |
 1242|       |                  // Found content - check indentation
 1243|       |                  // Continuation lines must not dedent below the parent block.
 1244|   748k|                  if (line_indent < base_indent) {
  ------------------
  |  Branch (1244:23): [True: 145k, False: 603k]
  ------------------
 1245|       |                     // Dedented - end of scalar
 1246|   145k|                     return;
 1247|   145k|                  }
 1248|       |
 1249|       |                  // Document boundary markers at column 0 start/stop documents and
 1250|       |                  // must terminate a top-level plain scalar continuation.
 1251|   603k|                  if (line_indent == 0 && (at_document_start(lookahead, end) || at_document_end(lookahead, end))) {
  ------------------
  |  Branch (1251:23): [True: 474k, False: 128k]
  |  Branch (1251:44): [True: 3.57k, False: 471k]
  |  Branch (1251:81): [True: 1.45k, False: 469k]
  ------------------
 1252|  5.02k|                     return;
 1253|  5.02k|                  }
 1254|       |
 1255|       |                  // Sequence indicator (- followed by space/newline/end).
 1256|       |                  // Terminates the scalar when the dash is at or above the
 1257|       |                  // enclosing sequence's indicator column, meaning it starts
 1258|       |                  // a sibling entry.  A dash deeper than the indicator is
 1259|       |                  // plain content (yaml-test-suite AB8U).
 1260|   597k|                  if (*lookahead == '-') {
  ------------------
  |  Branch (1260:23): [True: 232k, False: 365k]
  ------------------
 1261|   232k|                     auto after_dash = lookahead + 1;
 1262|   232k|                     if (after_dash == end || *after_dash == ' ' || *after_dash == '\t' || *after_dash == '\n' ||
  ------------------
  |  Branch (1262:26): [True: 266, False: 232k]
  |  Branch (1262:47): [True: 12.1k, False: 220k]
  |  Branch (1262:69): [True: 6.41k, False: 213k]
  |  Branch (1262:92): [True: 199k, False: 14.4k]
  ------------------
 1263|   220k|                         *after_dash == '\r') {
  ------------------
  |  Branch (1263:26): [True: 2.52k, False: 11.9k]
  ------------------
 1264|   220k|                        if (ctx.sequence_dash_indent < 0 || line_indent <= ctx.sequence_dash_indent) {
  ------------------
  |  Branch (1264:29): [True: 2.86k, False: 217k]
  |  Branch (1264:61): [True: 210k, False: 7.32k]
  ------------------
 1265|   213k|                           return;
 1266|   213k|                        }
 1267|   220k|                     }
 1268|   232k|                  }
 1269|       |
 1270|   384k|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1270:23): [True: 227k, False: 157k]
  ------------------
 1271|       |                     // In explicit mapping keys ("? key"), a following explicit
 1272|       |                     // key/value indicator starts a new mapping entry.
 1273|   227k|                     if (*lookahead == '?' || *lookahead == ':') {
  ------------------
  |  Branch (1273:26): [True: 67.3k, False: 159k]
  |  Branch (1273:47): [True: 15.6k, False: 144k]
  ------------------
 1274|  82.9k|                        auto after = lookahead + 1;
 1275|  82.9k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1275:29): [True: 630, False: 82.3k]
  |  Branch (1275:45): [True: 15.1k, False: 67.1k]
  |  Branch (1275:62): [True: 236, False: 66.9k]
  |  Branch (1275:80): [True: 15.7k, False: 51.1k]
  |  Branch (1275:98): [True: 27.9k, False: 23.1k]
  ------------------
 1276|  59.7k|                           return;
 1277|  59.7k|                        }
 1278|  82.9k|                     }
 1279|       |
 1280|       |                     // Node-property indicators at the start of a continuation
 1281|       |                     // line begin a new key node in explicit-key context.
 1282|   167k|                     if (*lookahead == '&' || *lookahead == '*' || *lookahead == '!') {
  ------------------
  |  Branch (1282:26): [True: 988, False: 166k]
  |  Branch (1282:47): [True: 59.4k, False: 106k]
  |  Branch (1282:68): [True: 2.00k, False: 104k]
  ------------------
 1283|  62.4k|                        return;
 1284|  62.4k|                     }
 1285|   167k|                  }
 1286|       |
 1287|       |                  // In a "- item" value context, an anchor/tag/alias at the start
 1288|       |                  // of a continuation candidate starts a new node, not scalar content.
 1289|   262k|                  if (ctx.sequence_item_value_context &&
  ------------------
  |  Branch (1289:23): [True: 79.0k, False: 183k]
  ------------------
 1290|  79.0k|                      (*lookahead == '&' || *lookahead == '*' || *lookahead == '!')) {
  ------------------
  |  Branch (1290:24): [True: 1.45k, False: 77.5k]
  |  Branch (1290:45): [True: 1.03k, False: 76.5k]
  |  Branch (1290:66): [True: 352, False: 76.2k]
  ------------------
 1291|  2.83k|                     return;
 1292|  2.83k|                  }
 1293|       |
 1294|       |                  // Check for mapping key indicator (content followed by : and space)
 1295|       |                  // This is a heuristic - we look for ": " pattern which indicates a mapping key
 1296|   259k|                  {
 1297|   259k|                     auto scan = lookahead;
 1298|  9.91M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1298:29): [True: 9.89M, False: 18.7k]
  |  Branch (1298:44): [True: 9.75M, False: 137k]
  |  Branch (1298:61): [True: 9.69M, False: 54.0k]
  ------------------
 1299|  9.69M|                        if (*scan == ':') {
  ------------------
  |  Branch (1299:29): [True: 106k, False: 9.59M]
  ------------------
 1300|   106k|                           auto after_colon = scan + 1;
 1301|   106k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1301:32): [True: 996, False: 105k]
  |  Branch (1301:54): [True: 29.2k, False: 76.0k]
  |  Branch (1301:77): [True: 494, False: 75.5k]
  ------------------
 1302|  75.5k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (1302:32): [True: 9.33k, False: 66.2k]
  |  Branch (1302:56): [True: 9.33k, False: 56.8k]
  ------------------
 1303|       |                              // This looks like a mapping key - end the scalar
 1304|  49.4k|                              return;
 1305|  49.4k|                           }
 1306|   106k|                        }
 1307|  9.65M|                        ++scan;
 1308|  9.65M|                     }
 1309|   259k|                  }
 1310|       |
 1311|       |                  // This is a continuation line
 1312|       |                  // Add appropriate line breaks for blank lines
 1313|  1.11M|                  for (int i = 0; i < blank_lines; ++i) {
  ------------------
  |  Branch (1313:35): [True: 900k, False: 210k]
  ------------------
 1314|   900k|                     value.push_back('\n');
 1315|   900k|                  }
 1316|       |
 1317|       |                  // Add a space to fold the newline (unless we added literal newlines for blank lines)
 1318|   210k|                  if (blank_lines == 0 && !value.empty()) {
  ------------------
  |  Branch (1318:23): [True: 178k, False: 31.7k]
  |  Branch (1318:43): [True: 126k, False: 52.4k]
  ------------------
 1319|   126k|                     value.push_back(' ');
 1320|   126k|                  }
 1321|       |
 1322|       |                  // Move iterator to the content position
 1323|   210k|                  it = lookahead;
 1324|   210k|                  break;
 1325|   259k|               }
 1326|       |
 1327|       |               // If we exhausted the lookahead, we're done
 1328|   299k|               if (lookahead == end) {
  ------------------
  |  Branch (1328:20): [True: 89.0k, False: 210k]
  ------------------
 1329|  89.0k|                  return;
 1330|  89.0k|               }
 1331|       |
 1332|   210k|               continue; // Process the character at the new position
 1333|   299k|            }
 1334|       |
 1335|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1336|  3.44M|            if (c == '#') {
  ------------------
  |  Branch (1336:17): [True: 238k, False: 3.21M]
  ------------------
 1337|   238k|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1337:20): [True: 27.8k, False: 210k]
  |  Branch (1337:37): [True: 23.0k, False: 187k]
  |  Branch (1337:60): [True: 3.57k, False: 183k]
  ------------------
 1338|  54.4k|                  break; // This is a comment
 1339|  54.4k|               }
 1340|   238k|            }
 1341|       |
 1342|       |            // Colon followed by space/newline ends plain scalar (potential nested mapping)
 1343|  3.39M|            if (c == ':') {
  ------------------
  |  Branch (1343:17): [True: 3.21M, False: 183k]
  ------------------
 1344|  3.21M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1344:20): [True: 1.95k, False: 3.20M]
  |  Branch (1344:39): [True: 4.19k, False: 3.20M]
  |  Branch (1344:59): [True: 208, False: 3.20M]
  |  Branch (1344:80): [True: 1.68k, False: 3.20M]
  |  Branch (1344:101): [True: 390, False: 3.20M]
  ------------------
 1345|  8.43k|                  break;
 1346|  8.43k|               }
 1347|  3.21M|            }
 1348|       |
 1349|  3.38M|            value.push_back(c);
 1350|  3.38M|            ++it;
 1351|  3.38M|         }
 1352|       |
 1353|       |         // Trim trailing whitespace
 1354|   515k|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1354:17): [True: 486k, False: 28.9k]
  |  Branch (1354:36): [True: 294k, False: 191k]
  |  Branch (1354:59): [True: 27.1k, False: 164k]
  ------------------
 1355|   321k|            value.pop_back();
 1356|   321k|         }
 1357|   193k|      }
_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_:
 5310|   148k|      {
 5311|   148k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   148k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   148k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   148k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   148k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 148k, False: 0]
  ------------------
 5321|   148k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   148k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   150k|      {
 2116|   150k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 150k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   150k|         yaml::node_preamble_state preamble{};
 2120|   150k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 10.8k, False: 139k]
  ------------------
 2121|   150k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   150k|                   return yaml::tag_valid_for_float(tag);
 2123|   150k|                }
 2124|   150k|                else {
 2125|   150k|                   return yaml::tag_valid_for_int(tag);
 2126|   150k|                }
 2127|   150k|             }))
 2128|  10.8k|            return;
 2129|       |
 2130|   139k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   139k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   139k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   139k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 45.5k, False: 93.7k]
  ------------------
 2138|  45.5k|               ++it;
 2139|  45.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 36.1k, False: 9.39k]
  |  Branch (2139:38): [True: 2.00k, False: 34.1k]
  |  Branch (2139:74): [True: 626, False: 33.5k]
  ------------------
 2140|  33.5k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 578, False: 32.9k]
  ------------------
 2141|  3.21k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  3.21k|                  it += 3;
 2143|  3.21k|                  finalize();
 2144|  3.21k|                  return;
 2145|  3.21k|               }
 2146|  42.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 32.9k, False: 9.39k]
  |  Branch (2146:38): [True: 2.25k, False: 30.7k]
  |  Branch (2146:74): [True: 992, False: 29.7k]
  ------------------
 2147|  29.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 2.28k, False: 27.4k]
  ------------------
 2148|  5.53k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  5.53k|                  it += 3;
 2150|  5.53k|                  finalize();
 2151|  5.53k|                  return;
 2152|  5.53k|               }
 2153|  36.8k|               it = start;
 2154|  36.8k|            }
 2155|       |
 2156|   130k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 9.12k, False: 121k]
  |  Branch (2156:31): [True: 20.4k, False: 100k]
  ------------------
 2157|  29.5k|               const char sign = *it;
 2158|  29.5k|               ++it;
 2159|  29.5k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 26.1k, False: 3.43k]
  |  Branch (2159:33): [True: 9.87k, False: 16.2k]
  ------------------
 2160|  9.87k|                  ++it;
 2161|  9.87k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 8.83k, False: 1.03k]
  |  Branch (2161:41): [True: 2.85k, False: 5.98k]
  |  Branch (2161:77): [True: 2.03k, False: 3.94k]
  ------------------
 2162|  6.88k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 1.99k, False: 1.95k]
  ------------------
 2163|  6.88k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 4.31k, False: 2.57k]
  ------------------
 2164|  4.31k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  4.31k|                     }
 2166|  2.57k|                     else {
 2167|  2.57k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  2.57k|                     }
 2169|  6.88k|                     it += 3;
 2170|  6.88k|                     finalize();
 2171|  6.88k|                     return;
 2172|  6.88k|                  }
 2173|  9.87k|               }
 2174|  22.6k|               it = start;
 2175|  22.6k|            }
 2176|   130k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   123k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  60.0M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 59.9M, False: 36.6k]
  ------------------
 2183|  59.9M|            const char c = *it;
 2184|  59.9M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 34.2k, False: 59.9M]
  |  Branch (2184:29): [True: 4.66k, False: 59.9M]
  |  Branch (2184:42): [True: 8.21k, False: 59.9M]
  |  Branch (2184:55): [True: 32.1k, False: 59.9M]
  |  Branch (2184:68): [True: 2.48k, False: 59.9M]
  |  Branch (2184:80): [True: 786, False: 59.9M]
  |  Branch (2184:92): [True: 1.12k, False: 59.9M]
  |  Branch (2184:104): [True: 11.6k, False: 59.8M]
  ------------------
 2185|  95.2k|               break;
 2186|  95.2k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  59.8M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 26.9k, False: 59.8M]
  ------------------
 2189|  26.9k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 996, False: 25.9k]
  |  Branch (2189:39): [True: 2.40k, False: 23.5k]
  |  Branch (2189:59): [True: 238, False: 23.3k]
  |  Branch (2189:80): [True: 988, False: 22.3k]
  |  Branch (2189:101): [True: 2.71k, False: 19.6k]
  ------------------
 2190|  7.33k|                  break;
 2191|  7.33k|               }
 2192|  26.9k|            }
 2193|  59.8M|            ++it;
 2194|  59.8M|         }
 2195|       |
 2196|   139k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   139k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 3.50k, False: 135k]
  ------------------
 2199|  3.50k|            ctx.error = error_code::parse_number_failure;
 2200|  3.50k|            return;
 2201|  3.50k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|   135k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   135k|            bool negative = false;
 2254|   135k|            std::string_view digits = num_str;
 2255|       |
 2256|   135k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 120k, False: 15.6k]
  |  Branch (2256:37): [True: 17.8k, False: 102k]
  |  Branch (2256:62): [True: 4.81k, False: 97.4k]
  ------------------
 2257|  22.6k|               negative = (digits.front() == '-');
 2258|  22.6k|               digits.remove_prefix(1);
 2259|  22.6k|            }
 2260|       |
 2261|   135k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 62.7k, False: 73.0k]
  |  Branch (2261:38): [True: 21.7k, False: 40.9k]
  ------------------
 2262|  21.7k|               int base = 10;
 2263|  21.7k|               size_t offset = 0;
 2264|       |
 2265|  21.7k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 7.76k, False: 14.0k]
  |  Branch (2265:40): [True: 922, False: 13.0k]
  ------------------
 2266|  8.68k|                  base = 16;
 2267|  8.68k|                  offset = 2;
 2268|  8.68k|               }
 2269|  13.0k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 316, False: 12.7k]
  |  Branch (2269:45): [True: 1.04k, False: 11.7k]
  ------------------
 2270|  1.36k|                  base = 8;
 2271|  1.36k|                  offset = 2;
 2272|  1.36k|               }
 2273|  11.7k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 574, False: 11.1k]
  |  Branch (2273:45): [True: 2.89k, False: 8.25k]
  ------------------
 2274|  3.47k|                  base = 2;
 2275|  3.47k|                  offset = 2;
 2276|  3.47k|               }
 2277|       |
 2278|  21.7k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 13.5k, False: 8.25k]
  ------------------
 2279|  13.5k|                  auto raw_digits = digits.substr(offset);
 2280|  13.5k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  13.5k|                  std::string clean_storage;
 2283|  13.5k|                  std::string_view clean_view;
 2284|  13.5k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 4.67k, False: 8.83k]
  ------------------
 2285|  4.67k|                     clean_storage.reserve(raw_digits.size());
 2286|  34.5M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 34.5M, False: 4.67k]
  ------------------
 2287|  34.5M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 34.5M, False: 6.09k]
  ------------------
 2288|  34.5M|                           clean_storage.push_back(c);
 2289|  34.5M|                        }
 2290|  34.5M|                     }
 2291|  4.67k|                     clean_view = clean_storage;
 2292|  4.67k|                  }
 2293|  8.83k|                  else {
 2294|  8.83k|                     clean_view = raw_digits;
 2295|  8.83k|                  }
 2296|       |
 2297|  13.5k|                  uint64_t parsed_int{};
 2298|  13.5k|                  auto [ptr, ec] =
 2299|  13.5k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  13.5k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 6.55k, False: 6.95k]
  |  Branch (2300:44): [True: 2.67k, False: 4.28k]
  ------------------
 2301|  9.23k|                     ctx.error = error_code::parse_number_failure;
 2302|  9.23k|                     finalize();
 2303|  9.23k|                     return;
 2304|  9.23k|                  }
 2305|       |
 2306|  4.28k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  4.28k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 1.61k, False: 2.67k]
  ------------------
 2308|  4.28k|                  finalize();
 2309|  4.28k|                  return;
 2310|  13.5k|               }
 2311|  21.7k|            }
 2312|   135k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|   122k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|   135k|         std::string clean_storage;
 2318|   135k|         std::string_view clean_view;
 2319|       |
 2320|   135k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 4.22k, False: 131k]
  ------------------
 2321|  4.22k|            clean_storage.reserve(num_str.size());
 2322|  1.51M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 1.51M, False: 4.22k]
  ------------------
 2323|  1.51M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 1.49M, False: 14.6k]
  ------------------
 2324|  1.49M|                  clean_storage.push_back(c);
 2325|  1.49M|               }
 2326|  1.51M|            }
 2327|  4.22k|            clean_view = clean_storage;
 2328|  4.22k|         }
 2329|   131k|         else {
 2330|   131k|            clean_view = num_str;
 2331|   131k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   135k|         auto parse_view = clean_view;
 2336|   135k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 106k, False: 29.4k]
  |  Branch (2336:37): [True: 17.8k, False: 88.4k]
  ------------------
 2337|  17.8k|            parse_view.remove_prefix(1);
 2338|  17.8k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 4.68k, False: 13.1k]
  ------------------
 2339|  4.68k|               ctx.error = error_code::parse_number_failure;
 2340|  4.68k|               return;
 2341|  4.68k|            }
 2342|  17.8k|         }
 2343|       |
 2344|   131k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   131k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|   131k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 76.7k, False: 54.3k]
  |  Branch (2347:45): [True: 35.0k, False: 19.2k]
  ------------------
 2348|  82.6k|               ctx.error = error_code::parse_number_failure;
 2349|  82.6k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|   131k|         finalize();
 2360|   131k|      }
_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|   150k|      {
  466|   150k|         skip_inline_ws(it, end);
  467|       |
  468|   150k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 2.39k, False: 147k]
  ------------------
  469|  2.39k|            if constexpr (!AllowEmptyInput) {
  470|  2.39k|               ctx.error = error_code::unexpected_end;
  471|  2.39k|            }
  472|  2.39k|            return true;
  473|  2.39k|         }
  474|       |
  475|   147k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   147k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 886, False: 146k]
  ------------------
  477|    886|            ctx.error = error_code::syntax_error;
  478|    886|            return true;
  479|    886|         }
  480|   146k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 336, False: 146k]
  ------------------
  481|    336|            ctx.error = error_code::syntax_error;
  482|    336|            return true;
  483|    336|         }
  484|       |
  485|   146k|         skip_inline_ws(it, end);
  486|       |
  487|   146k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 596, False: 145k]
  ------------------
  488|    596|            if constexpr (!AllowEmptyInput) {
  489|    596|               ctx.error = error_code::unexpected_end;
  490|    596|            }
  491|    596|            return true;
  492|    596|         }
  493|       |
  494|   145k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 6.67k, False: 139k]
  ------------------
  495|  6.67k|            return true;
  496|  6.67k|         }
  497|       |
  498|   139k|         return false;
  499|   145k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   146k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   146k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   146k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   146k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   145k|      {
  409|   145k|         state.has_anchor = false;
  410|   145k|         state.anchor_name.clear();
  411|   145k|         state.anchor_start = nullptr;
  412|   145k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   145k|         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|   145k|            else {
  421|   145k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.59k, False: 140k]
  ------------------
  422|   145k|            }
  423|   145k|         }
  424|       |
  425|   145k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 140k, False: 5.59k]
  |  Branch (425:27): [True: 11.2k, False: 129k]
  ------------------
  426|  11.2k|            ++it;
  427|  11.2k|            auto name = parse_anchor_name(it, end);
  428|  11.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 358, False: 10.8k]
  ------------------
  429|    358|               ctx.error = error_code::syntax_error;
  430|    358|               return true;
  431|    358|            }
  432|  10.8k|            skip_inline_ws(it, end);
  433|  10.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 720, False: 10.1k]
  ------------------
  434|    720|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    720|                  ctx.error = error_code::unexpected_end;
  436|    720|               }
  437|    720|               return true;
  438|    720|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  10.1k|            state.has_anchor = true;
  446|  10.1k|            state.anchor_name = std::string(name);
  447|  10.1k|            state.anchor_start = &*it;
  448|  10.1k|         }
  449|       |
  450|   144k|         return false;
  451|   145k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   145k|      {
  301|   145k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 145k]
  |  Branch (301:27): [True: 140k, False: 5.59k]
  ------------------
  302|       |
  303|  5.59k|         ++it; // skip '*'
  304|  5.59k|         auto name = parse_anchor_name(it, end);
  305|  5.59k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 972, False: 4.62k]
  ------------------
  306|    972|            ctx.error = error_code::syntax_error;
  307|    972|            return true;
  308|    972|         }
  309|       |
  310|  4.62k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.62k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.55k, False: 3.06k]
  ------------------
  312|  1.55k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.55k|            return true;
  314|  1.55k|         }
  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.06k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.06k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.49k, False: 1.57k]
  ------------------
  322|  1.49k|            return true;
  323|  1.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|  1.57k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 70, False: 1.50k]
  ------------------
  329|     70|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     70|            return true;
  331|     70|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  1.50k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.50k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 1.50k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  1.50k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.50k]
  ------------------
  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.50k|         auto replay_it = span.begin;
  348|  1.50k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.50k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.50k|         ctx.indent_stack.clear();
  353|  1.50k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 564, False: 936]
  ------------------
  354|    564|            ctx.push_indent(span.base_indent - 1);
  355|    564|         }
  356|       |
  357|  1.50k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.50k|         using V = std::remove_cvref_t<T>;
  360|  1.50k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.50k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.50k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.50k|         return true;
  367|  1.50k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   131k|         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_:
 5310|  56.3k|      {
 5311|  56.3k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  56.3k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  56.3k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  56.3k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  56.3k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 56.3k, False: 0]
  ------------------
 5321|  56.3k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  56.3k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  59.7k|      {
 2081|  59.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 59.7k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  59.7k|         yaml::node_preamble_state preamble{};
 2085|  59.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 5.76k, False: 54.0k]
  ------------------
 2086|  59.7k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  5.76k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  54.0k|         std::string str;
 2091|  54.0k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  54.0k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 3.94k, False: 50.0k]
  |  Branch (2093:31): [True: 7.68k, False: 42.3k]
  |  Branch (2093:48): [True: 2.15k, False: 40.2k]
  |  Branch (2093:65): [True: 720, False: 39.5k]
  |  Branch (2093:81): [True: 876, False: 38.6k]
  |  Branch (2093:97): [True: 1.40k, False: 37.2k]
  ------------------
 2094|  37.2k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 606, False: 36.6k]
  |  Branch (2094:29): [True: 364, False: 36.2k]
  |  Branch (2094:44): [True: 648, False: 35.6k]
  ------------------
 2095|  18.3k|            value = true;
 2096|  18.3k|         }
 2097|  35.6k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 4.43k, False: 31.1k]
  |  Branch (2097:37): [True: 4.50k, False: 26.6k]
  |  Branch (2097:55): [True: 2.39k, False: 24.2k]
  |  Branch (2097:73): [True: 4.55k, False: 19.7k]
  |  Branch (2097:88): [True: 15.4k, False: 4.29k]
  |  Branch (2097:103): [True: 210, False: 4.08k]
  ------------------
 2098|  35.4k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 1.11k, False: 2.97k]
  |  Branch (2098:35): [True: 1.93k, False: 1.03k]
  |  Branch (2098:51): [True: 870, False: 168]
  ------------------
 2099|  35.4k|            value = false;
 2100|  35.4k|         }
 2101|    168|         else {
 2102|    168|            ctx.error = error_code::expected_true_or_false;
 2103|    168|         }
 2104|       |
 2105|  54.0k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  54.0k|      }
_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|  59.7k|      {
  466|  59.7k|         skip_inline_ws(it, end);
  467|       |
  468|  59.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 20, False: 59.7k]
  ------------------
  469|     20|            if constexpr (!AllowEmptyInput) {
  470|     20|               ctx.error = error_code::unexpected_end;
  471|     20|            }
  472|     20|            return true;
  473|     20|         }
  474|       |
  475|  59.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  59.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 59.7k]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|  59.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 59.7k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  59.7k|         skip_inline_ws(it, end);
  486|       |
  487|  59.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 59.7k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  59.7k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.72k, False: 54.0k]
  ------------------
  495|  5.72k|            return true;
  496|  5.72k|         }
  497|       |
  498|  54.0k|         return false;
  499|  59.7k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  59.7k|                                             [](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|  59.7k|      {
  409|  59.7k|         state.has_anchor = false;
  410|  59.7k|         state.anchor_name.clear();
  411|  59.7k|         state.anchor_start = nullptr;
  412|  59.7k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  59.7k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  59.7k|            else {
  421|  59.7k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.69k, False: 54.0k]
  ------------------
  422|  59.7k|            }
  423|  59.7k|         }
  424|       |
  425|  59.7k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 54.0k, False: 5.69k]
  |  Branch (425:27): [True: 4.29k, False: 49.7k]
  ------------------
  426|  4.29k|            ++it;
  427|  4.29k|            auto name = parse_anchor_name(it, end);
  428|  4.29k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 4.27k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  4.27k|            skip_inline_ws(it, end);
  433|  4.27k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 4.25k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  4.25k|            state.has_anchor = true;
  446|  4.25k|            state.anchor_name = std::string(name);
  447|  4.25k|            state.anchor_start = &*it;
  448|  4.25k|         }
  449|       |
  450|  59.7k|         return false;
  451|  59.7k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  59.7k|      {
  301|  59.7k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 59.7k]
  |  Branch (301:27): [True: 54.0k, False: 5.69k]
  ------------------
  302|       |
  303|  5.69k|         ++it; // skip '*'
  304|  5.69k|         auto name = parse_anchor_name(it, end);
  305|  5.69k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 5.66k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  5.66k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.66k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 5.62k]
  ------------------
  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|  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: 2.14k, False: 3.48k]
  ------------------
  322|  2.14k|            return true;
  323|  2.14k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  3.48k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 3.46k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  3.46k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.46k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 3.46k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  3.46k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.46k]
  ------------------
  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.46k|         auto replay_it = span.begin;
  348|  3.46k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.46k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.46k|         ctx.indent_stack.clear();
  353|  3.46k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.78k, False: 1.67k]
  ------------------
  354|  1.78k|            ctx.push_indent(span.base_indent - 1);
  355|  1.78k|         }
  356|       |
  357|  3.46k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.46k|         using V = std::remove_cvref_t<T>;
  360|  3.46k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.46k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.46k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.46k|         return true;
  367|  3.46k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  26.9k|      {
 2467|  26.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 26.9k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  26.9k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  26.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 8, False: 26.9k]
  ------------------
 2473|      8|            ctx.error = error_code::unexpected_end;
 2474|      8|            return;
 2475|      8|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  26.9k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 6.49k, False: 20.4k]
  ------------------
 2479|  6.49k|            ++it;
 2480|  6.49k|            return;
 2481|  6.49k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  20.4k|         auto start = it;
 2485|  99.8k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 98.8k, False: 1.03k]
  |  Branch (2485:30): [True: 79.4k, False: 19.3k]
  ------------------
 2486|  79.4k|            ++it;
 2487|  79.4k|         }
 2488|       |
 2489|  20.4k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  20.4k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 26, False: 20.4k]
  ------------------
 2491|     26|            ctx.error = error_code::syntax_error;
 2492|     26|         }
 2493|  20.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_:
 5310|   308k|      {
 5311|   308k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   308k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   308k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   308k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   308k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 308k, False: 0]
  ------------------
 5321|   308k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   308k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|   310k|      {
 4183|   310k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 310k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   310k|         auto peek = it;
 4188|   310k|         yaml::node_preamble_state preamble{};
 4189|   310k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 3.54k, False: 306k]
  ------------------
 4190|   310k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  3.54k|            it = peek;
 4192|  3.54k|            return;
 4193|  3.54k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   306k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   306k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 490, False: 306k]
  ------------------
 4198|    490|            return;
 4199|       |
 4200|   306k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 70.1k, False: 236k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  70.1k|            it = peek;
 4203|  70.1k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  70.1k|         }
 4205|   236k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 235k, False: 108]
  ------------------
 4206|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4207|       |            // But if there was a tag, we need to advance past it
 4208|   235k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 1.65k, False: 234k]
  |  Branch (4208:57): [True: 8.96k, False: 225k]
  ------------------
 4209|  10.6k|               it = peek;
 4210|  10.6k|            }
 4211|   235k|            int32_t seq_indent = ctx.current_indent();
 4212|   235k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 234k, False: 1.17k]
  |  Branch (4212:31): [True: 106k, False: 128k]
  ------------------
 4213|   106k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 46.3k, False: 60.2k]
  |  Branch (4213:62): [True: 39.7k, False: 6.63k]
  ------------------
 4214|   106k|                                                          : (ctx.current_indent() + 1);
 4215|   106k|            }
 4216|   235k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   235k|         }
 4218|    108|         else {
 4219|    108|            ctx.error = error_code::syntax_error;
 4220|    108|         }
 4221|       |
 4222|   306k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   306k|      }
_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|   310k|      {
  466|   310k|         skip_inline_ws(it, end);
  467|       |
  468|   310k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 310k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  474|       |
  475|   310k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   310k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 310k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   310k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 310k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   310k|         skip_inline_ws(it, end);
  486|       |
  487|   310k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 310k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   310k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.50k, False: 306k]
  ------------------
  495|  3.50k|            return true;
  496|  3.50k|         }
  497|       |
  498|   306k|         return false;
  499|   310k|      }
_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_:
 4190|   310k|                                             [](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|   310k|      {
  409|   310k|         state.has_anchor = false;
  410|   310k|         state.anchor_name.clear();
  411|   310k|         state.anchor_start = nullptr;
  412|   310k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   310k|         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|   310k|            else {
  421|   310k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.46k, False: 306k]
  ------------------
  422|   310k|            }
  423|   310k|         }
  424|       |
  425|   310k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 306k, False: 3.46k]
  |  Branch (425:27): [True: 9.82k, False: 296k]
  ------------------
  426|  9.82k|            ++it;
  427|  9.82k|            auto name = parse_anchor_name(it, end);
  428|  9.82k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 16, False: 9.81k]
  ------------------
  429|     16|               ctx.error = error_code::syntax_error;
  430|     16|               return true;
  431|     16|            }
  432|  9.81k|            skip_inline_ws(it, end);
  433|  9.81k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 9.79k]
  ------------------
  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|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  9.79k|            state.has_anchor = true;
  446|  9.79k|            state.anchor_name = std::string(name);
  447|  9.79k|            state.anchor_start = &*it;
  448|  9.79k|         }
  449|       |
  450|   310k|         return false;
  451|   310k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   310k|      {
  301|   310k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 310k]
  |  Branch (301:27): [True: 306k, False: 3.46k]
  ------------------
  302|       |
  303|  3.46k|         ++it; // skip '*'
  304|  3.46k|         auto name = parse_anchor_name(it, end);
  305|  3.46k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 3.44k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  3.44k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.44k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 36, False: 3.41k]
  ------------------
  312|     36|            ctx.error = error_code::syntax_error; // undefined alias
  313|     36|            return true;
  314|     36|         }
  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.41k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.41k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.42k, False: 1.98k]
  ------------------
  322|  1.42k|            return true;
  323|  1.42k|         }
  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.98k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 50, False: 1.93k]
  ------------------
  329|     50|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     50|            return true;
  331|     50|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  1.93k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.93k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 1.93k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  1.93k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.93k]
  ------------------
  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.93k|         auto replay_it = span.begin;
  348|  1.93k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.93k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.93k|         ctx.indent_stack.clear();
  353|  1.93k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.03k, False: 898]
  ------------------
  354|  1.03k|            ctx.push_indent(span.base_indent - 1);
  355|  1.03k|         }
  356|       |
  357|  1.93k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.93k|         using V = std::remove_cvref_t<T>;
  360|  1.93k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.93k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.93k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.93k|         return true;
  367|  1.93k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  70.1k|      {
 2665|  70.1k|         using V = std::remove_cvref_t<T>;
 2666|  70.1k|         using value_type = typename V::value_type;
 2667|       |
 2668|  70.1k|         struct sequence_container_adapter
 2669|  70.1k|         {
 2670|  70.1k|            size_t index = 0;
 2671|       |
 2672|  70.1k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  70.1k|            {
 2674|  70.1k|               if constexpr (!resizable<V>) {
 2675|  70.1k|                  return index >= container.size();
 2676|  70.1k|               }
 2677|  70.1k|               else {
 2678|  70.1k|                  (void)container;
 2679|  70.1k|                  return false;
 2680|  70.1k|               }
 2681|  70.1k|            }
 2682|       |
 2683|  70.1k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  70.1k|            inline void append(V& container, value_type&& element) noexcept
 2686|  70.1k|            {
 2687|  70.1k|               if constexpr (emplace_backable<V>) {
 2688|  70.1k|                  container.emplace_back(std::move(element));
 2689|  70.1k|               }
 2690|  70.1k|               else if constexpr (emplaceable<V>) {
 2691|  70.1k|                  container.emplace(std::move(element));
 2692|  70.1k|               }
 2693|  70.1k|            }
 2694|  70.1k|         };
 2695|       |
 2696|  70.1k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 70.1k]
  |  Branch (2696:27): [True: 0, False: 70.1k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  70.1k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  70.1k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  70.1k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  70.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 6, False: 70.1k]
  ------------------
 2709|      6|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  70.1k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 68.6k, False: 1.48k]
  |  Branch (2712:27): [True: 15.5k, False: 53.1k]
  ------------------
 2713|  15.5k|            ++it;
 2714|  15.5k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  15.5k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 6, False: 15.4k]
  ------------------
 2716|      6|               return;
 2717|  15.4k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  15.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 1.71k, False: 13.7k]
  ------------------
 2719|  1.71k|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|  1.71k|               }
 2721|  15.4k|            }
 2722|  15.4k|            return;
 2723|  15.5k|         }
 2724|       |
 2725|  54.6k|         bool just_saw_comma = false;
 2726|  54.6k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  54.6k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  82.2k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 79.2k, False: 3.00k]
  ------------------
 2731|  79.2k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  79.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 79.2k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  79.2k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 79.2k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  79.2k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 11.2k, False: 67.9k]
  ------------------
 2741|  11.2k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 11.2k, False: 0]
  ------------------
 2742|  11.2k|                     ++it;
 2743|  11.2k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  11.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 6, False: 11.2k]
  ------------------
 2745|      6|                        return;
 2746|  11.2k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  11.2k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 4.25k, False: 7.01k]
  ------------------
 2748|  4.25k|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|  4.25k|                        }
 2750|  11.2k|                     }
 2751|  11.2k|                     return;
 2752|  11.2k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  11.2k|               }
 2756|       |
 2757|  67.9k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 6, False: 67.9k]
  |  Branch (2757:34): [True: 10, False: 67.9k]
  ------------------
 2758|     16|                  ctx.error = error_code::syntax_error;
 2759|     16|                  return;
 2760|     16|               }
 2761|  67.9k|               just_saw_comma = false;
 2762|       |
 2763|  67.9k|               value_type element{};
 2764|  67.9k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  67.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 20.9k, False: 46.9k]
  ------------------
 2767|  20.9k|                  return;
 2768|       |
 2769|  46.9k|               bool saw_line_break_before_separator = false;
 2770|  46.9k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  46.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 30, False: 46.9k]
  ------------------
 2772|     30|                  return;
 2773|       |
 2774|  46.9k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 45.2k, False: 1.71k]
  |  Branch (2774:33): [True: 7.19k, False: 38.0k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  7.19k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 6, False: 7.19k]
  ------------------
 2777|      6|                     ctx.error = error_code::syntax_error;
 2778|      6|                     return;
 2779|      6|                  }
 2780|  7.19k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  7.19k|                     glz::generic key_node = std::move(element);
 2782|  7.19k|                     ++it;
 2783|  7.19k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  7.19k|                     glz::generic mapped{};
 2786|  7.19k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  7.19k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 306, False: 6.88k]
  ------------------
 2788|    306|                        return;
 2789|       |
 2790|  6.88k|                     std::string key;
 2791|  6.88k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 0, False: 6.88k]
  ------------------
 2792|      0|                        return;
 2793|       |
 2794|  6.88k|                     glz::generic pair{};
 2795|  6.88k|                     pair[key] = std::move(mapped);
 2796|  6.88k|                     element = std::move(pair);
 2797|       |
 2798|  6.88k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  6.88k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 6, False: 6.88k]
  ------------------
 2800|      6|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  7.19k|               }
 2807|       |
 2808|  46.9k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  46.9k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 1.75k, False: 45.2k]
  ------------------
 2811|  1.75k|                  ctx.error = error_code::unexpected_end;
 2812|  1.75k|                  return;
 2813|  1.75k|               }
 2814|       |
 2815|  45.2k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 16.8k, False: 28.3k]
  ------------------
 2816|  16.8k|                  ++it;
 2817|  16.8k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  16.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 6, False: 16.8k]
  ------------------
 2819|      6|                     return;
 2820|  16.8k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  16.8k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 8.35k, False: 8.48k]
  ------------------
 2822|  8.35k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|  8.35k|                     }
 2824|  16.8k|                  }
 2825|  16.8k|                  return;
 2826|  16.8k|               }
 2827|  28.3k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 27.6k, False: 708]
  ------------------
 2828|  27.6k|                  ++it;
 2829|  27.6k|                  just_saw_comma = true;
 2830|  27.6k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  27.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 6, False: 27.6k]
  ------------------
 2832|      6|                     return;
 2833|  27.6k|               }
 2834|    708|               else {
 2835|    708|                  ctx.error = error_code::syntax_error;
 2836|    708|                  return;
 2837|    708|               }
 2838|  45.2k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  54.6k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   306k|      {
 2649|   306k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   306k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   306k|               value.clear();
 2653|   306k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   306k|      }
_ZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  965|  20.4k|      {
  966|  20.4k|         auto is_document_start = [&](auto pos) {
  967|  20.4k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  968|  20.4k|               auto after = pos + 3;
  969|  20.4k|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  970|  20.4k|                      *after == '#';
  971|  20.4k|            }
  972|  20.4k|            return false;
  973|  20.4k|         };
  974|       |
  975|  20.4k|         bool at_line_start = false;
  976|  20.4k|         auto tail = it;
  977|  39.0k|         while (tail != end) {
  ------------------
  |  Branch (977:17): [True: 23.8k, False: 15.2k]
  ------------------
  978|  23.8k|            auto line = tail;
  979|  23.8k|            skip_inline_ws(line, end);
  980|       |
  981|  23.8k|            if (line == end) {
  ------------------
  |  Branch (981:17): [True: 1.94k, False: 21.8k]
  ------------------
  982|  1.94k|               return;
  983|  1.94k|            }
  984|       |
  985|  21.8k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (985:17): [True: 3.90k, False: 17.9k]
  |  Branch (985:34): [True: 8.02k, False: 9.96k]
  ------------------
  986|  11.9k|               tail = line;
  987|  11.9k|               skip_newline(tail, end);
  988|  11.9k|               at_line_start = true;
  989|  11.9k|               continue;
  990|  11.9k|            }
  991|       |
  992|  9.96k|            if (*line == '#') {
  ------------------
  |  Branch (992:17): [True: 6.97k, False: 2.98k]
  ------------------
  993|  6.97k|               if (!at_line_start && line == it) {
  ------------------
  |  Branch (993:20): [True: 2.40k, False: 4.56k]
  |  Branch (993:38): [True: 30, False: 2.37k]
  ------------------
  994|     30|                  ctx.error = error_code::syntax_error;
  995|     30|                  return;
  996|     30|               }
  997|  6.94k|               tail = line;
  998|  6.94k|               skip_comment(tail, end);
  999|  6.94k|               if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (999:20): [True: 6.72k, False: 214]
  |  Branch (999:36): [True: 5.59k, False: 1.13k]
  |  Branch (999:53): [True: 1.10k, False: 34]
  ------------------
 1000|  6.69k|                  skip_newline(tail, end);
 1001|  6.69k|                  at_line_start = true;
 1002|  6.69k|                  continue;
 1003|  6.69k|               }
 1004|    248|               return;
 1005|  6.94k|            }
 1006|       |
 1007|  2.98k|            if (at_line_start && (at_document_end(line, end) || is_document_start(line))) {
  ------------------
  |  Branch (1007:17): [True: 2.43k, False: 550]
  |  Branch (1007:35): [True: 960, False: 1.47k]
  |  Branch (1007:65): [True: 1.24k, False: 236]
  ------------------
 1008|  2.20k|               return;
 1009|  2.20k|            }
 1010|       |
 1011|    786|            ctx.error = error_code::syntax_error;
 1012|    786|            return;
 1013|  2.98k|         }
 1014|  20.4k|      }
_ZZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_ENKUlS5_E_clIS4_EEDaS5_:
  966|  1.47k|         auto is_document_start = [&](auto pos) {
  967|  1.47k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (967:17): [True: 1.36k, False: 114]
  |  Branch (967:35): [True: 1.27k, False: 90]
  |  Branch (967:52): [True: 1.25k, False: 20]
  |  Branch (967:69): [True: 1.24k, False: 6]
  ------------------
  968|  1.24k|               auto after = pos + 3;
  969|  1.24k|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (969:23): [True: 212, False: 1.03k]
  |  Branch (969:39): [True: 198, False: 838]
  |  Branch (969:56): [True: 194, False: 644]
  |  Branch (969:74): [True: 196, False: 448]
  |  Branch (969:92): [True: 194, False: 254]
  ------------------
  970|    254|                      *after == '#';
  ------------------
  |  Branch (970:23): [True: 248, False: 6]
  ------------------
  971|  1.24k|            }
  972|    230|            return false;
  973|  1.47k|         };
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  46.6k|            {
 2687|  46.6k|               if constexpr (emplace_backable<V>) {
 2688|  46.6k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  46.6k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   235k|      {
 3160|   235k|         using V = std::remove_cvref_t<T>;
 3161|   235k|         using value_type = typename V::value_type;
 3162|       |
 3163|   235k|         struct sequence_container_adapter
 3164|   235k|         {
 3165|   235k|            size_t index = 0;
 3166|       |
 3167|   235k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   235k|            {
 3169|   235k|               if constexpr (!resizable<V>) {
 3170|   235k|                  return index >= container.size();
 3171|   235k|               }
 3172|   235k|               else {
 3173|   235k|                  (void)container;
 3174|   235k|                  return false;
 3175|   235k|               }
 3176|   235k|            }
 3177|       |
 3178|   235k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   235k|            inline void append(V& container, value_type&& element) noexcept
 3181|   235k|            {
 3182|   235k|               if constexpr (emplace_backable<V>) {
 3183|   235k|                  container.emplace_back(std::move(element));
 3184|   235k|               }
 3185|   235k|               else if constexpr (emplaceable<V>) {
 3186|   235k|                  container.emplace(std::move(element));
 3187|   235k|               }
 3188|   235k|            }
 3189|   235k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   235k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   235k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   235k|         bool first_item = true;
 3200|   235k|         bool has_pending_item_anchor = false;
 3201|   235k|         std::string pending_item_anchor_name{};
 3202|   235k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   717k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 597k, False: 120k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   597k|            int32_t line_indent = 0;
 3215|   597k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   597k|            auto line_start = it;
 3217|       |
 3218|   937k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 894k, False: 42.9k]
  ------------------
 3219|   894k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 45.1k, False: 849k]
  ------------------
 3220|  45.1k|                  skip_comment(it, end);
 3221|  45.1k|                  skip_newline(it, end);
 3222|  45.1k|                  line_start = it;
 3223|  45.1k|                  line_indent = 0;
 3224|  45.1k|               }
 3225|   849k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 68.8k, False: 780k]
  |  Branch (3225:40): [True: 161k, False: 619k]
  ------------------
 3226|   230k|                  skip_newline(it, end);
 3227|   230k|                  line_start = it;
 3228|   230k|                  line_indent = 0;
 3229|   230k|               }
 3230|   619k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 75.8k, False: 543k]
  ------------------
 3231|  75.8k|                  line_start = it;
 3232|  75.8k|                  line_indent = 0;
 3233|   207k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 197k, False: 9.99k]
  |  Branch (3233:39): [True: 131k, False: 65.8k]
  ------------------
 3234|   131k|                     ++line_indent;
 3235|   131k|                     ++it;
 3236|   131k|                  }
 3237|       |
 3238|  75.8k|                  bool saw_tab = false;
 3239|  83.6k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 73.0k, False: 10.6k]
  |  Branch (3239:40): [True: 3.88k, False: 69.1k]
  |  Branch (3239:54): [True: 3.98k, False: 65.1k]
  ------------------
 3240|  7.86k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 5.01k, False: 2.85k]
  |  Branch (3240:43): [True: 2.85k, False: 0]
  ------------------
 3241|  7.86k|                     ++it;
 3242|  7.86k|                  }
 3243|       |
 3244|  75.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 10.6k, False: 65.1k]
  |  Branch (3244:36): [True: 3.28k, False: 61.9k]
  |  Branch (3244:51): [True: 23.7k, False: 38.1k]
  |  Branch (3244:66): [True: 11.2k, False: 26.8k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  48.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 38.3k, False: 10.6k]
  |  Branch (3246:39): [True: 11.2k, False: 27.0k]
  ------------------
 3247|  11.2k|                        skip_comment(it, end);
 3248|  11.2k|                     }
 3249|  48.9k|                     line_indent = 0;
 3250|  48.9k|                     continue;
 3251|  48.9k|                  }
 3252|       |
 3253|  26.8k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 32, False: 26.8k]
  ------------------
 3254|     32|                     ctx.error = error_code::syntax_error;
 3255|     32|                     return;
 3256|     32|                  }
 3257|  26.8k|                  break; // Found content
 3258|  26.8k|               }
 3259|   543k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 15.6k, False: 527k]
  ------------------
 3260|  15.6k|                  line_start = it;
 3261|  43.5k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 41.7k, False: 1.89k]
  |  Branch (3261:40): [True: 2.42k, False: 39.2k]
  |  Branch (3261:54): [True: 25.5k, False: 13.7k]
  ------------------
 3262|  15.6k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 1.89k, False: 13.7k]
  |  Branch (3262:36): [True: 5.66k, False: 8.10k]
  |  Branch (3262:51): [True: 1.22k, False: 6.88k]
  |  Branch (3262:66): [True: 6.84k, False: 40]
  ------------------
 3263|  15.6k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 13.7k, False: 1.89k]
  |  Branch (3263:39): [True: 6.84k, False: 6.88k]
  ------------------
 3264|  6.84k|                        skip_comment(it, end);
 3265|  6.84k|                     }
 3266|  15.6k|                     line_indent = 0;
 3267|  15.6k|                     continue;
 3268|  15.6k|                  }
 3269|     40|                  ctx.error = error_code::syntax_error;
 3270|     40|                  return;
 3271|  15.6k|               }
 3272|   527k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   527k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 235k, False: 291k]
  |  Branch (3276:37): [True: 234k, False: 1.17k]
  ------------------
 3277|   234k|                     line_indent = sequence_indent;
 3278|   234k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   234k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 234k, False: 0]
  |  Branch (3279:49): [True: 234k, False: 0]
  ------------------
 3280|   234k|                           auto probe = it;
 3281|   234k|                           int32_t leading_ws = 0;
 3282|   234k|                           bool saw_tab = false;
 3283|   484k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 484k, False: 0]
  |  Branch (3283:64): [True: 243k, False: 240k]
  |  Branch (3283:87): [True: 6.03k, False: 234k]
  ------------------
 3284|   249k|                              --probe;
 3285|   249k|                              ++leading_ws;
 3286|   249k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 350, False: 249k]
  |  Branch (3286:52): [True: 5.83k, False: 243k]
  ------------------
 3287|   249k|                           }
 3288|   234k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 234k]
  |  Branch (3288:61): [True: 23.7k, False: 210k]
  |  Branch (3288:85): [True: 87.2k, False: 123k]
  ------------------
 3289|   111k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 6, False: 111k]
  ------------------
 3290|      6|                                 ctx.error = error_code::syntax_error;
 3291|      6|                                 return;
 3292|      6|                              }
 3293|   111k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|   111k|                           }
 3295|   234k|                        }
 3296|   234k|                     }
 3297|   234k|                  }
 3298|   234k|                  break;
 3299|   527k|               }
 3300|   894k|            }
 3301|       |
 3302|   597k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 42.9k, False: 554k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   554k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 5.41k, False: 549k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   549k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 16.6k, False: 532k]
  ------------------
 3309|  16.6k|               it = line_start;
 3310|  16.6k|               return;
 3311|  16.6k|            }
 3312|       |
 3313|   532k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 23.8k, False: 508k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  23.8k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 20, False: 23.7k]
  ------------------
 3318|     20|                  ctx.error = error_code::syntax_error;
 3319|     20|                  return;
 3320|     20|               }
 3321|       |
 3322|  23.7k|               ++it;
 3323|  23.7k|               auto pending_name = parse_anchor_name(it, end);
 3324|  23.7k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 18, False: 23.7k]
  ------------------
 3325|     18|                  ctx.error = error_code::syntax_error;
 3326|     18|                  return;
 3327|     18|               }
 3328|  23.7k|               skip_inline_ws(it, end);
 3329|  23.7k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 23.7k, False: 20]
  |  Branch (3329:33): [True: 5.42k, False: 18.3k]
  ------------------
 3330|  5.42k|                  skip_comment(it, end);
 3331|  5.42k|               }
 3332|       |
 3333|  23.7k|               has_pending_item_anchor = true;
 3334|  23.7k|               pending_item_anchor_name = std::string(pending_name);
 3335|  23.7k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  23.7k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 20, False: 23.7k]
  |  Branch (3337:34): [True: 13.6k, False: 10.0k]
  |  Branch (3337:49): [True: 24, False: 13.6k]
  ------------------
 3338|     44|                  ctx.error = error_code::syntax_error;
 3339|     44|                  return;
 3340|     44|               }
 3341|       |
 3342|  23.7k|               skip_newline(it, end);
 3343|  23.7k|               continue;
 3344|  23.7k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   508k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 42.9k, False: 465k]
  ------------------
 3348|  42.9k|               it = line_start;
 3349|  42.9k|               return;
 3350|  42.9k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   465k|            dash_col = line_indent;
 3356|   465k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   465k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 465k, False: 6]
  ------------------
 3358|   465k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   465k|               }
 3360|   465k|            }
 3361|       |
 3362|   465k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   465k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 446k, False: 18.9k]
  |  Branch (3365:30): [True: 4.14k, False: 442k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  4.14k|               it = line_start;
 3368|  4.14k|               return;
 3369|  4.14k|            }
 3370|       |
 3371|   461k|            bool saw_tab_after_dash = false;
 3372|   750k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 719k, False: 30.5k]
  |  Branch (3372:34): [True: 213k, False: 505k]
  |  Branch (3372:48): [True: 74.6k, False: 431k]
  ------------------
 3373|   288k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 6.35k, False: 282k]
  |  Branch (3373:59): [True: 73.0k, False: 209k]
  ------------------
 3374|   288k|               ++it;
 3375|   288k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   461k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 73.0k, False: 388k]
  |  Branch (3377:39): [True: 72.4k, False: 602]
  |  Branch (3377:52): [True: 728, False: 71.7k]
  ------------------
 3378|    728|               const auto after_dash = it + 1;
 3379|    728|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 8, False: 720]
  |  Branch (3379:41): [True: 6, False: 714]
  ------------------
 3380|     14|                  ctx.error = error_code::syntax_error;
 3381|     14|                  return;
 3382|     14|               }
 3383|    728|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   461k|            auto parse_element = [&](auto& element) {
 3387|   461k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   461k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   461k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   461k|                     return;
 3397|   461k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   461k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   461k|                  ctx.sequence_item_value_context = true;
 3400|   461k|                  ctx.sequence_dash_indent = dash_col;
 3401|   461k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   461k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   461k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   461k|                  ctx.pop_indent();
 3405|   461k|               }
 3406|   461k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   461k|                  skip_ws_and_comment(it, end);
 3409|   461k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   461k|                  auto nested_start = it;
 3413|   461k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   461k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   461k|                     return;
 3416|   461k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   461k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   461k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   461k|                     const int32_t element_indent =
 3428|   461k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   461k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   461k|                        return;
 3431|   461k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   461k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   461k|                     ctx.sequence_item_value_context = true;
 3434|   461k|                     ctx.sequence_dash_indent = dash_col;
 3435|   461k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   461k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   461k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   461k|                     ctx.pop_indent();
 3439|   461k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   461k|               }
 3442|       |
 3443|   461k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   461k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   461k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   461k|                                                                      pending_item_anchor_indent};
 3447|   461k|                  has_pending_item_anchor = false;
 3448|   461k|               }
 3449|   461k|            };
 3450|       |
 3451|   461k|            if constexpr (emplace_backable<V>) {
 3452|   461k|               auto& element = value.emplace_back();
 3453|   461k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   461k|            first_item = false;
 3472|       |
 3473|   461k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 3.35k, False: 458k]
  ------------------
 3474|  3.35k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   461k|         }
 3479|   235k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   461k|            auto parse_element = [&](auto& element) {
 3387|   461k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 431k, False: 30.5k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   461k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 431k, False: 30.5k]
  |  Branch (3390:33): [True: 200k, False: 230k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   200k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 200k]
  ------------------
 3396|      0|                     return;
 3397|   200k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   200k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   200k|                  ctx.sequence_item_value_context = true;
 3400|   200k|                  ctx.sequence_dash_indent = dash_col;
 3401|   200k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   200k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   200k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   200k|                  ctx.pop_indent();
 3405|   200k|               }
 3406|   260k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   260k|                  skip_ws_and_comment(it, end);
 3409|   260k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   260k|                  auto nested_start = it;
 3413|   260k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   260k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 6, False: 260k]
  ------------------
 3415|      6|                     return;
 3416|   260k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   260k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 18.4k, False: 242k]
  ------------------
 3422|   260k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 70.6k, False: 190k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  70.6k|                     const int32_t element_indent =
 3428|  70.6k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 70.6k]
  ------------------
 3429|  70.6k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 70.6k]
  ------------------
 3430|      0|                        return;
 3431|  70.6k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  70.6k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  70.6k|                     ctx.sequence_item_value_context = true;
 3434|  70.6k|                     ctx.sequence_dash_indent = dash_col;
 3435|  70.6k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  70.6k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  70.6k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  70.6k|                     ctx.pop_indent();
 3439|  70.6k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   260k|               }
 3442|       |
 3443|   461k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 6.57k, False: 455k]
  |  Branch (3443:47): [True: 6.51k, False: 62]
  ------------------
 3444|  6.51k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 4.48k, False: 2.03k]
  ------------------
 3445|  6.51k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  6.51k|                                                                      pending_item_anchor_indent};
 3447|  6.51k|                  has_pending_item_anchor = false;
 3448|  6.51k|               }
 3449|   461k|            };
_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_:
 5530|   687k|   {
 5531|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5532|       |         // In flow context, only treat plain content as an implicit "key: value"
 5533|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5534|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|       |            bool at_node_start = true;
 5542|       |            int depth = 0;
 5543|       |            while (pos != stop) {
 5544|       |               const char c = *pos;
 5545|       |               if (c == ' ' || c == '\t') {
 5546|       |                  ++pos;
 5547|       |                  continue;
 5548|       |               }
 5549|       |               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|       |               if ((c == '"' || c == '\'') && node_start) {
 5552|       |                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|       |                  continue;
 5554|       |               }
 5555|       |               if (c == '[' || c == '{') {
 5556|       |                  ++depth;
 5557|       |                  at_node_start = true;
 5558|       |                  ++pos;
 5559|       |                  continue;
 5560|       |               }
 5561|       |               if (c == ']' || c == '}') {
 5562|       |                  if (depth == 0) return false;
 5563|       |                  --depth;
 5564|       |                  ++pos;
 5565|       |                  continue;
 5566|       |               }
 5567|       |               if (c == ',' && depth == 0) return false;
 5568|       |               if (c == ':' && depth == 0) {
 5569|       |                  auto next = pos + 1;
 5570|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|       |               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|       |               if (c == ',' || c == ':') {
 5574|       |                  at_node_start = true;
 5575|       |                  ++pos;
 5576|       |                  continue;
 5577|       |               }
 5578|       |               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|       |                  at_node_start = true;
 5580|       |                  continue;
 5581|       |               }
 5582|       |               ++pos;
 5583|       |            }
 5584|       |            return false;
 5585|       |         };
 5586|       |
 5587|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5588|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5589|       |               return;
 5590|       |            }
 5591|       |            if (bool(ctx.error)) {
 5592|       |               return;
 5593|       |            }
 5594|       |         }
 5595|       |
 5596|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|       |         return;
 5598|       |      }
 5599|       |
 5600|   687k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 244k, False: 443k]
  ------------------
 5601|   244k|         return;
 5602|   244k|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|   443k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 50.8k, False: 392k]
  ------------------
 5605|  50.8k|         return;
 5606|  50.8k|      }
 5607|   392k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   392k|   }
_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_:
 5962|   110k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   110k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 2.94k, False: 107k]
  ------------------
 5964|  2.94k|                  return true;
 5965|  2.94k|               }
 5966|   107k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 57.7k, False: 49.3k]
  ------------------
 5967|  57.7k|                  auto next = ptr + 1;
 5968|  57.7k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 21.1k, False: 36.6k]
  |  Branch (5968:43): [True: 4.17k, False: 32.4k]
  |  Branch (5968:59): [True: 6.47k, False: 26.0k]
  |  Branch (5968:76): [True: 17.0k, False: 8.98k]
  |  Branch (5968:93): [True: 3.35k, False: 5.62k]
  ------------------
 5969|  57.7k|               }
 5970|  49.3k|               return is_plain_scalar_boundary(*ptr);
 5971|   107k|            };
_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:
 5888|  49.3k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  49.3k|               switch (ch) {
 5890|  1.84k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 1.84k, False: 47.4k]
  ------------------
 5891|  4.00k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 2.15k, False: 47.1k]
  ------------------
 5892|  19.8k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 15.8k, False: 33.5k]
  ------------------
 5893|  41.5k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 21.7k, False: 27.5k]
  ------------------
 5894|  41.7k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 210, False: 49.1k]
  ------------------
 5895|  41.9k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 198, False: 49.1k]
  ------------------
 5896|  42.3k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 398, False: 48.9k]
  ------------------
 5897|  42.3k|                  return true;
 5898|  6.92k|               default:
  ------------------
  |  Branch (5898:16): [True: 6.92k, False: 42.3k]
  ------------------
 5899|  6.92k|                  return false;
 5900|  49.3k|               }
 5901|  49.3k|            };
_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_:
 5903|  97.5k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5905|       |                  return false;
 5906|       |               }
 5907|  97.5k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 44.8k, False: 52.6k]
  ------------------
 5908|  44.8k|                  return false;
 5909|  44.8k|               }
 5910|  52.6k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 1.55k, False: 51.0k]
  |  Branch (5910:40): [True: 35.7k, False: 15.3k]
  |  Branch (5910:61): [True: 18.6k, False: 17.0k]
  ------------------
 5911|  20.2k|                  return false;
 5912|  20.2k|               }
 5913|       |
 5914|  32.3k|               auto look = word_end;
 5915|  32.3k|               yaml::skip_newline(look, end);
 5916|   178k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 167k, False: 10.8k]
  ------------------
 5917|   167k|                  int32_t line_indent = 0;
 5918|   508k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 508k, False: 224]
  |  Branch (5918:41): [True: 340k, False: 167k]
  ------------------
 5919|   340k|                     ++line_indent;
 5920|   340k|                     ++look;
 5921|   340k|                  }
 5922|   167k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 167k, False: 224]
  |  Branch (5922:38): [True: 2.44k, False: 164k]
  ------------------
 5923|  2.44k|                     return false;
 5924|  2.44k|                  }
 5925|   165k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 224, False: 164k]
  |  Branch (5925:38): [True: 117k, False: 47.0k]
  |  Branch (5925:55): [True: 14.1k, False: 32.8k]
  ------------------
 5926|   132k|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 131k, False: 224]
  ------------------
 5927|   131k|                        yaml::skip_newline(look, end);
 5928|   131k|                        continue;
 5929|   131k|                     }
 5930|    224|                     return false;
 5931|   132k|                  }
 5932|  32.8k|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 15.1k, False: 17.7k]
  ------------------
 5933|  15.1k|                     yaml::skip_comment(look, end);
 5934|  15.1k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 13.9k, False: 1.19k]
  |  Branch (5934:42): [True: 6.20k, False: 7.75k]
  |  Branch (5934:59): [True: 7.75k, False: 0]
  ------------------
 5935|  13.9k|                        yaml::skip_newline(look, end);
 5936|  13.9k|                        continue;
 5937|  13.9k|                     }
 5938|  1.19k|                     return false;
 5939|  15.1k|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  17.7k|                  {
 5945|  17.7k|                     auto scan = look;
 5946|  2.69M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 2.69M, False: 2.31k]
  |  Branch (5946:44): [True: 2.68M, False: 7.26k]
  |  Branch (5946:61): [True: 2.68M, False: 1.73k]
  ------------------
 5947|  2.68M|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 12.3k, False: 2.67M]
  ------------------
 5948|  12.3k|                           auto after_colon = scan + 1;
 5949|  12.3k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 1.04k, False: 11.2k]
  |  Branch (5949:54): [True: 2.35k, False: 8.91k]
  |  Branch (5949:77): [True: 286, False: 8.62k]
  ------------------
 5950|  8.62k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 2.34k, False: 6.27k]
  |  Branch (5950:56): [True: 400, False: 5.87k]
  ------------------
 5951|  6.42k|                              return false;
 5952|  6.42k|                           }
 5953|  12.3k|                        }
 5954|  2.67M|                        ++scan;
 5955|  2.67M|                     }
 5956|  17.7k|                  }
 5957|       |
 5958|  11.3k|                  return line_indent > ctx.current_indent();
 5959|  17.7k|               }
 5960|  10.8k|               return false;
 5961|  32.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_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5484|   770k|   {
 5485|   770k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   770k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   770k|         const bool could_be_mapping = [&] {
 5493|   770k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   770k|               return line_could_be_flow_mapping(it, end);
 5495|   770k|            }
 5496|   770k|            else {
 5497|   770k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   770k|            }
 5499|   770k|         }();
 5500|   770k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 447k, False: 323k]
  ------------------
 5501|   447k|            return false;
 5502|   447k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   323k|         auto temp_ctx = ctx.make_speculative();
 5505|   323k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   323k|                                                                                               end);
 5507|   323k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   323k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   323k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 254k, False: 68.2k]
  ------------------
 5510|   254k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   254k|            return true;
 5512|   254k|         }
 5513|       |         // The line matched "key: value" pattern but parsing failed.
 5514|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5515|       |         // so propagate the error rather than silently falling back to string.
 5516|  68.2k|         ctx.error = temp_ctx.error;
 5517|  68.2k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  68.2k|         return false;
 5519|   323k|      }
 5520|   770k|   }
_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:
 5492|   770k|         const bool could_be_mapping = [&] {
 5493|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5494|       |               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|   770k|            else {
 5497|   770k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   770k|            }
 5499|   770k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|  53.7k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|       |                     val = {};
 4766|       |                     return true;
 4767|       |                  }
 4768|  53.7k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  53.7k|                     val = glz::generic{};
 4770|  53.7k|                     return true;
 4771|       |                  }
 4772|       |                  else {
 4773|       |                     static constexpr std::string_view null_value{"null"};
 4774|       |                     auto null_it = null_value.data();
 4775|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|       |                     return !bool(ctx.error);
 4778|       |                  }
 4779|  53.7k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   262k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   262k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 262k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   262k|         const int32_t parent_indent = ctx.current_indent();
 3722|   262k|         const bool discover_indent = (mapping_indent < 0);
 3723|   262k|         bool first_key = !discover_indent;
 3724|   262k|         bool discovered_first_key_mid_line = false;
 3725|   262k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|   686k|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 580k, False: 105k]
  ------------------
 3728|   580k|            auto line_start = it;
 3729|   580k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 580k]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|   710k|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 702k, False: 8.30k]
  ------------------
 3733|   702k|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 15.8k, False: 686k]
  ------------------
 3734|  15.8k|                  skip_comment(it, end);
 3735|  15.8k|                  skip_newline(it, end);
 3736|  15.8k|                  first_key = false;
 3737|  15.8k|                  line_indent = 0;
 3738|  15.8k|               }
 3739|   686k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 71.4k, False: 614k]
  |  Branch (3739:40): [True: 25.4k, False: 589k]
  ------------------
 3740|  96.8k|                  skip_newline(it, end);
 3741|  96.8k|                  first_key = false;
 3742|  96.8k|                  line_indent = 0;
 3743|  96.8k|               }
 3744|   589k|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 220k, False: 369k]
  ------------------
 3745|   220k|                  line_start = it;
 3746|   220k|                  line_indent = 0;
 3747|  1.20M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 1.20M, False: 1.55k]
  |  Branch (3747:39): [True: 988k, False: 218k]
  ------------------
 3748|   988k|                     ++line_indent;
 3749|   988k|                     ++it;
 3750|   988k|                  }
 3751|       |
 3752|   220k|                  bool saw_tab = false;
 3753|   225k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 223k, False: 1.78k]
  |  Branch (3753:40): [True: 430, False: 223k]
  |  Branch (3753:54): [True: 4.59k, False: 218k]
  ------------------
 3754|  5.02k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 3.40k, False: 1.62k]
  |  Branch (3754:43): [True: 1.62k, False: 0]
  ------------------
 3755|  5.02k|                     ++it;
 3756|  5.02k|                  }
 3757|       |
 3758|   220k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 1.78k, False: 218k]
  |  Branch (3758:36): [True: 4.35k, False: 214k]
  |  Branch (3758:51): [True: 2.76k, False: 211k]
  |  Branch (3758:66): [True: 6.50k, False: 204k]
  ------------------
 3759|  15.4k|                     first_key = false;
 3760|  15.4k|                     line_indent = 0;
 3761|  15.4k|                     continue; // Blank or comment line
 3762|  15.4k|                  }
 3763|       |
 3764|   204k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 37, False: 204k]
  ------------------
 3765|     37|                     ctx.error = error_code::syntax_error;
 3766|     37|                     return;
 3767|     37|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   204k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 204k, False: 913]
  |  Branch (3770:46): [True: 168, False: 203k]
  ------------------
 3771|    168|                     it = line_start;
 3772|    168|                     return;
 3773|    168|                  }
 3774|       |
 3775|   204k|                  first_key = false;
 3776|   204k|                  break; // Found content
 3777|   204k|               }
 3778|   369k|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 2.08k, False: 367k]
  ------------------
 3779|  2.08k|                  line_start = it;
 3780|  6.89k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 6.64k, False: 248]
  |  Branch (3780:40): [True: 1.22k, False: 5.42k]
  |  Branch (3780:54): [True: 3.59k, False: 1.83k]
  ------------------
 3781|  2.08k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 248, False: 1.83k]
  |  Branch (3781:36): [True: 584, False: 1.25k]
  |  Branch (3781:51): [True: 733, False: 518]
  |  Branch (3781:66): [True: 440, False: 78]
  ------------------
 3782|  2.00k|                     first_key = false;
 3783|  2.00k|                     line_indent = 0;
 3784|  2.00k|                     continue; // Blank or comment-only line with tab indentation
 3785|  2.00k|                  }
 3786|     78|                  ctx.error = error_code::syntax_error;
 3787|     78|                  return;
 3788|  2.08k|               }
 3789|   367k|               else {
 3790|   367k|                  line_start = it;
 3791|   367k|                  break; // Content at column 0
 3792|   367k|               }
 3793|   702k|            }
 3794|       |
 3795|   580k|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 8.30k, False: 571k]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|   571k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 2.06k, False: 569k]
  |  Branch (3799:45): [True: 679, False: 569k]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|   569k|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 569k, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|   569k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 569k, False: 0]
  |  Branch (3806:39): [True: 307k, False: 262k]
  |  Branch (3806:62): [True: 161k, False: 145k]
  |  Branch (3806:84): [True: 117k, False: 44.2k]
  ------------------
 3807|   117k|                  it = line_start;
 3808|   117k|                  return;
 3809|   117k|               }
 3810|   451k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 189k, False: 262k]
  |  Branch (3810:43): [True: 126, False: 189k]
  ------------------
 3811|    126|                  it = line_start;
 3812|    126|                  return;
 3813|    126|               }
 3814|   451k|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|   451k|            bool established_mapping_indent_this_line = false;
 3818|   451k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 262k, False: 189k]
  ------------------
 3819|   262k|               mapping_indent = line_indent;
 3820|   262k|               established_mapping_indent_this_line = true;
 3821|   262k|               discovered_first_key_visual_indent = line_indent;
 3822|   262k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   262k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 262k, False: 0]
  |  Branch (3823:43): [True: 256k, False: 5.67k]
  ------------------
 3824|   256k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   256k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 309, False: 256k]
  ------------------
 3826|    309|                        ctx.error = error_code::syntax_error;
 3827|    309|                        return;
 3828|    309|                     }
 3829|       |
 3830|   256k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   256k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 255k, False: 913]
  |  Branch (3831:49): [True: 230k, False: 24.3k]
  ------------------
 3832|   230k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   230k|                     }
 3834|   256k|                  }
 3835|   262k|               }
 3836|   262k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|   451k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 451k, False: 309]
  |  Branch (3840:36): [True: 451k, False: 0]
  |  Branch (3840:59): [True: 189k, False: 261k]
  ------------------
 3841|   189k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 42.6k, False: 146k]
  ------------------
 3842|  42.6k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 42.1k, False: 515]
  |  Branch (3842:43): [True: 20.3k, False: 21.8k]
  ------------------
 3843|  20.3k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 29, False: 20.2k]
  ------------------
 3844|     29|                     ctx.error = error_code::syntax_error;
 3845|     29|                     return;
 3846|     29|                  }
 3847|  20.2k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 1.23k, False: 19.0k]
  ------------------
 3848|  1.23k|                     it = line_start;
 3849|  1.23k|                     return;
 3850|  1.23k|                  }
 3851|  20.2k|               }
 3852|  22.3k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 1.27k, False: 21.0k]
  ------------------
 3853|  1.27k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 226, False: 1.04k]
  |  Branch (3853:47): [True: 2, False: 1.04k]
  ------------------
 3854|  1.04k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 1.04k, False: 0]
  |  Branch (3854:49): [True: 1.04k, False: 0]
  |  Branch (3854:72): [True: 14, False: 1.03k]
  ------------------
 3855|    242|                  ctx.error = error_code::syntax_error;
 3856|    242|                  return;
 3857|    242|               }
 3858|  42.6k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|   449k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 449k]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|   449k|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 449k]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|   449k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 309, False: 449k]
  |  Branch (3876:32): [True: 0, False: 449k]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|   449k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 119k, False: 330k]
  |  Branch (3885:53): [True: 31.7k, False: 87.8k]
  |  Branch (3885:94): [True: 9.64k, False: 22.1k]
  ------------------
 3886|  9.64k|               const auto after_colon = it + 1;
 3887|  9.64k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 7.19k, False: 2.45k]
  ------------------
 3888|  9.64k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 508, False: 9.14k]
  |  Branch (3888:43): [True: 6.73k, False: 2.41k]
  ------------------
 3889|  7.23k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 1.09k, False: 6.13k]
  ------------------
 3890|  1.09k|                  it = line_start;
 3891|  1.09k|                  return;
 3892|  1.09k|               }
 3893|  9.64k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|   448k|            int32_t effective_line_indent = line_indent;
 3897|   448k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 448k, False: 309]
  |  Branch (3897:36): [True: 261k, False: 186k]
  ------------------
 3898|   261k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 230k, False: 30.9k]
  ------------------
 3899|   230k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 179k, False: 51.5k]
  |  Branch (3899:52): [True: 22.6k, False: 156k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   208k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   208k|            }
 3912|       |
 3913|   448k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 25.3k, False: 423k]
  ------------------
 3914|  25.3k|               return;
 3915|  25.3k|            }
 3916|   423k|            first_key = false;
 3917|       |
 3918|   423k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 423k]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|       |               auto flow_end = it;
 3925|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|       |               if (bool(ctx.error)) [[unlikely]]
 3927|       |                  return;
 3928|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3929|       |                  it = flow_end;
 3930|       |                  return;
 3931|       |               }
 3932|       |            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|   423k|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 338k, False: 84.5k]
  ------------------
 3938|   338k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 159k, False: 179k]
  |  Branch (3938:34): [True: 2.99k, False: 176k]
  ------------------
 3939|   162k|                  auto peek = it;
 3940|   162k|                  skip_inline_ws(peek, end);
 3941|   162k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 161k, False: 694]
  |  Branch (3941:38): [True: 157k, False: 3.70k]
  |  Branch (3941:55): [True: 152k, False: 4.96k]
  |  Branch (3941:72): [True: 151k, False: 1.77k]
  ------------------
 3942|   151k|                     continue; // At leading indent of new line
 3943|   151k|                  }
 3944|   162k|               }
 3945|   187k|               skip_inline_ws(it, end);
 3946|   187k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 186k, False: 694]
  |  Branch (3946:33): [True: 9.59k, False: 177k]
  ------------------
 3947|  9.59k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  9.59k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 9.59k, False: 0]
  ------------------
 3949|  9.59k|                        const char prev = *(it - 1);
 3950|  9.59k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 4.35k, False: 5.23k]
  |  Branch (3950:44): [True: 3.35k, False: 1.00k]
  |  Branch (3950:60): [True: 2.33k, False: 1.02k]
  |  Branch (3950:76): [True: 8, False: 2.32k]
  ------------------
 3951|      8|                           ctx.error = error_code::syntax_error;
 3952|      8|                           return;
 3953|      8|                        }
 3954|  9.59k|                     }
 3955|  9.59k|                  }
 3956|  9.59k|               }
 3957|  9.58k|               skip_comment(it, end);
 3958|   187k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 186k, False: 1.09k]
  |  Branch (3958:34): [True: 76.3k, False: 110k]
  |  Branch (3958:49): [True: 54.7k, False: 55.4k]
  ------------------
 3959|   131k|                  skip_newline(it, end);
 3960|   131k|               }
 3961|  56.5k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 55.4k, False: 1.09k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|  55.4k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|  55.4k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 275, False: 55.1k]
  ------------------
 3968|    275|                        ctx.error = error_code::syntax_error;
 3969|    275|                        return;
 3970|    275|                     }
 3971|  55.4k|                  }
 3972|  55.4k|               }
 3973|   187k|            }
 3974|   423k|         }
 3975|   262k|      }
_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:
 4882|   448k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   448k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   448k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   448k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   448k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   448k|                           if (ctx.stream_begin) {
 4893|   448k|                              auto is_line_content_start = [&](auto pos) {
 4894|   448k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   448k|                              };
 4896|       |
 4897|   448k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   448k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   448k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   448k|                                 return line != end && *line == ':';
 4901|   448k|                              };
 4902|       |
 4903|   448k|                              if (!is_line_content_start(it) &&
 4904|   448k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   448k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   448k|                                 ctx.error = error_code::syntax_error;
 4907|   448k|                                 return false;
 4908|   448k|                              }
 4909|   448k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   448k|                           }
 4911|   448k|                        }
 4912|       |
 4913|   448k|                        if (*it == '-' &&
 4914|   448k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   448k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   448k|                           ctx.error = error_code::syntax_error;
 4918|   448k|                           return false;
 4919|   448k|                        }
 4920|       |
 4921|   448k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   448k|                           return false;
 4923|   448k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   448k|                        ctx.pop_indent();
 4925|   448k|                     }
 4926|   448k|                     else {
 4927|   448k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   448k|                        if (nested_indent >= 0) {
 4929|   448k|                           yaml::skip_to_content(it, end);
 4930|   448k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   448k|                              ctx.error = error_code::syntax_error;
 4932|   448k|                              return false;
 4933|   448k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   448k|                           const int32_t value_indent =
 4937|   448k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   448k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   448k|                              return false;
 4940|   448k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   448k|                           ctx.pop_indent();
 4942|   448k|                        }
 4943|   448k|                     }
 4944|   448k|                     return !bool(ctx.error);
 4945|   448k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   448k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 112k, False: 335k]
  |  Branch (4950:37): [True: 112k, False: 499]
  |  Branch (4950:58): [True: 3, False: 112k]
  ------------------
 4951|      3|                     ctx.error = error_code::syntax_error;
 4952|      3|                     return false;
 4953|      3|                  }
 4954|   448k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 112k, False: 335k]
  |  Branch (4954:38): [True: 499, False: 112k]
  |  Branch (4954:57): [True: 43.7k, False: 68.3k]
  |  Branch (4954:77): [True: 39.6k, False: 28.6k]
  |  Branch (4954:98): [True: 25.2k, False: 3.41k]
  ------------------
 4955|   109k|                     ++it; // skip '?'
 4956|   109k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   109k|                     const int32_t explicit_value_indicator_indent =
 4959|   109k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 36.9k, False: 72.2k]
  ------------------
 4960|       |
 4961|   109k|                     key_t key{};
 4962|   109k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   109k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   109k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   109k|                        };
 4966|       |
 4967|   109k|                        auto key_it = it;
 4968|   109k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   109k|                        auto content = key_it;
 4971|   109k|                        yaml::skip_to_content(content, end);
 4972|   109k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   109k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 105k, False: 3.20k]
  |  Branch (4977:47): [True: 19.8k, False: 86.1k]
  ------------------
 4978|  19.8k|                           auto anchor_probe = content + 1;
 4979|  19.8k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  19.8k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 19.7k, False: 24]
  ------------------
 4981|  19.7k|                              auto after_anchor = anchor_probe;
 4982|  19.7k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  19.7k|                              auto value_indicator = after_anchor;
 4985|  19.7k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 19.2k, False: 548]
  |  Branch (4985:61): [True: 2.25k, False: 16.9k]
  ------------------
 4986|  2.25k|                                 key.clear();
 4987|  2.25k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  2.25k|                                 it = value_indicator;
 4989|  2.25k|                                 handled_anchor_only_empty_key = true;
 4990|  2.25k|                              }
 4991|  17.5k|                              else {
 4992|  17.5k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 16.9k, False: 548]
  |  Branch (4992:64): [True: 936, False: 16.0k]
  ------------------
 4993|    936|                                    yaml::skip_comment(value_indicator, end);
 4994|    936|                                 }
 4995|  17.5k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 16.7k, False: 834]
  |  Branch (4995:65): [True: 2.92k, False: 13.7k]
  |  Branch (4995:93): [True: 3.33k, False: 10.4k]
  ------------------
 4996|  6.26k|                                    yaml::skip_newline(value_indicator, end);
 4997|  6.26k|                                    auto value_line = value_indicator;
 4998|  6.26k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  6.26k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 2, False: 6.26k]
  ------------------
 5000|      2|                                       return false;
 5001|  6.26k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 5.46k, False: 800]
  |  Branch (5001:62): [True: 964, False: 4.49k]
  ------------------
 5002|    964|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 954, False: 10]
  ------------------
 5003|    954|                                       key.clear();
 5004|    954|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|    954|                                       it = value_line;
 5006|    954|                                       handled_anchor_only_empty_key = true;
 5007|    954|                                    }
 5008|  5.30k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 4.50k, False: 800]
  |  Branch (5008:67): [True: 10, False: 4.49k]
  ------------------
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|     10|                                       ctx.error = error_code::syntax_error;
 5013|     10|                                       return false;
 5014|     10|                                    }
 5015|  6.26k|                                 }
 5016|  17.5k|                              }
 5017|  19.7k|                           }
 5018|  19.8k|                        }
 5019|       |
 5020|   109k|                        const bool key_content_spans_lines = [&] {
 5021|   109k|                           auto scan = key_it;
 5022|   109k|                           while (scan != content && scan != end) {
 5023|   109k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   109k|                              ++scan;
 5025|   109k|                           }
 5026|   109k|                           return false;
 5027|   109k|                        }();
 5028|       |
 5029|   109k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 3.20k, False: 105k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  3.20k|                        }
 5032|   105k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 3.20k, False: 102k]
  |  Branch (5032:53): [True: 4.56k, False: 98.2k]
  |  Branch (5032:72): [True: 3.59k, False: 965]
  ------------------
 5033|  6.79k|                           key.clear();
 5034|  6.79k|                           it = content;
 5035|  6.79k|                        }
 5036|  99.1k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|  99.1k|                           auto key_node_it = content;
 5042|  99.1k|                           auto key_node_end = end;
 5043|  99.1k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|  99.1k|                              auto scan = content;
 5048|  16.5M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 16.4M, False: 57.8k]
  ------------------
 5049|   190M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 190M, False: 25.5k]
  |  Branch (5049:56): [True: 186M, False: 4.16M]
  |  Branch (5049:73): [True: 173M, False: 12.2M]
  ------------------
 5050|   173M|                                    ++scan;
 5051|   173M|                                 }
 5052|  16.4M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 25.5k, False: 16.4M]
  ------------------
 5053|  25.5k|                                    break;
 5054|  25.5k|                                 }
 5055|       |
 5056|  16.4M|                                 yaml::skip_newline(scan, end);
 5057|  16.4M|                                 auto line_start = scan;
 5058|       |
 5059|  16.4M|                                 int32_t indicator_indent = 0;
 5060|  18.5M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 18.4M, False: 57.8k]
  |  Branch (5060:56): [True: 2.10M, False: 16.3M]
  ------------------
 5061|  2.10M|                                    ++indicator_indent;
 5062|  2.10M|                                    ++scan;
 5063|  2.10M|                                 }
 5064|       |
 5065|  16.4M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 16.3M, False: 57.8k]
  |  Branch (5065:53): [True: 203k, False: 16.1M]
  ------------------
 5066|   203k|                                    const auto after_colon = scan + 1;
 5067|   203k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 496, False: 202k]
  ------------------
 5068|   202k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 141k, False: 60.6k]
  ------------------
 5069|   142k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 15.7k, False: 126k]
  ------------------
 5070|  15.7k|                                       key_node_end = line_start;
 5071|  15.7k|                                       break;
 5072|  15.7k|                                    }
 5073|   203k|                                 }
 5074|  16.4M|                              }
 5075|  99.1k|                           }
 5076|       |
 5077|  99.1k|                           glz::generic key_node{};
 5078|  99.1k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|  99.1k|                           ctx.explicit_mapping_key_context = true;
 5080|  99.1k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|  99.1k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|  99.1k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 4.05k, False: 95.1k]
  ------------------
 5083|  4.05k|                              return false;
 5084|  95.1k|                           it = key_node_it;
 5085|  95.1k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 58, False: 95.0k]
  ------------------
 5086|     58|                              return false;
 5087|  95.1k|                        }
 5088|       |                     }
 5089|       |                     else {
 5090|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|       |                           if (bool(ctx.error)) [[unlikely]]
 5093|       |                              return false;
 5094|       |                        }
 5095|       |                     }
 5096|       |
 5097|   105k|                     yaml::skip_inline_ws(it, end);
 5098|   109k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   109k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 75.3k, False: 33.8k]
  |  Branch (5101:40): [True: 19.4k, False: 55.8k]
  |  Branch (5101:55): [True: 23.1k, False: 32.7k]
  ------------------
 5102|  42.6k|                        auto probe = it;
 5103|  42.6k|                        bool found_value_indicator = false;
 5104|       |
 5105|  70.3k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 56.0k, False: 14.3k]
  |  Branch (5105:49): [True: 23.0k, False: 33.0k]
  |  Branch (5105:67): [True: 33.0k, False: 5]
  ------------------
 5106|  56.0k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|  56.0k|                           auto value_line = probe;
 5109|  56.0k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|  56.0k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 4, False: 56.0k]
  ------------------
 5111|      4|                              return false;
 5112|       |
 5113|  56.0k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 14.1k, False: 41.8k]
  |  Branch (5113:53): [True: 1.71k, False: 40.1k]
  |  Branch (5113:76): [True: 8.62k, False: 31.4k]
  ------------------
 5114|  24.5k|                              probe = value_line;
 5115|  24.5k|                              continue; // blank line
 5116|  24.5k|                           }
 5117|  31.4k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 3.22k, False: 28.2k]
  ------------------
 5118|  3.22k|                              yaml::skip_comment(value_line, end);
 5119|  3.22k|                              probe = value_line;
 5120|  3.22k|                              continue; // comment-only line
 5121|  3.22k|                           }
 5122|  28.2k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 5.75k, False: 22.5k]
  |  Branch (5122:54): [True: 1.97k, False: 3.78k]
  ------------------
 5123|  1.97k|                              it = value_line;
 5124|  1.97k|                              found_value_indicator = true;
 5125|  1.97k|                           }
 5126|  28.2k|                           break;
 5127|  31.4k|                        }
 5128|       |
 5129|  42.6k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 1.97k, False: 40.6k]
  ------------------
 5130|  1.97k|                           yaml::skip_inline_ws(it, end);
 5131|  1.97k|                        }
 5132|  42.6k|                     }
 5133|       |
 5134|   109k|                     val_t val{};
 5135|   109k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 75.3k, False: 33.8k]
  |  Branch (5135:39): [True: 26.7k, False: 48.5k]
  ------------------
 5136|  26.7k|                        ++it;
 5137|  26.7k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 26.4k, False: 285]
  |  Branch (5137:42): [True: 5, False: 26.4k]
  ------------------
 5138|      5|                           ctx.error = error_code::syntax_error;
 5139|      5|                           return false;
 5140|      5|                        }
 5141|  26.7k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 26.4k, False: 285]
  |  Branch (5141:43): [True: 2.20k, False: 24.2k]
  |  Branch (5141:58): [True: 2.72k, False: 21.5k]
  ------------------
 5142|  4.92k|                           auto probe = it;
 5143|  4.92k|                           yaml::skip_newline(probe, end);
 5144|  51.0k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 49.4k, False: 1.52k]
  |  Branch (5144:51): [True: 46.0k, False: 3.40k]
  ------------------
 5145|  4.92k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 3.40k, False: 1.52k]
  |  Branch (5145:48): [True: 569, False: 2.83k]
  |  Branch (5145:65): [True: 466, False: 103]
  |  Branch (5145:89): [True: 2, False: 464]
  ------------------
 5146|      2|                              ctx.error = error_code::syntax_error;
 5147|      2|                              return false;
 5148|      2|                           }
 5149|  4.92k|                        }
 5150|  26.7k|                        yaml::skip_inline_ws(it, end);
 5151|  26.7k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 326, False: 26.4k]
  ------------------
 5152|    326|                           return false;
 5153|  26.7k|                     }
 5154|       |
 5155|   108k|                     value.emplace(std::move(key), std::move(val));
 5156|   108k|                     return true;
 5157|   109k|                  }
 5158|       |
 5159|   339k|                  key_t key{};
 5160|   339k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   339k|                     auto key_probe = it;
 5162|   339k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   339k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 339k, False: 0]
  |  Branch (5163:74): [True: 1.67k, False: 337k]
  |  Branch (5163:95): [True: 745, False: 336k]
  ------------------
 5164|   339k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 2.42k, False: 336k]
  ------------------
 5165|  2.42k|                        glz::generic key_node{};
 5166|  2.42k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  2.42k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 612, False: 1.81k]
  ------------------
 5168|    612|                           return false;
 5169|  1.81k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 2, False: 1.81k]
  ------------------
 5170|      2|                           return false;
 5171|  1.81k|                     }
 5172|   336k|                     else {
 5173|   336k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 1.93k, False: 334k]
  ------------------
 5174|  1.93k|                           return false;
 5175|  1.93k|                        }
 5176|   336k|                     }
 5177|       |                  }
 5178|       |                  else {
 5179|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|       |                     if (bool(ctx.error)) [[unlikely]]
 5181|       |                        return false;
 5182|       |                  }
 5183|       |
 5184|   336k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   339k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 3.33k, False: 335k]
  |  Branch (5186:36): [True: 859, False: 335k]
  ------------------
 5187|  1.65k|                     ctx.error = error_code::syntax_error;
 5188|  1.65k|                     return false;
 5189|  1.65k|                  }
 5190|   337k|                  ++it;
 5191|   337k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   337k|                  val_t val{};
 5194|   337k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 16.7k, False: 320k]
  ------------------
 5195|  16.7k|                     return false;
 5196|       |
 5197|   320k|                  value.emplace(std::move(key), std::move(val));
 5198|   320k|                  return true;
 5199|   337k|               });
_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:
 5020|   109k|                        const bool key_content_spans_lines = [&] {
 5021|   109k|                           auto scan = key_it;
 5022|   115k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 73.1k, False: 42.4k]
  |  Branch (5022:54): [True: 73.1k, False: 0]
  ------------------
 5023|  73.1k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 40.1k, False: 33.0k]
  |  Branch (5023:52): [True: 26.6k, False: 6.43k]
  ------------------
 5024|  6.43k|                              ++scan;
 5025|  6.43k|                           }
 5026|  42.4k|                           return false;
 5027|   109k|                        }();
_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_:
 4963|  95.1k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|  95.1k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|  95.1k|                        };
_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_:
 4883|   361k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   361k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 352k, False: 9.75k]
  |  Branch (4884:39): [True: 258k, False: 93.4k]
  ------------------
 4885|   258k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   258k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   258k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 258k, False: 0]
  ------------------
 4893|   258k|                              auto is_line_content_start = [&](auto pos) {
 4894|   258k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   258k|                              };
 4896|       |
 4897|   258k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   258k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   258k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   258k|                                 return line != end && *line == ':';
 4901|   258k|                              };
 4902|       |
 4903|   258k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 258k, False: 0]
  ------------------
 4904|   258k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 37.8k, False: 220k]
  ------------------
 4905|  37.8k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 406, False: 37.4k]
  ------------------
 4906|    406|                                 ctx.error = error_code::syntax_error;
 4907|    406|                                 return false;
 4908|    406|                              }
 4909|   258k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   258k|                           }
 4911|   258k|                        }
 4912|       |
 4913|   258k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 3.62k, False: 254k]
  ------------------
 4914|  3.62k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 280, False: 3.34k]
  |  Branch (4914:49): [True: 689, False: 2.65k]
  ------------------
 4915|    969|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 13, False: 956]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     13|                           ctx.error = error_code::syntax_error;
 4918|     13|                           return false;
 4919|     13|                        }
 4920|       |
 4921|   258k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 258k]
  ------------------
 4922|      0|                           return false;
 4923|   258k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   258k|                        ctx.pop_indent();
 4925|   258k|                     }
 4926|   103k|                     else {
 4927|   103k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   103k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 42.1k, False: 61.0k]
  ------------------
 4929|  42.1k|                           yaml::skip_to_content(it, end);
 4930|  42.1k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 42.1k, False: 0]
  |  Branch (4930:45): [True: 0, False: 42.1k]
  |  Branch (4930:59): [True: 0, False: 0]
  |  Branch (4930:78): [True: 0, False: 0]
  ------------------
 4931|      0|                              ctx.error = error_code::syntax_error;
 4932|      0|                              return false;
 4933|      0|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  42.1k|                           const int32_t value_indent =
 4937|  42.1k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 42.1k]
  ------------------
 4938|  42.1k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 42.1k]
  ------------------
 4939|      0|                              return false;
 4940|  42.1k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  42.1k|                           ctx.pop_indent();
 4942|  42.1k|                        }
 4943|   103k|                     }
 4944|   361k|                     return !bool(ctx.error);
 4945|   361k|                  };
_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_:
 4893|   258k|                              auto is_line_content_start = [&](auto pos) {
 4894|   258k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   258k|                              };
_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_:
 4897|   296k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   296k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   994k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 994k, False: 0]
  |  Branch (4899:57): [True: 697k, False: 296k]
  |  Branch (4899:73): [True: 488, False: 296k]
  ------------------
 4900|   296k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 296k, False: 0]
  |  Branch (4900:56): [True: 207k, False: 88.1k]
  ------------------
 4901|   296k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|   287k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   287k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 287k]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|   287k|            }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE10redispatchITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 6717|  85.1k|      {
 6718|  85.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|  85.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 3, False: 85.1k]
  ------------------
 6720|      3|            return;
 6721|  85.1k|         op<Opts>(value, ctx, it, end);
 6722|  85.1k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  89.2k|      {
  301|  89.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 89.2k]
  |  Branch (301:27): [True: 0, False: 89.2k]
  ------------------
  302|       |
  303|  89.2k|         ++it; // skip '*'
  304|  89.2k|         auto name = parse_anchor_name(it, end);
  305|  89.2k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 202, False: 88.9k]
  ------------------
  306|    202|            ctx.error = error_code::syntax_error;
  307|    202|            return true;
  308|    202|         }
  309|       |
  310|  88.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  88.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 474, False: 88.5k]
  ------------------
  312|    474|            ctx.error = error_code::syntax_error; // undefined alias
  313|    474|            return true;
  314|    474|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  88.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  88.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.75k, False: 86.7k]
  ------------------
  322|  1.75k|            return true;
  323|  1.75k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  86.7k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 57, False: 86.7k]
  ------------------
  329|     57|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     57|            return true;
  331|     57|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  86.7k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  86.7k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 86.7k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  86.7k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 8, False: 86.6k]
  ------------------
  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|  86.6k|         auto replay_it = span.begin;
  348|  86.6k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  86.6k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  86.6k|         ctx.indent_stack.clear();
  353|  86.6k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 52.8k, False: 33.8k]
  ------------------
  354|  52.8k|            ctx.push_indent(span.base_indent - 1);
  355|  52.8k|         }
  356|       |
  357|  86.6k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  86.6k|         using V = std::remove_cvref_t<T>;
  360|  86.6k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  86.6k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  86.6k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  86.6k|         return true;
  367|  86.7k|      }
_ZN3glz4yaml15skip_to_contentIPKcS3_EEvRT_T0_:
 3637|  3.04M|      {
 3638|  5.18M|         while (it != end) {
  ------------------
  |  Branch (3638:17): [True: 5.10M, False: 78.7k]
  ------------------
 3639|  5.10M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3639:17): [True: 1.20M, False: 3.89M]
  |  Branch (3639:32): [True: 742k, False: 3.15M]
  ------------------
 3640|  1.95M|               skip_newline(it, end);
 3641|  1.95M|            }
 3642|  3.15M|            else if (*it == '#') {
  ------------------
  |  Branch (3642:22): [True: 68.7k, False: 3.08M]
  ------------------
 3643|  68.7k|               skip_comment(it, end);
 3644|  68.7k|            }
 3645|  3.08M|            else if (*it == ' ') {
  ------------------
  |  Branch (3645:22): [True: 1.02M, False: 2.05M]
  ------------------
 3646|  1.02M|               auto line_start = it;
 3647|  5.49M|               while (it != end && *it == ' ') ++it;
  ------------------
  |  Branch (3647:23): [True: 5.48M, False: 14.1k]
  |  Branch (3647:36): [True: 4.46M, False: 1.01M]
  ------------------
 3648|  1.02M|               if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3648:20): [True: 14.1k, False: 1.01M]
  |  Branch (3648:33): [True: 28.0k, False: 987k]
  |  Branch (3648:48): [True: 25.9k, False: 961k]
  ------------------
 3649|  68.1k|                  continue; // blank line with trailing spaces
 3650|  68.1k|               }
 3651|   961k|               if (*it == '#') {
  ------------------
  |  Branch (3651:20): [True: 53.0k, False: 908k]
  ------------------
 3652|  53.0k|                  skip_comment(it, end);
 3653|  53.0k|                  continue; // comment-only line
 3654|  53.0k|               }
 3655|   908k|               it = line_start; // content found, restore to start of indent
 3656|   908k|               return;
 3657|   961k|            }
 3658|  2.05M|            else {
 3659|  2.05M|               return; // content at column 0
 3660|  2.05M|            }
 3661|  5.10M|         }
 3662|  3.04M|      }
_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_:
 5310|   123k|      {
 5311|   123k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   123k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   123k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   123k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   123k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 123k, False: 0]
  ------------------
 5321|   123k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   123k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   127k|      {
 1961|   127k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 8.70k, False: 118k]
  ------------------
 1962|  8.70k|            return;
 1963|       |
 1964|   118k|         yaml::node_preamble_state preamble{};
 1965|   118k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 4.55k, False: 113k]
  ------------------
 1966|   118k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  4.55k|            return;
 1968|       |
 1969|   113k|         std::string str;
 1970|   113k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   113k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 113k, False: 0]
  ------------------
 1973|    769|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 769, False: 113k]
  ------------------
 1974|    769|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|    769|            break;
 1976|    687|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 687, False: 113k]
  ------------------
 1977|    687|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|    687|            break;
 1979|    380|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 380, False: 113k]
  ------------------
 1980|  1.59k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 1.21k, False: 112k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  1.59k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  1.59k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 612, False: 984]
  ------------------
 1986|  1.59k|            break;
 1987|   110k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 110k, False: 3.05k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   110k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   110k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 94.6k, False: 16.2k]
  ------------------
 1992|  94.6k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|  94.6k|               }
 1994|  16.2k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|  16.2k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|  16.2k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   110k|            break;
 2003|   113k|         }
 2004|       |
 2005|   113k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 112k, False: 1.09k]
  ------------------
 2006|   112k|            value = std::move(str);
 2007|   112k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   112k|         }
 2009|   113k|      }
_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|   118k|      {
  466|   118k|         skip_inline_ws(it, end);
  467|       |
  468|   118k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 17, False: 118k]
  ------------------
  469|     17|            if constexpr (!AllowEmptyInput) {
  470|     17|               ctx.error = error_code::unexpected_end;
  471|     17|            }
  472|     17|            return true;
  473|     17|         }
  474|       |
  475|   118k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   118k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 16, False: 118k]
  ------------------
  477|     16|            ctx.error = error_code::syntax_error;
  478|     16|            return true;
  479|     16|         }
  480|   118k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 4, False: 118k]
  ------------------
  481|      4|            ctx.error = error_code::syntax_error;
  482|      4|            return true;
  483|      4|         }
  484|       |
  485|   118k|         skip_inline_ws(it, end);
  486|       |
  487|   118k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 118k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   118k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.51k, False: 113k]
  ------------------
  495|  4.51k|            return true;
  496|  4.51k|         }
  497|       |
  498|   113k|         return false;
  499|   118k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   118k|                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|   118k|      {
  409|   118k|         state.has_anchor = false;
  410|   118k|         state.anchor_name.clear();
  411|   118k|         state.anchor_start = nullptr;
  412|   118k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   118k|         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|   118k|            else {
  421|   118k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.44k, False: 113k]
  ------------------
  422|   118k|            }
  423|   118k|         }
  424|       |
  425|   118k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 113k, False: 4.44k]
  |  Branch (425:27): [True: 5.99k, False: 107k]
  ------------------
  426|  5.99k|            ++it;
  427|  5.99k|            auto name = parse_anchor_name(it, end);
  428|  5.99k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 15, False: 5.97k]
  ------------------
  429|     15|               ctx.error = error_code::syntax_error;
  430|     15|               return true;
  431|     15|            }
  432|  5.97k|            skip_inline_ws(it, end);
  433|  5.97k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 52, False: 5.92k]
  ------------------
  434|     52|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     52|                  ctx.error = error_code::unexpected_end;
  436|     52|               }
  437|     52|               return true;
  438|     52|            }
  439|  5.92k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  5.92k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 2, False: 5.92k]
  ------------------
  441|      2|                  ctx.error = error_code::syntax_error;
  442|      2|                  return true;
  443|      2|               }
  444|  5.92k|            }
  445|  5.92k|            state.has_anchor = true;
  446|  5.92k|            state.anchor_name = std::string(name);
  447|  5.92k|            state.anchor_start = &*it;
  448|  5.92k|         }
  449|       |
  450|   118k|         return false;
  451|   118k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   118k|      {
  301|   118k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 118k]
  |  Branch (301:27): [True: 113k, False: 4.44k]
  ------------------
  302|       |
  303|  4.44k|         ++it; // skip '*'
  304|  4.44k|         auto name = parse_anchor_name(it, end);
  305|  4.44k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 11, False: 4.43k]
  ------------------
  306|     11|            ctx.error = error_code::syntax_error;
  307|     11|            return true;
  308|     11|         }
  309|       |
  310|  4.43k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.43k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 23, False: 4.40k]
  ------------------
  312|     23|            ctx.error = error_code::syntax_error; // undefined alias
  313|     23|            return true;
  314|     23|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  4.40k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  4.40k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 405, False: 4.00k]
  ------------------
  322|    405|            return true;
  323|    405|         }
  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.00k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 17, False: 3.98k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  3.98k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.98k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 3.98k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  3.98k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.98k]
  ------------------
  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.98k|         auto replay_it = span.begin;
  348|  3.98k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.98k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.98k|         ctx.indent_stack.clear();
  353|  3.98k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.40k, False: 575]
  ------------------
  354|  3.40k|            ctx.push_indent(span.base_indent - 1);
  355|  3.40k|         }
  356|       |
  357|  3.98k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.98k|         using V = std::remove_cvref_t<T>;
  360|  3.98k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.98k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.98k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.98k|         return true;
  367|  3.98k|      }
_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_:
 5310|  32.7k|      {
 5311|  32.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  32.7k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  32.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  32.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  32.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 32.7k, False: 0]
  ------------------
 5321|  32.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  32.7k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|  34.3k|      {
 2116|  34.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 34.3k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  34.3k|         yaml::node_preamble_state preamble{};
 2120|  34.3k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 5.07k, False: 29.2k]
  ------------------
 2121|  34.3k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  34.3k|                   return yaml::tag_valid_for_float(tag);
 2123|  34.3k|                }
 2124|  34.3k|                else {
 2125|  34.3k|                   return yaml::tag_valid_for_int(tag);
 2126|  34.3k|                }
 2127|  34.3k|             }))
 2128|  5.07k|            return;
 2129|       |
 2130|  29.2k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  29.2k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  29.2k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  29.2k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 8.58k, False: 20.6k]
  ------------------
 2138|  8.58k|               ++it;
 2139|  8.58k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 8.10k, False: 481]
  |  Branch (2139:38): [True: 1.26k, False: 6.83k]
  |  Branch (2139:74): [True: 262, False: 6.57k]
  ------------------
 2140|  6.57k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 290, False: 6.28k]
  ------------------
 2141|  1.82k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  1.82k|                  it += 3;
 2143|  1.82k|                  finalize();
 2144|  1.82k|                  return;
 2145|  1.82k|               }
 2146|  6.76k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 6.28k, False: 481]
  |  Branch (2146:38): [True: 1.57k, False: 4.70k]
  |  Branch (2146:74): [True: 218, False: 4.48k]
  ------------------
 2147|  4.48k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 259, False: 4.22k]
  ------------------
 2148|  2.05k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  2.05k|                  it += 3;
 2150|  2.05k|                  finalize();
 2151|  2.05k|                  return;
 2152|  2.05k|               }
 2153|  4.70k|               it = start;
 2154|  4.70k|            }
 2155|       |
 2156|  25.3k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 2.11k, False: 23.2k]
  |  Branch (2156:31): [True: 2.96k, False: 20.2k]
  ------------------
 2157|  5.07k|               const char sign = *it;
 2158|  5.07k|               ++it;
 2159|  5.07k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 4.79k, False: 276]
  |  Branch (2159:33): [True: 1.81k, False: 2.98k]
  ------------------
 2160|  1.81k|                  ++it;
 2161|  1.81k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 1.41k, False: 400]
  |  Branch (2161:41): [True: 330, False: 1.08k]
  |  Branch (2161:77): [True: 388, False: 698]
  ------------------
 2162|    847|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 129, False: 569]
  ------------------
 2163|    847|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 434, False: 413]
  ------------------
 2164|    434|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|    434|                     }
 2166|    413|                     else {
 2167|    413|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    413|                     }
 2169|    847|                     it += 3;
 2170|    847|                     finalize();
 2171|    847|                     return;
 2172|    847|                  }
 2173|  1.81k|               }
 2174|  4.22k|               it = start;
 2175|  4.22k|            }
 2176|  25.3k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  24.5k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  22.0M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 22.0M, False: 8.66k]
  ------------------
 2183|  22.0M|            const char c = *it;
 2184|  22.0M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 7.37k, False: 22.0M]
  |  Branch (2184:29): [True: 1.06k, False: 22.0M]
  |  Branch (2184:42): [True: 2.13k, False: 22.0M]
  |  Branch (2184:55): [True: 1.73k, False: 22.0M]
  |  Branch (2184:68): [True: 1.52k, False: 22.0M]
  |  Branch (2184:80): [True: 801, False: 22.0M]
  |  Branch (2184:92): [True: 569, False: 22.0M]
  |  Branch (2184:104): [True: 2.10k, False: 22.0M]
  ------------------
 2185|  17.3k|               break;
 2186|  17.3k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  22.0M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 9.27k, False: 22.0M]
  ------------------
 2189|  9.27k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 488, False: 8.78k]
  |  Branch (2189:39): [True: 1.75k, False: 7.02k]
  |  Branch (2189:59): [True: 148, False: 6.87k]
  |  Branch (2189:80): [True: 552, False: 6.32k]
  |  Branch (2189:101): [True: 314, False: 6.01k]
  ------------------
 2190|  3.26k|                  break;
 2191|  3.26k|               }
 2192|  9.27k|            }
 2193|  22.0M|            ++it;
 2194|  22.0M|         }
 2195|       |
 2196|  29.2k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  29.2k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 1.68k, False: 27.5k]
  ------------------
 2199|  1.68k|            ctx.error = error_code::parse_number_failure;
 2200|  1.68k|            return;
 2201|  1.68k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  27.5k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  27.5k|            bool negative = false;
 2254|  27.5k|            std::string_view digits = num_str;
 2255|       |
 2256|  27.5k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 22.8k, False: 4.72k]
  |  Branch (2256:37): [True: 2.54k, False: 20.2k]
  |  Branch (2256:62): [True: 1.67k, False: 18.6k]
  ------------------
 2257|  4.22k|               negative = (digits.front() == '-');
 2258|  4.22k|               digits.remove_prefix(1);
 2259|  4.22k|            }
 2260|       |
 2261|  27.5k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 16.4k, False: 11.1k]
  |  Branch (2261:38): [True: 7.19k, False: 9.26k]
  ------------------
 2262|  7.19k|               int base = 10;
 2263|  7.19k|               size_t offset = 0;
 2264|       |
 2265|  7.19k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 4.82k, False: 2.36k]
  |  Branch (2265:40): [True: 304, False: 2.05k]
  ------------------
 2266|  5.13k|                  base = 16;
 2267|  5.13k|                  offset = 2;
 2268|  5.13k|               }
 2269|  2.05k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 313, False: 1.74k]
  |  Branch (2269:45): [True: 318, False: 1.42k]
  ------------------
 2270|    631|                  base = 8;
 2271|    631|                  offset = 2;
 2272|    631|               }
 2273|  1.42k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 278, False: 1.14k]
  |  Branch (2273:45): [True: 100, False: 1.04k]
  ------------------
 2274|    378|                  base = 2;
 2275|    378|                  offset = 2;
 2276|    378|               }
 2277|       |
 2278|  7.19k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 6.14k, False: 1.04k]
  ------------------
 2279|  6.14k|                  auto raw_digits = digits.substr(offset);
 2280|  6.14k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  6.14k|                  std::string clean_storage;
 2283|  6.14k|                  std::string_view clean_view;
 2284|  6.14k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 3.19k, False: 2.94k]
  ------------------
 2285|  3.19k|                     clean_storage.reserve(raw_digits.size());
 2286|  2.36M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 2.36M, False: 3.19k]
  ------------------
 2287|  2.36M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 2.35M, False: 5.19k]
  ------------------
 2288|  2.35M|                           clean_storage.push_back(c);
 2289|  2.35M|                        }
 2290|  2.36M|                     }
 2291|  3.19k|                     clean_view = clean_storage;
 2292|  3.19k|                  }
 2293|  2.94k|                  else {
 2294|  2.94k|                     clean_view = raw_digits;
 2295|  2.94k|                  }
 2296|       |
 2297|  6.14k|                  uint64_t parsed_int{};
 2298|  6.14k|                  auto [ptr, ec] =
 2299|  6.14k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  6.14k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 1.59k, False: 4.54k]
  |  Branch (2300:44): [True: 3.89k, False: 650]
  ------------------
 2301|  5.49k|                     ctx.error = error_code::parse_number_failure;
 2302|  5.49k|                     finalize();
 2303|  5.49k|                     return;
 2304|  5.49k|                  }
 2305|       |
 2306|    650|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|    650|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 274, False: 376]
  ------------------
 2308|    650|                  finalize();
 2309|    650|                  return;
 2310|  6.14k|               }
 2311|  7.19k|            }
 2312|  27.5k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  21.4k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  27.5k|         std::string clean_storage;
 2318|  27.5k|         std::string_view clean_view;
 2319|       |
 2320|  27.5k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 1.16k, False: 26.3k]
  ------------------
 2321|  1.16k|            clean_storage.reserve(num_str.size());
 2322|  8.88M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 8.88M, False: 1.16k]
  ------------------
 2323|  8.88M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 8.87M, False: 4.77k]
  ------------------
 2324|  8.87M|                  clean_storage.push_back(c);
 2325|  8.87M|               }
 2326|  8.88M|            }
 2327|  1.16k|            clean_view = clean_storage;
 2328|  1.16k|         }
 2329|  26.3k|         else {
 2330|  26.3k|            clean_view = num_str;
 2331|  26.3k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  27.5k|         auto parse_view = clean_view;
 2336|  27.5k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 16.5k, False: 10.9k]
  |  Branch (2336:37): [True: 2.54k, False: 14.0k]
  ------------------
 2337|  2.54k|            parse_view.remove_prefix(1);
 2338|  2.54k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 804, False: 1.74k]
  ------------------
 2339|    804|               ctx.error = error_code::parse_number_failure;
 2340|    804|               return;
 2341|    804|            }
 2342|  2.54k|         }
 2343|       |
 2344|  26.7k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  26.7k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  26.7k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 19.6k, False: 7.13k]
  |  Branch (2347:45): [True: 3.65k, False: 3.47k]
  ------------------
 2348|  12.4k|               ctx.error = error_code::parse_number_failure;
 2349|  12.4k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  26.7k|         finalize();
 2360|  26.7k|      }
_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|  34.3k|      {
  466|  34.3k|         skip_inline_ws(it, end);
  467|       |
  468|  34.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 253, False: 34.0k]
  ------------------
  469|    253|            if constexpr (!AllowEmptyInput) {
  470|    253|               ctx.error = error_code::unexpected_end;
  471|    253|            }
  472|    253|            return true;
  473|    253|         }
  474|       |
  475|  34.0k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  34.0k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 365, False: 33.7k]
  ------------------
  477|    365|            ctx.error = error_code::syntax_error;
  478|    365|            return true;
  479|    365|         }
  480|  33.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 216, False: 33.4k]
  ------------------
  481|    216|            ctx.error = error_code::syntax_error;
  482|    216|            return true;
  483|    216|         }
  484|       |
  485|  33.4k|         skip_inline_ws(it, end);
  486|       |
  487|  33.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 220, False: 33.2k]
  ------------------
  488|    220|            if constexpr (!AllowEmptyInput) {
  489|    220|               ctx.error = error_code::unexpected_end;
  490|    220|            }
  491|    220|            return true;
  492|    220|         }
  493|       |
  494|  33.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.02k, False: 29.2k]
  ------------------
  495|  4.02k|            return true;
  496|  4.02k|         }
  497|       |
  498|  29.2k|         return false;
  499|  33.2k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|  33.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  33.7k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  33.7k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  33.7k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  33.2k|      {
  409|  33.2k|         state.has_anchor = false;
  410|  33.2k|         state.anchor_name.clear();
  411|  33.2k|         state.anchor_start = nullptr;
  412|  33.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  33.2k|         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|  33.2k|            else {
  421|  33.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.48k, False: 29.7k]
  ------------------
  422|  33.2k|            }
  423|  33.2k|         }
  424|       |
  425|  33.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 29.7k, False: 3.48k]
  |  Branch (425:27): [True: 3.02k, False: 26.7k]
  ------------------
  426|  3.02k|            ++it;
  427|  3.02k|            auto name = parse_anchor_name(it, end);
  428|  3.02k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 291, False: 2.73k]
  ------------------
  429|    291|               ctx.error = error_code::syntax_error;
  430|    291|               return true;
  431|    291|            }
  432|  2.73k|            skip_inline_ws(it, end);
  433|  2.73k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 245, False: 2.49k]
  ------------------
  434|    245|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    245|                  ctx.error = error_code::unexpected_end;
  436|    245|               }
  437|    245|               return true;
  438|    245|            }
  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.49k|            state.has_anchor = true;
  446|  2.49k|            state.anchor_name = std::string(name);
  447|  2.49k|            state.anchor_start = &*it;
  448|  2.49k|         }
  449|       |
  450|  32.7k|         return false;
  451|  33.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  33.2k|      {
  301|  33.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 33.2k]
  |  Branch (301:27): [True: 29.7k, False: 3.48k]
  ------------------
  302|       |
  303|  3.48k|         ++it; // skip '*'
  304|  3.48k|         auto name = parse_anchor_name(it, end);
  305|  3.48k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 443, False: 3.04k]
  ------------------
  306|    443|            ctx.error = error_code::syntax_error;
  307|    443|            return true;
  308|    443|         }
  309|       |
  310|  3.04k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.04k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 936, False: 2.10k]
  ------------------
  312|    936|            ctx.error = error_code::syntax_error; // undefined alias
  313|    936|            return true;
  314|    936|         }
  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.10k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.10k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 399, False: 1.70k]
  ------------------
  322|    399|            return true;
  323|    399|         }
  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.70k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 129, False: 1.57k]
  ------------------
  329|    129|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    129|            return true;
  331|    129|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  1.57k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.57k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 1.57k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  1.57k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.57k]
  ------------------
  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.57k|         auto replay_it = span.begin;
  348|  1.57k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.57k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.57k|         ctx.indent_stack.clear();
  353|  1.57k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 509, False: 1.06k]
  ------------------
  354|    509|            ctx.push_indent(span.base_indent - 1);
  355|    509|         }
  356|       |
  357|  1.57k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.57k|         using V = std::remove_cvref_t<T>;
  360|  1.57k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.57k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.57k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.57k|         return true;
  367|  1.57k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  26.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_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|  21.7k|      {
 5311|  21.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  21.7k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  21.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  21.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  21.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 21.7k, False: 0]
  ------------------
 5321|  21.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  21.7k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  26.3k|      {
 2081|  26.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 26.3k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  26.3k|         yaml::node_preamble_state preamble{};
 2085|  26.3k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 5.57k, False: 20.7k]
  ------------------
 2086|  26.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  5.57k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  20.7k|         std::string str;
 2091|  20.7k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  20.7k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 7.98k, False: 12.7k]
  |  Branch (2093:31): [True: 1.96k, False: 10.8k]
  |  Branch (2093:48): [True: 669, False: 10.1k]
  |  Branch (2093:65): [True: 226, False: 9.92k]
  |  Branch (2093:81): [True: 369, False: 9.55k]
  |  Branch (2093:97): [True: 383, False: 9.17k]
  ------------------
 2094|  12.3k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 265, False: 8.90k]
  |  Branch (2094:29): [True: 131, False: 8.77k]
  |  Branch (2094:44): [True: 313, False: 8.46k]
  ------------------
 2095|  12.3k|            value = true;
 2096|  12.3k|         }
 2097|  8.46k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 1.30k, False: 7.16k]
  |  Branch (2097:37): [True: 3.95k, False: 3.20k]
  |  Branch (2097:55): [True: 728, False: 2.47k]
  |  Branch (2097:73): [True: 320, False: 2.15k]
  |  Branch (2097:88): [True: 1.01k, False: 1.14k]
  |  Branch (2097:103): [True: 265, False: 875]
  ------------------
 2098|  8.30k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 243, False: 632]
  |  Branch (2098:35): [True: 214, False: 418]
  |  Branch (2098:51): [True: 256, False: 162]
  ------------------
 2099|  8.30k|            value = false;
 2100|  8.30k|         }
 2101|    162|         else {
 2102|    162|            ctx.error = error_code::expected_true_or_false;
 2103|    162|         }
 2104|       |
 2105|  20.7k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  20.7k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  26.3k|      {
  466|  26.3k|         skip_inline_ws(it, end);
  467|       |
  468|  26.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 26.3k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|  26.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  26.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 26.3k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  26.3k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 26.3k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  26.3k|         skip_inline_ws(it, end);
  486|       |
  487|  26.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 26.3k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  26.3k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.55k, False: 20.7k]
  ------------------
  495|  5.55k|            return true;
  496|  5.55k|         }
  497|       |
  498|  20.7k|         return false;
  499|  26.3k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  26.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  26.3k|      {
  409|  26.3k|         state.has_anchor = false;
  410|  26.3k|         state.anchor_name.clear();
  411|  26.3k|         state.anchor_start = nullptr;
  412|  26.3k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  26.3k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  26.3k|            else {
  421|  26.3k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.53k, False: 20.7k]
  ------------------
  422|  26.3k|            }
  423|  26.3k|         }
  424|       |
  425|  26.3k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 20.7k, False: 5.53k]
  |  Branch (425:27): [True: 1.42k, False: 19.3k]
  ------------------
  426|  1.42k|            ++it;
  427|  1.42k|            auto name = parse_anchor_name(it, end);
  428|  1.42k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 1.42k]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|  1.42k|            skip_inline_ws(it, end);
  433|  1.42k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 1.40k]
  ------------------
  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|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.40k|            state.has_anchor = true;
  446|  1.40k|            state.anchor_name = std::string(name);
  447|  1.40k|            state.anchor_start = &*it;
  448|  1.40k|         }
  449|       |
  450|  26.3k|         return false;
  451|  26.3k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  26.3k|      {
  301|  26.3k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 26.3k]
  |  Branch (301:27): [True: 20.7k, False: 5.53k]
  ------------------
  302|       |
  303|  5.53k|         ++it; // skip '*'
  304|  5.53k|         auto name = parse_anchor_name(it, end);
  305|  5.53k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 15, False: 5.52k]
  ------------------
  306|     15|            ctx.error = error_code::syntax_error;
  307|     15|            return true;
  308|     15|         }
  309|       |
  310|  5.52k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.52k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 26, False: 5.49k]
  ------------------
  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|  5.49k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.49k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 931, False: 4.56k]
  ------------------
  322|    931|            return true;
  323|    931|         }
  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.56k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 4.56k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  4.56k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.56k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.56k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.56k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.56k]
  ------------------
  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.56k|         auto replay_it = span.begin;
  348|  4.56k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.56k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.56k|         ctx.indent_stack.clear();
  353|  4.56k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.58k, False: 2.97k]
  ------------------
  354|  1.58k|            ctx.push_indent(span.base_indent - 1);
  355|  1.58k|         }
  356|       |
  357|  4.56k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.56k|         using V = std::remove_cvref_t<T>;
  360|  4.56k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.56k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.56k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.56k|         return true;
  367|  4.56k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  11.3k|      {
 2467|  11.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 11.3k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  11.3k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  11.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 13, False: 11.3k]
  ------------------
 2473|     13|            ctx.error = error_code::unexpected_end;
 2474|     13|            return;
 2475|     13|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  11.3k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 1.37k, False: 9.93k]
  ------------------
 2479|  1.37k|            ++it;
 2480|  1.37k|            return;
 2481|  1.37k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  9.93k|         auto start = it;
 2485|  48.7k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 48.3k, False: 437]
  |  Branch (2485:30): [True: 38.8k, False: 9.49k]
  ------------------
 2486|  38.8k|            ++it;
 2487|  38.8k|         }
 2488|       |
 2489|  9.93k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  9.93k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 24, False: 9.90k]
  ------------------
 2491|     24|            ctx.error = error_code::syntax_error;
 2492|     24|         }
 2493|  9.93k|      }
_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_:
 5310|  72.8k|      {
 5311|  72.8k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  72.8k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  72.8k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  72.8k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  72.8k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 72.8k, False: 0]
  ------------------
 5321|  72.8k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  72.8k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|  75.5k|      {
 4183|  75.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 75.5k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|  75.5k|         auto peek = it;
 4188|  75.5k|         yaml::node_preamble_state preamble{};
 4189|  75.5k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 3.74k, False: 71.7k]
  ------------------
 4190|  75.5k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  3.74k|            it = peek;
 4192|  3.74k|            return;
 4193|  3.74k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|  71.7k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|  71.7k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 3, False: 71.7k]
  ------------------
 4198|      3|            return;
 4199|       |
 4200|  71.7k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 29.7k, False: 42.0k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  29.7k|            it = peek;
 4203|  29.7k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  29.7k|         }
 4205|  42.0k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 41.9k, False: 103]
  ------------------
 4206|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4207|       |            // But if there was a tag, we need to advance past it
 4208|  41.9k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 305, False: 41.6k]
  |  Branch (4208:57): [True: 788, False: 40.8k]
  ------------------
 4209|  1.09k|               it = peek;
 4210|  1.09k|            }
 4211|  41.9k|            int32_t seq_indent = ctx.current_indent();
 4212|  41.9k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 41.7k, False: 260]
  |  Branch (4212:31): [True: 30.0k, False: 11.6k]
  ------------------
 4213|  30.0k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 11.8k, False: 18.2k]
  |  Branch (4213:62): [True: 6.53k, False: 5.27k]
  ------------------
 4214|  30.0k|                                                          : (ctx.current_indent() + 1);
 4215|  30.0k|            }
 4216|  41.9k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|  41.9k|         }
 4218|    103|         else {
 4219|    103|            ctx.error = error_code::syntax_error;
 4220|    103|         }
 4221|       |
 4222|  71.7k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|  71.7k|      }
_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.5k|      {
  466|  75.5k|         skip_inline_ws(it, end);
  467|       |
  468|  75.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 75.5k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|  75.5k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  75.5k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 75.5k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  75.5k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 75.5k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  75.5k|         skip_inline_ws(it, end);
  486|       |
  487|  75.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 5, False: 75.5k]
  ------------------
  488|      5|            if constexpr (!AllowEmptyInput) {
  489|      5|               ctx.error = error_code::unexpected_end;
  490|      5|            }
  491|      5|            return true;
  492|      5|         }
  493|       |
  494|  75.5k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.71k, False: 71.7k]
  ------------------
  495|  3.71k|            return true;
  496|  3.71k|         }
  497|       |
  498|  71.7k|         return false;
  499|  75.5k|      }
_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_:
 4190|  75.5k|                                             [](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.5k|      {
  409|  75.5k|         state.has_anchor = false;
  410|  75.5k|         state.anchor_name.clear();
  411|  75.5k|         state.anchor_start = nullptr;
  412|  75.5k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  75.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|  75.5k|            else {
  421|  75.5k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.68k, False: 71.8k]
  ------------------
  422|  75.5k|            }
  423|  75.5k|         }
  424|       |
  425|  75.5k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 71.8k, False: 3.68k]
  |  Branch (425:27): [True: 1.15k, False: 70.6k]
  ------------------
  426|  1.15k|            ++it;
  427|  1.15k|            auto name = parse_anchor_name(it, end);
  428|  1.15k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 1.14k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  1.14k|            skip_inline_ws(it, end);
  433|  1.14k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 26, False: 1.11k]
  ------------------
  434|     26|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     26|                  ctx.error = error_code::unexpected_end;
  436|     26|               }
  437|     26|               return true;
  438|     26|            }
  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.11k|            state.has_anchor = true;
  446|  1.11k|            state.anchor_name = std::string(name);
  447|  1.11k|            state.anchor_start = &*it;
  448|  1.11k|         }
  449|       |
  450|  75.4k|         return false;
  451|  75.5k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  75.5k|      {
  301|  75.5k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 75.5k]
  |  Branch (301:27): [True: 71.8k, False: 3.68k]
  ------------------
  302|       |
  303|  3.68k|         ++it; // skip '*'
  304|  3.68k|         auto name = parse_anchor_name(it, end);
  305|  3.68k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 3.67k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  3.67k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.67k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 18, False: 3.65k]
  ------------------
  312|     18|            ctx.error = error_code::syntax_error; // undefined alias
  313|     18|            return true;
  314|     18|         }
  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.65k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.65k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 934, False: 2.72k]
  ------------------
  322|    934|            return true;
  323|    934|         }
  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.72k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 16, False: 2.70k]
  ------------------
  329|     16|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     16|            return true;
  331|     16|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  2.70k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.70k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.70k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  2.70k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.70k]
  ------------------
  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.70k|         auto replay_it = span.begin;
  348|  2.70k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.70k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.70k|         ctx.indent_stack.clear();
  353|  2.70k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.37k, False: 1.32k]
  ------------------
  354|  1.37k|            ctx.push_indent(span.base_indent - 1);
  355|  1.37k|         }
  356|       |
  357|  2.70k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.70k|         using V = std::remove_cvref_t<T>;
  360|  2.70k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.70k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.70k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.70k|         return true;
  367|  2.70k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  29.7k|      {
 2665|  29.7k|         using V = std::remove_cvref_t<T>;
 2666|  29.7k|         using value_type = typename V::value_type;
 2667|       |
 2668|  29.7k|         struct sequence_container_adapter
 2669|  29.7k|         {
 2670|  29.7k|            size_t index = 0;
 2671|       |
 2672|  29.7k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  29.7k|            {
 2674|  29.7k|               if constexpr (!resizable<V>) {
 2675|  29.7k|                  return index >= container.size();
 2676|  29.7k|               }
 2677|  29.7k|               else {
 2678|  29.7k|                  (void)container;
 2679|  29.7k|                  return false;
 2680|  29.7k|               }
 2681|  29.7k|            }
 2682|       |
 2683|  29.7k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  29.7k|            inline void append(V& container, value_type&& element) noexcept
 2686|  29.7k|            {
 2687|  29.7k|               if constexpr (emplace_backable<V>) {
 2688|  29.7k|                  container.emplace_back(std::move(element));
 2689|  29.7k|               }
 2690|  29.7k|               else if constexpr (emplaceable<V>) {
 2691|  29.7k|                  container.emplace(std::move(element));
 2692|  29.7k|               }
 2693|  29.7k|            }
 2694|  29.7k|         };
 2695|       |
 2696|  29.7k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 29.7k]
  |  Branch (2696:27): [True: 0, False: 29.7k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  29.7k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  29.7k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  29.7k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  29.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 19, False: 29.6k]
  ------------------
 2709|     19|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  29.6k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 29.0k, False: 606]
  |  Branch (2712:27): [True: 3.52k, False: 25.5k]
  ------------------
 2713|  3.52k|            ++it;
 2714|  3.52k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  3.52k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 10, False: 3.51k]
  ------------------
 2716|     10|               return;
 2717|  3.51k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  3.51k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 357, False: 3.15k]
  ------------------
 2719|    357|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|    357|               }
 2721|  3.51k|            }
 2722|  3.51k|            return;
 2723|  3.52k|         }
 2724|       |
 2725|  26.1k|         bool just_saw_comma = false;
 2726|  26.1k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  26.1k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   603k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 602k, False: 1.13k]
  ------------------
 2731|   602k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   602k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 602k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   602k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 602k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   602k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 3.59k, False: 598k]
  ------------------
 2741|  3.59k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 3.59k, False: 0]
  ------------------
 2742|  3.59k|                     ++it;
 2743|  3.59k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  3.59k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 4, False: 3.58k]
  ------------------
 2745|      4|                        return;
 2746|  3.58k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  3.58k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 533, False: 3.05k]
  ------------------
 2748|    533|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|    533|                        }
 2750|  3.58k|                     }
 2751|  3.58k|                     return;
 2752|  3.59k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  3.59k|               }
 2756|       |
 2757|   598k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 69, False: 598k]
  |  Branch (2757:34): [True: 20, False: 598k]
  ------------------
 2758|     89|                  ctx.error = error_code::syntax_error;
 2759|     89|                  return;
 2760|     89|               }
 2761|   598k|               just_saw_comma = false;
 2762|       |
 2763|   598k|               value_type element{};
 2764|   598k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   598k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 13.1k, False: 585k]
  ------------------
 2767|  13.1k|                  return;
 2768|       |
 2769|   585k|               bool saw_line_break_before_separator = false;
 2770|   585k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   585k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 9, False: 585k]
  ------------------
 2772|      9|                  return;
 2773|       |
 2774|   585k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 583k, False: 2.54k]
  |  Branch (2774:33): [True: 3.13k, False: 579k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  3.13k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 53, False: 3.08k]
  ------------------
 2777|     53|                     ctx.error = error_code::syntax_error;
 2778|     53|                     return;
 2779|     53|                  }
 2780|  3.08k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  3.08k|                     glz::generic key_node = std::move(element);
 2782|  3.08k|                     ++it;
 2783|  3.08k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  3.08k|                     glz::generic mapped{};
 2786|  3.08k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  3.08k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 340, False: 2.74k]
  ------------------
 2788|    340|                        return;
 2789|       |
 2790|  2.74k|                     std::string key;
 2791|  2.74k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 3, False: 2.74k]
  ------------------
 2792|      3|                        return;
 2793|       |
 2794|  2.74k|                     glz::generic pair{};
 2795|  2.74k|                     pair[key] = std::move(mapped);
 2796|  2.74k|                     element = std::move(pair);
 2797|       |
 2798|  2.74k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  2.74k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 0, False: 2.74k]
  ------------------
 2800|      0|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  3.08k|               }
 2807|       |
 2808|   585k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   585k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 2.66k, False: 582k]
  ------------------
 2811|  2.66k|                  ctx.error = error_code::unexpected_end;
 2812|  2.66k|                  return;
 2813|  2.66k|               }
 2814|       |
 2815|   582k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 3.87k, False: 579k]
  ------------------
 2816|  3.87k|                  ++it;
 2817|  3.87k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  3.87k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 28, False: 3.84k]
  ------------------
 2819|     28|                     return;
 2820|  3.84k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  3.84k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 587, False: 3.26k]
  ------------------
 2822|    587|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|    587|                     }
 2824|  3.84k|                  }
 2825|  3.84k|                  return;
 2826|  3.87k|               }
 2827|   579k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 577k, False: 1.57k]
  ------------------
 2828|   577k|                  ++it;
 2829|   577k|                  just_saw_comma = true;
 2830|   577k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|   577k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 4, False: 577k]
  ------------------
 2832|      4|                     return;
 2833|   577k|               }
 2834|  1.57k|               else {
 2835|  1.57k|                  ctx.error = error_code::syntax_error;
 2836|  1.57k|                  return;
 2837|  1.57k|               }
 2838|   582k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  26.1k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|  71.6k|      {
 2649|  71.6k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|  71.6k|            if constexpr (!check_append_arrays(Opts)) {
 2652|  71.6k|               value.clear();
 2653|  71.6k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|  71.6k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|   585k|            {
 2687|   585k|               if constexpr (emplace_backable<V>) {
 2688|   585k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   585k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|  41.9k|      {
 3160|  41.9k|         using V = std::remove_cvref_t<T>;
 3161|  41.9k|         using value_type = typename V::value_type;
 3162|       |
 3163|  41.9k|         struct sequence_container_adapter
 3164|  41.9k|         {
 3165|  41.9k|            size_t index = 0;
 3166|       |
 3167|  41.9k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|  41.9k|            {
 3169|  41.9k|               if constexpr (!resizable<V>) {
 3170|  41.9k|                  return index >= container.size();
 3171|  41.9k|               }
 3172|  41.9k|               else {
 3173|  41.9k|                  (void)container;
 3174|  41.9k|                  return false;
 3175|  41.9k|               }
 3176|  41.9k|            }
 3177|       |
 3178|  41.9k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|  41.9k|            inline void append(V& container, value_type&& element) noexcept
 3181|  41.9k|            {
 3182|  41.9k|               if constexpr (emplace_backable<V>) {
 3183|  41.9k|                  container.emplace_back(std::move(element));
 3184|  41.9k|               }
 3185|  41.9k|               else if constexpr (emplaceable<V>) {
 3186|  41.9k|                  container.emplace(std::move(element));
 3187|  41.9k|               }
 3188|  41.9k|            }
 3189|  41.9k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|  41.9k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|  41.9k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|  41.9k|         bool first_item = true;
 3200|  41.9k|         bool has_pending_item_anchor = false;
 3201|  41.9k|         std::string pending_item_anchor_name{};
 3202|  41.9k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   166k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 148k, False: 17.8k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   148k|            int32_t line_indent = 0;
 3215|   148k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   148k|            auto line_start = it;
 3217|       |
 3218|   282k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 273k, False: 9.30k]
  ------------------
 3219|   273k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 9.21k, False: 263k]
  ------------------
 3220|  9.21k|                  skip_comment(it, end);
 3221|  9.21k|                  skip_newline(it, end);
 3222|  9.21k|                  line_start = it;
 3223|  9.21k|                  line_indent = 0;
 3224|  9.21k|               }
 3225|   263k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 28.4k, False: 235k]
  |  Branch (3225:40): [True: 73.8k, False: 161k]
  ------------------
 3226|   102k|                  skip_newline(it, end);
 3227|   102k|                  line_start = it;
 3228|   102k|                  line_indent = 0;
 3229|   102k|               }
 3230|   161k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 26.9k, False: 134k]
  ------------------
 3231|  26.9k|                  line_start = it;
 3232|  26.9k|                  line_indent = 0;
 3233|  87.2k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 86.8k, False: 430]
  |  Branch (3233:39): [True: 60.2k, False: 26.5k]
  ------------------
 3234|  60.2k|                     ++line_indent;
 3235|  60.2k|                     ++it;
 3236|  60.2k|                  }
 3237|       |
 3238|  26.9k|                  bool saw_tab = false;
 3239|  29.0k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 28.5k, False: 567]
  |  Branch (3239:40): [True: 537, False: 27.9k]
  |  Branch (3239:54): [True: 1.58k, False: 26.4k]
  ------------------
 3240|  2.12k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 1.49k, False: 629]
  |  Branch (3240:43): [True: 629, False: 0]
  ------------------
 3241|  2.12k|                     ++it;
 3242|  2.12k|                  }
 3243|       |
 3244|  26.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 567, False: 26.4k]
  |  Branch (3244:36): [True: 1.18k, False: 25.2k]
  |  Branch (3244:51): [True: 14.8k, False: 10.3k]
  |  Branch (3244:66): [True: 4.12k, False: 6.24k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  20.7k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 20.1k, False: 567]
  |  Branch (3246:39): [True: 4.12k, False: 16.0k]
  ------------------
 3247|  4.12k|                        skip_comment(it, end);
 3248|  4.12k|                     }
 3249|  20.7k|                     line_indent = 0;
 3250|  20.7k|                     continue;
 3251|  20.7k|                  }
 3252|       |
 3253|  6.24k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 8, False: 6.24k]
  ------------------
 3254|      8|                     ctx.error = error_code::syntax_error;
 3255|      8|                     return;
 3256|      8|                  }
 3257|  6.24k|                  break; // Found content
 3258|  6.24k|               }
 3259|   134k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 1.52k, False: 133k]
  ------------------
 3260|  1.52k|                  line_start = it;
 3261|  5.04k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 4.78k, False: 259]
  |  Branch (3261:40): [True: 599, False: 4.18k]
  |  Branch (3261:54): [True: 2.92k, False: 1.26k]
  ------------------
 3262|  1.52k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 259, False: 1.26k]
  |  Branch (3262:36): [True: 367, False: 896]
  |  Branch (3262:51): [True: 320, False: 576]
  |  Branch (3262:66): [True: 558, False: 18]
  ------------------
 3263|  1.50k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 1.24k, False: 259]
  |  Branch (3263:39): [True: 558, False: 687]
  ------------------
 3264|    558|                        skip_comment(it, end);
 3265|    558|                     }
 3266|  1.50k|                     line_indent = 0;
 3267|  1.50k|                     continue;
 3268|  1.50k|                  }
 3269|     18|                  ctx.error = error_code::syntax_error;
 3270|     18|                  return;
 3271|  1.52k|               }
 3272|   133k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   133k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 41.9k, False: 91.1k]
  |  Branch (3276:37): [True: 41.7k, False: 260]
  ------------------
 3277|  41.7k|                     line_indent = sequence_indent;
 3278|  41.7k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  41.7k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 41.7k, False: 0]
  |  Branch (3279:49): [True: 41.0k, False: 669]
  ------------------
 3280|  41.0k|                           auto probe = it;
 3281|  41.0k|                           int32_t leading_ws = 0;
 3282|  41.0k|                           bool saw_tab = false;
 3283|   128k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 128k, False: 113]
  |  Branch (3283:64): [True: 86.0k, False: 42.4k]
  |  Branch (3283:87): [True: 1.54k, False: 40.9k]
  ------------------
 3284|  87.6k|                              --probe;
 3285|  87.6k|                              ++leading_ws;
 3286|  87.6k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 551, False: 87.0k]
  |  Branch (3286:52): [True: 1.07k, False: 86.0k]
  ------------------
 3287|  87.6k|                           }
 3288|  41.0k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 113, False: 40.9k]
  |  Branch (3288:61): [True: 8.42k, False: 32.5k]
  |  Branch (3288:85): [True: 10.2k, False: 22.3k]
  ------------------
 3289|  18.7k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 23, False: 18.7k]
  ------------------
 3290|     23|                                 ctx.error = error_code::syntax_error;
 3291|     23|                                 return;
 3292|     23|                              }
 3293|  18.7k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  18.7k|                           }
 3295|  41.0k|                        }
 3296|  41.7k|                     }
 3297|  41.7k|                  }
 3298|  41.7k|                  break;
 3299|   133k|               }
 3300|   273k|            }
 3301|       |
 3302|   148k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 9.30k, False: 139k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   139k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 1.05k, False: 138k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   138k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 4.09k, False: 134k]
  ------------------
 3309|  4.09k|               it = line_start;
 3310|  4.09k|               return;
 3311|  4.09k|            }
 3312|       |
 3313|   134k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 4.43k, False: 129k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  4.43k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 5, False: 4.43k]
  ------------------
 3318|      5|                  ctx.error = error_code::syntax_error;
 3319|      5|                  return;
 3320|      5|               }
 3321|       |
 3322|  4.43k|               ++it;
 3323|  4.43k|               auto pending_name = parse_anchor_name(it, end);
 3324|  4.43k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 9, False: 4.42k]
  ------------------
 3325|      9|                  ctx.error = error_code::syntax_error;
 3326|      9|                  return;
 3327|      9|               }
 3328|  4.42k|               skip_inline_ws(it, end);
 3329|  4.42k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 4.36k, False: 58]
  |  Branch (3329:33): [True: 720, False: 3.64k]
  ------------------
 3330|    720|                  skip_comment(it, end);
 3331|    720|               }
 3332|       |
 3333|  4.42k|               has_pending_item_anchor = true;
 3334|  4.42k|               pending_item_anchor_name = std::string(pending_name);
 3335|  4.42k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  4.42k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 70, False: 4.35k]
  |  Branch (3337:34): [True: 2.32k, False: 2.03k]
  |  Branch (3337:49): [True: 26, False: 2.29k]
  ------------------
 3338|     96|                  ctx.error = error_code::syntax_error;
 3339|     96|                  return;
 3340|     96|               }
 3341|       |
 3342|  4.32k|               skip_newline(it, end);
 3343|  4.32k|               continue;
 3344|  4.42k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   129k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 6.38k, False: 123k]
  ------------------
 3348|  6.38k|               it = line_start;
 3349|  6.38k|               return;
 3350|  6.38k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   123k|            dash_col = line_indent;
 3356|   123k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   123k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 123k, False: 23]
  ------------------
 3358|   123k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   123k|               }
 3360|   123k|            }
 3361|       |
 3362|   123k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   123k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 122k, False: 1.24k]
  |  Branch (3365:30): [True: 2.23k, False: 119k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  2.23k|               it = line_start;
 3368|  2.23k|               return;
 3369|  2.23k|            }
 3370|       |
 3371|   121k|            bool saw_tab_after_dash = false;
 3372|   195k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 193k, False: 1.82k]
  |  Branch (3372:34): [True: 62.9k, False: 130k]
  |  Branch (3372:48): [True: 11.1k, False: 119k]
  ------------------
 3373|  74.0k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 1.36k, False: 72.6k]
  |  Branch (3373:59): [True: 9.90k, False: 62.7k]
  ------------------
 3374|  74.0k|               ++it;
 3375|  74.0k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   121k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 9.90k, False: 111k]
  |  Branch (3377:39): [True: 9.63k, False: 271]
  |  Branch (3377:52): [True: 391, False: 9.24k]
  ------------------
 3378|    391|               const auto after_dash = it + 1;
 3379|    391|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 7, False: 384]
  |  Branch (3379:41): [True: 4, False: 380]
  ------------------
 3380|     11|                  ctx.error = error_code::syntax_error;
 3381|     11|                  return;
 3382|     11|               }
 3383|    391|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   121k|            auto parse_element = [&](auto& element) {
 3387|   121k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   121k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   121k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   121k|                     return;
 3397|   121k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   121k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   121k|                  ctx.sequence_item_value_context = true;
 3400|   121k|                  ctx.sequence_dash_indent = dash_col;
 3401|   121k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   121k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   121k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   121k|                  ctx.pop_indent();
 3405|   121k|               }
 3406|   121k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   121k|                  skip_ws_and_comment(it, end);
 3409|   121k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   121k|                  auto nested_start = it;
 3413|   121k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   121k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   121k|                     return;
 3416|   121k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   121k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   121k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   121k|                     const int32_t element_indent =
 3428|   121k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   121k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   121k|                        return;
 3431|   121k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   121k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   121k|                     ctx.sequence_item_value_context = true;
 3434|   121k|                     ctx.sequence_dash_indent = dash_col;
 3435|   121k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   121k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   121k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   121k|                     ctx.pop_indent();
 3439|   121k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   121k|               }
 3442|       |
 3443|   121k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   121k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   121k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   121k|                                                                      pending_item_anchor_indent};
 3447|   121k|                  has_pending_item_anchor = false;
 3448|   121k|               }
 3449|   121k|            };
 3450|       |
 3451|   121k|            if constexpr (emplace_backable<V>) {
 3452|   121k|               auto& element = value.emplace_back();
 3453|   121k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   121k|            first_item = false;
 3472|       |
 3473|   121k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 909, False: 120k]
  ------------------
 3474|    909|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   121k|         }
 3479|  41.9k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   121k|            auto parse_element = [&](auto& element) {
 3387|   121k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 119k, False: 1.80k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   121k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 119k, False: 1.80k]
  |  Branch (3390:33): [True: 48.3k, False: 70.9k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|  48.3k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 48.3k]
  ------------------
 3396|      0|                     return;
 3397|  48.3k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|  48.3k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|  48.3k|                  ctx.sequence_item_value_context = true;
 3400|  48.3k|                  ctx.sequence_dash_indent = dash_col;
 3401|  48.3k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|  48.3k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|  48.3k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|  48.3k|                  ctx.pop_indent();
 3405|  48.3k|               }
 3406|  72.7k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  72.7k|                  skip_ws_and_comment(it, end);
 3409|  72.7k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  72.7k|                  auto nested_start = it;
 3413|  72.7k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  72.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 4, False: 72.7k]
  ------------------
 3415|      4|                     return;
 3416|  72.7k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|  72.7k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 1.26k, False: 71.4k]
  ------------------
 3422|  72.7k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 59.5k, False: 13.1k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  59.5k|                     const int32_t element_indent =
 3428|  59.5k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 59.5k]
  ------------------
 3429|  59.5k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 59.5k]
  ------------------
 3430|      0|                        return;
 3431|  59.5k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  59.5k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  59.5k|                     ctx.sequence_item_value_context = true;
 3434|  59.5k|                     ctx.sequence_dash_indent = dash_col;
 3435|  59.5k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  59.5k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  59.5k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  59.5k|                     ctx.pop_indent();
 3439|  59.5k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  72.7k|               }
 3442|       |
 3443|   121k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 1.54k, False: 119k]
  |  Branch (3443:47): [True: 1.44k, False: 99]
  ------------------
 3444|  1.44k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 890, False: 559]
  ------------------
 3445|  1.44k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  1.44k|                                                                      pending_item_anchor_indent};
 3447|  1.44k|                  has_pending_item_anchor = false;
 3448|  1.44k|               }
 3449|   121k|            };
_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_:
 5530|   206k|   {
 5531|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5532|       |         // In flow context, only treat plain content as an implicit "key: value"
 5533|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5534|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|       |            bool at_node_start = true;
 5542|       |            int depth = 0;
 5543|       |            while (pos != stop) {
 5544|       |               const char c = *pos;
 5545|       |               if (c == ' ' || c == '\t') {
 5546|       |                  ++pos;
 5547|       |                  continue;
 5548|       |               }
 5549|       |               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|       |               if ((c == '"' || c == '\'') && node_start) {
 5552|       |                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|       |                  continue;
 5554|       |               }
 5555|       |               if (c == '[' || c == '{') {
 5556|       |                  ++depth;
 5557|       |                  at_node_start = true;
 5558|       |                  ++pos;
 5559|       |                  continue;
 5560|       |               }
 5561|       |               if (c == ']' || c == '}') {
 5562|       |                  if (depth == 0) return false;
 5563|       |                  --depth;
 5564|       |                  ++pos;
 5565|       |                  continue;
 5566|       |               }
 5567|       |               if (c == ',' && depth == 0) return false;
 5568|       |               if (c == ':' && depth == 0) {
 5569|       |                  auto next = pos + 1;
 5570|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|       |               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|       |               if (c == ',' || c == ':') {
 5574|       |                  at_node_start = true;
 5575|       |                  ++pos;
 5576|       |                  continue;
 5577|       |               }
 5578|       |               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|       |                  at_node_start = true;
 5580|       |                  continue;
 5581|       |               }
 5582|       |               ++pos;
 5583|       |            }
 5584|       |            return false;
 5585|       |         };
 5586|       |
 5587|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5588|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5589|       |               return;
 5590|       |            }
 5591|       |            if (bool(ctx.error)) {
 5592|       |               return;
 5593|       |            }
 5594|       |         }
 5595|       |
 5596|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|       |         return;
 5598|       |      }
 5599|       |
 5600|   206k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 107k, False: 99.6k]
  ------------------
 5601|   107k|         return;
 5602|   107k|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|  99.6k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 6.53k, False: 93.1k]
  ------------------
 5605|  6.53k|         return;
 5606|  6.53k|      }
 5607|  93.1k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|  93.1k|   }
_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_:
 5962|  34.4k|            auto is_word_boundary = [&](const auto ptr) {
 5963|  34.4k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 2.32k, False: 32.1k]
  ------------------
 5964|  2.32k|                  return true;
 5965|  2.32k|               }
 5966|  32.1k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 8.33k, False: 23.8k]
  ------------------
 5967|  8.33k|                  auto next = ptr + 1;
 5968|  8.33k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 3.17k, False: 5.15k]
  |  Branch (5968:43): [True: 1.16k, False: 3.98k]
  |  Branch (5968:59): [True: 1.13k, False: 2.84k]
  |  Branch (5968:76): [True: 914, False: 1.93k]
  |  Branch (5968:93): [True: 1.22k, False: 709]
  ------------------
 5969|  8.33k|               }
 5970|  23.8k|               return is_plain_scalar_boundary(*ptr);
 5971|  32.1k|            };
_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:
 5888|  23.8k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  23.8k|               switch (ch) {
 5890|    588|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 588, False: 23.2k]
  ------------------
 5891|  1.21k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 631, False: 23.1k]
  ------------------
 5892|  6.51k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 5.29k, False: 18.5k]
  ------------------
 5893|  19.7k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 13.2k, False: 10.5k]
  ------------------
 5894|  20.0k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 305, False: 23.5k]
  ------------------
 5895|  20.3k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 304, False: 23.5k]
  ------------------
 5896|  20.6k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 270, False: 23.5k]
  ------------------
 5897|  20.6k|                  return true;
 5898|  3.19k|               default:
  ------------------
  |  Branch (5898:16): [True: 3.19k, False: 20.6k]
  ------------------
 5899|  3.19k|                  return false;
 5900|  23.8k|               }
 5901|  23.8k|            };
_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_:
 5903|  30.5k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5905|       |                  return false;
 5906|       |               }
 5907|  30.5k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 3.72k, False: 26.8k]
  ------------------
 5908|  3.72k|                  return false;
 5909|  3.72k|               }
 5910|  26.8k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 1.58k, False: 25.2k]
  |  Branch (5910:40): [True: 19.9k, False: 5.29k]
  |  Branch (5910:61): [True: 6.81k, False: 13.1k]
  ------------------
 5911|  8.40k|                  return false;
 5912|  8.40k|               }
 5913|       |
 5914|  18.4k|               auto look = word_end;
 5915|  18.4k|               yaml::skip_newline(look, end);
 5916|  62.1k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 56.1k, False: 5.97k]
  ------------------
 5917|  56.1k|                  int32_t line_indent = 0;
 5918|   101k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 101k, False: 282]
  |  Branch (5918:41): [True: 45.2k, False: 55.9k]
  ------------------
 5919|  45.2k|                     ++line_indent;
 5920|  45.2k|                     ++look;
 5921|  45.2k|                  }
 5922|  56.1k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 55.9k, False: 282]
  |  Branch (5922:38): [True: 739, False: 55.1k]
  ------------------
 5923|    739|                     return false;
 5924|    739|                  }
 5925|  55.4k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 282, False: 55.1k]
  |  Branch (5925:38): [True: 35.0k, False: 20.1k]
  |  Branch (5925:55): [True: 4.71k, False: 15.3k]
  ------------------
 5926|  40.0k|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 39.7k, False: 282]
  ------------------
 5927|  39.7k|                        yaml::skip_newline(look, end);
 5928|  39.7k|                        continue;
 5929|  39.7k|                     }
 5930|    282|                     return false;
 5931|  40.0k|                  }
 5932|  15.3k|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 4.24k, False: 11.1k]
  ------------------
 5933|  4.24k|                     yaml::skip_comment(look, end);
 5934|  4.24k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 3.95k, False: 288]
  |  Branch (5934:42): [True: 1.73k, False: 2.21k]
  |  Branch (5934:59): [True: 2.21k, False: 8]
  ------------------
 5935|  3.94k|                        yaml::skip_newline(look, end);
 5936|  3.94k|                        continue;
 5937|  3.94k|                     }
 5938|    296|                     return false;
 5939|  4.24k|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  11.1k|                  {
 5945|  11.1k|                     auto scan = look;
 5946|  87.9k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 87.6k, False: 346]
  |  Branch (5946:44): [True: 82.4k, False: 5.21k]
  |  Branch (5946:61): [True: 81.2k, False: 1.14k]
  ------------------
 5947|  81.2k|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 7.85k, False: 73.4k]
  ------------------
 5948|  7.85k|                           auto after_colon = scan + 1;
 5949|  7.85k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 231, False: 7.61k]
  |  Branch (5949:54): [True: 2.78k, False: 4.83k]
  |  Branch (5949:77): [True: 376, False: 4.45k]
  ------------------
 5950|  4.45k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 465, False: 3.99k]
  |  Branch (5950:56): [True: 580, False: 3.41k]
  ------------------
 5951|  4.43k|                              return false;
 5952|  4.43k|                           }
 5953|  7.85k|                        }
 5954|  76.8k|                        ++scan;
 5955|  76.8k|                     }
 5956|  11.1k|                  }
 5957|       |
 5958|  6.70k|                  return line_indent > ctx.current_indent();
 5959|  11.1k|               }
 5960|  5.97k|               return false;
 5961|  18.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_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5484|   234k|   {
 5485|   234k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   234k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   234k|         const bool could_be_mapping = [&] {
 5493|   234k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   234k|               return line_could_be_flow_mapping(it, end);
 5495|   234k|            }
 5496|   234k|            else {
 5497|   234k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   234k|            }
 5499|   234k|         }();
 5500|   234k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 103k, False: 131k]
  ------------------
 5501|   103k|            return false;
 5502|   103k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   131k|         auto temp_ctx = ctx.make_speculative();
 5505|   131k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   131k|                                                                                               end);
 5507|   131k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   131k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   131k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 115k, False: 15.3k]
  ------------------
 5510|   115k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   115k|            return true;
 5512|   115k|         }
 5513|       |         // The line matched "key: value" pattern but parsing failed.
 5514|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5515|       |         // so propagate the error rather than silently falling back to string.
 5516|  15.3k|         ctx.error = temp_ctx.error;
 5517|  15.3k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  15.3k|         return false;
 5519|   131k|      }
 5520|   234k|   }
_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:
 5492|   234k|         const bool could_be_mapping = [&] {
 5493|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5494|       |               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|   234k|            else {
 5497|   234k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   234k|            }
 5499|   234k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    431|               auto is_document_start = [&](auto pos) {
  146|    431|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 319, False: 112]
  |  Branch (146:41): [True: 162, False: 157]
  |  Branch (146:58): [True: 143, False: 19]
  |  Branch (146:75): [True: 137, False: 6]
  ------------------
  147|    137|                     auto after = pos + 3;
  148|    137|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 11, False: 126]
  |  Branch (148:45): [True: 51, False: 75]
  |  Branch (148:62): [True: 50, False: 25]
  |  Branch (148:80): [True: 13, False: 12]
  |  Branch (148:98): [True: 8, False: 4]
  ------------------
  149|      4|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 0, False: 4]
  ------------------
  150|    137|                  }
  151|    294|                  return false;
  152|    431|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6732|  81.3k|   {
 6733|  81.3k|      if (buffer.size() == 0) {
  ------------------
  |  Branch (6733:11): [True: 0, False: 81.3k]
  ------------------
 6734|      0|         using V = std::remove_cvref_t<T>;
 6735|      0|         if constexpr (requires { value = nullptr; }) {
 6736|      0|            value = nullptr;
 6737|      0|            return {};
 6738|       |         }
 6739|       |         else if constexpr (nullable_like<V>) {
 6740|       |            value = {};
 6741|       |            return {};
 6742|       |         }
 6743|      0|      }
 6744|      0|      yaml::yaml_context ctx{};
 6745|  81.3k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6746|  81.3k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|   122k|      {
   70|   122k|         if constexpr (requires { ctx.stream_begin; }) {
   71|   122k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 122k, False: 0]
  |  Branch (71:38): [True: 122k, False: 0]
  ------------------
   72|   122k|               ctx.stream_begin = &*it;
   73|       |               // Anchors and the line memo hold pointers into whatever buffer filled them, so a
   74|       |               // reused context must not carry a previous read's into this one.
   75|   122k|               if constexpr (requires { ctx.reset_read_state(); }) {
   76|   122k|                  ctx.reset_read_state();
   77|   122k|               }
   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|   122k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|   122k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|   122k|                  ctx.alias_expansion_budget =
   84|   122k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 857, False: 121k]
  ------------------
   85|   122k|               }
   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|   122k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|   122k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|   122k|                  ctx.key_expansion_budget =
   91|   122k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 857, False: 121k]
  ------------------
   92|   122k|               }
   93|   122k|            }
   94|   122k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|   122k|         yaml::skip_document_start(it, end, ctx);
   97|   122k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 797, False: 121k]
  ------------------
   98|    797|            return;
   99|    797|         }
  100|       |
  101|   121k|         using V = std::remove_cvref_t<T>;
  102|   121k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 69, False: 121k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     69|            if constexpr (requires { value = nullptr; }) {
  105|     69|               value = nullptr;
  106|     69|               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|     69|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|   121k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 89, False: 121k]
  |  Branch (120:50): [True: 28, False: 121k]
  ------------------
  121|     48|            if constexpr (requires { value = nullptr; }) {
  122|     48|               value = nullptr;
  123|     48|               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|     48|         }
  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|   121k|         if constexpr (!check_partial_read(Opts)) {
  144|   121k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 13.3k, False: 107k]
  |  Branch (144:37): [True: 13.3k, False: 0]
  ------------------
  145|  13.3k|               auto is_document_start = [&](auto pos) {
  146|  13.3k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  13.3k|                     auto after = pos + 3;
  148|  13.3k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  13.3k|                            *after == '#';
  150|  13.3k|                  }
  151|  13.3k|                  return false;
  152|  13.3k|               };
  153|       |
  154|       |               // The scan below reads the tail a line at a time, which only means anything if the
  155|       |               // tail starts at one. A root node can stop mid-line -- a plain scalar ends at a
  156|       |               // ':' it is not allowed to take as a separator, a flow collection ends at its
  157|       |               // bracket -- and what sits after it there is leftover content on that line, not
  158|       |               // the opening of a new one. Only inline whitespace and a comment may follow. Let
  159|       |               // the line scan see anything else and it misreads it: a leftover ':' passes as an
  160|       |               // explicit-key continuation and the remainder of the document falls on the floor.
  161|  13.3k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  13.3k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 5.15k, False: 8.24k]
  |  Branch (162:23): [True: 3.37k, False: 10.0k]
  |  Branch (162:36): [True: 3.37k, False: 1.77k]
  ------------------
  163|  3.37k|                     auto rest = it;
  164|  9.23k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 9.18k, False: 49]
  |  Branch (164:45): [True: 4.50k, False: 4.68k]
  |  Branch (164:61): [True: 1.36k, False: 3.32k]
  ------------------
  165|  3.37k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 3.32k, False: 49]
  |  Branch (165:41): [True: 2.86k, False: 462]
  |  Branch (165:58): [True: 2.19k, False: 664]
  |  Branch (165:75): [True: 1.91k, False: 286]
  ------------------
  166|  1.91k|                        ctx.error = error_code::syntax_error;
  167|  1.91k|                        return;
  168|  1.91k|                     }
  169|  3.37k|                  }
  170|  13.3k|               }
  171|       |
  172|  11.4k|               auto tail_scan = it;
  173|  13.3k|               bool seen_document_end_marker = false;
  174|   111k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 100k, False: 10.9k]
  ------------------
  175|   100k|                  auto line = tail_scan;
  176|   153k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 153k, False: 84]
  |  Branch (176:42): [True: 52.8k, False: 100k]
  |  Branch (176:58): [True: 761, False: 100k]
  ------------------
  177|   100k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 3.26k, False: 96.9k]
  |  Branch (177:44): [True: 3.17k, False: 84]
  |  Branch (177:59): [True: 2.27k, False: 907]
  |  Branch (177:76): [True: 1.72k, False: 545]
  |  Branch (177:93): [True: 392, False: 1.33k]
  ------------------
  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|    392|                     const char first = *line;
  182|    392|                     const bool explicit_or_structural_start =
  183|    392|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 28, False: 364]
  |  Branch (183:42): [True: 4, False: 360]
  |  Branch (183:58): [True: 10, False: 350]
  |  Branch (183:74): [True: 6, False: 344]
  |  Branch (183:90): [True: 7, False: 337]
  |  Branch (183:106): [True: 13, False: 324]
  ------------------
  184|    324|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 4, False: 320]
  |  Branch (184:42): [True: 7, False: 313]
  |  Branch (184:58): [True: 4, False: 309]
  |  Branch (184:75): [True: 48, False: 261]
  ------------------
  185|    392|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 261, False: 131]
  ------------------
  186|    261|                        auto scan = line;
  187|  3.45k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 3.26k, False: 192]
  |  Branch (187:47): [True: 3.24k, False: 18]
  |  Branch (187:64): [True: 3.23k, False: 9]
  ------------------
  188|  3.23k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 503, False: 2.73k]
  ------------------
  189|    503|                              auto after = scan + 1;
  190|    503|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 18, False: 485]
  |  Branch (190:51): [True: 9, False: 476]
  |  Branch (190:68): [True: 6, False: 470]
  |  Branch (190:86): [True: 6, False: 464]
  |  Branch (190:104): [True: 3, False: 461]
  ------------------
  191|     42|                                 ctx.error = error_code::syntax_error;
  192|     42|                                 return;
  193|     42|                              }
  194|    503|                           }
  195|  3.19k|                           ++scan;
  196|  3.19k|                        }
  197|    261|                     }
  198|    350|                     return;
  199|    392|                  }
  200|  99.8k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 84, False: 99.7k]
  ------------------
  201|     84|                     return;
  202|     84|                  }
  203|  99.7k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 82, False: 99.7k]
  |  Branch (203:39): [True: 49, False: 99.6k]
  ------------------
  204|    131|                     return; // Explicit key/value continuation.
  205|    131|                  }
  206|  99.6k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 2.48k, False: 97.1k]
  |  Branch (206:40): [True: 33.1k, False: 64.0k]
  ------------------
  207|  35.5k|                     tail_scan = line;
  208|  35.5k|                     yaml::skip_newline(tail_scan, end);
  209|  35.5k|                     continue;
  210|  35.5k|                  }
  211|  64.0k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 49.1k, False: 14.9k]
  ------------------
  212|   385k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 384k, False: 437]
  |  Branch (212:49): [True: 374k, False: 10.5k]
  |  Branch (212:71): [True: 336k, False: 38.2k]
  ------------------
  213|  49.1k|                     yaml::skip_newline(tail_scan, end);
  214|  49.1k|                     continue;
  215|  49.1k|                  }
  216|  14.9k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 13.0k, False: 1.82k]
  ------------------
  217|  13.0k|                     seen_document_end_marker = true;
  218|  82.1k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 82.0k, False: 127]
  |  Branch (218:49): [True: 72.5k, False: 9.44k]
  |  Branch (218:71): [True: 69.0k, False: 3.51k]
  ------------------
  219|  13.0k|                     yaml::skip_newline(tail_scan, end);
  220|  13.0k|                     continue;
  221|  13.0k|                  }
  222|  1.82k|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 361, False: 1.46k]
  ------------------
  223|       |                     // Additional documents are accepted, but document-start lines
  224|       |                     // that use non-standard tag handles (e.g. !prefix!Type) are
  225|       |                     // malformed in this single-document reader unless re-declared
  226|       |                     // for that document. Reject this shape in the stream tail.
  227|    361|                     auto header = line + 3;
  228|  2.52k|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 2.50k, False: 28]
  |  Branch (228:47): [True: 1.28k, False: 1.21k]
  |  Branch (228:65): [True: 886, False: 333]
  ------------------
  229|    361|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 333, False: 28]
  |  Branch (229:43): [True: 164, False: 169]
  ------------------
  230|    164|                        auto tag_end = header + 1;
  231|  9.22M|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 9.22M, False: 54]
  |  Branch (231:50): [True: 9.22M, False: 88]
  |  Branch (231:69): [True: 9.22M, False: 4]
  |  Branch (231:89): [True: 9.22M, False: 3]
  ------------------
  232|  9.22M|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 9.22M, False: 6]
  |  Branch (232:52): [True: 9.22M, False: 9]
  ------------------
  233|  9.22M|                           ++tag_end;
  234|  9.22M|                        }
  235|    164|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|    164|                        const auto second_bang = tag_token.find('!', 1);
  237|    164|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 125, False: 39]
  ------------------
  238|    125|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|    125|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 125, False: 0]
  |  Branch (239:49): [True: 121, False: 4]
  ------------------
  240|    121|                              ctx.error = error_code::syntax_error;
  241|    121|                              return;
  242|    121|                           }
  243|    125|                        }
  244|    164|                     }
  245|    240|                     return; // Additional documents are allowed in the stream tail.
  246|    361|                  }
  247|  1.46k|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 1.46k, False: 0]
  |  Branch (247:38): [True: 16, False: 1.44k]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     16|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 10, False: 6]
  ------------------
  251|     10|                        ctx.error = error_code::syntax_error;
  252|     10|                        return;
  253|     10|                     }
  254|      6|                     return;
  255|     16|                  }
  256|  1.44k|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 209, False: 1.23k]
  ------------------
  257|    209|                     return; // Implicit next document after explicit document end marker.
  258|    209|                  }
  259|  1.23k|                  ctx.error = error_code::syntax_error;
  260|  1.23k|                  return;
  261|  1.44k|               }
  262|  13.3k|            }
  263|   121k|         }
  264|   121k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.64M|      {
  275|  1.64M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.64M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.64M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.64M|      }
_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_:
 5752|  2.15M|      {
 5753|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5754|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5755|  2.15M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  2.15M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  2.15M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  2.15M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  2.15M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 2.15M]
  ------------------
 5760|      0|            return;
 5761|       |
 5762|       |         // No depth is taken here: the sequence and mapping readers this dispatches to count the
 5763|       |         // levels, so a scalar at the bottom of a document costs nothing, as in JSON. The one way
 5764|       |         // back into this reader that opens no collection is `redispatch`, which counts itself.
 5765|       |
 5766|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5767|       |         // For nested values, only skip inline whitespace to preserve block structure
 5768|  2.15M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 363k, False: 1.79M]
  ------------------
 5769|   363k|            yaml::skip_ws_newlines_comments(it, end);
 5770|   363k|         }
 5771|  1.79M|         else {
 5772|  1.79M|            yaml::skip_inline_ws(it, end);
 5773|  1.79M|         }
 5774|       |
 5775|  2.15M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 132, False: 2.15M]
  ------------------
 5776|    132|            ctx.error = error_code::unexpected_end;
 5777|    132|            return;
 5778|    132|         }
 5779|       |
 5780|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5781|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5782|       |         // same variant definitions round-trip across both formats.
 5783|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5784|       |            using V = std::remove_cvref_t<T>;
 5785|       |            const bool value_is_mapping =
 5786|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5787|       |            if (value_is_mapping) {
 5788|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5789|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5790|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5791|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5792|       |               auto tag_ctx = ctx.make_speculative();
 5793|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5794|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5795|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5796|       |               if (index < ids_v<V>.size()) {
 5797|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5798|       |                  emplace_runtime_variant(value, index);
 5799|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5800|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5801|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5802|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5803|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5804|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5805|       |                     return;
 5806|       |                  }
 5807|       |                  std::visit(
 5808|       |                     [&](auto&& alt) {
 5809|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5810|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5811|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5812|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5813|       |                        }
 5814|       |                        else if constexpr (custom_read<Alt>) {
 5815|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5816|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5817|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5818|       |                           // entry, then hand the remaining mapping to the custom handler.
 5819|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5820|       |                              ctx.error = error_code::feature_not_supported;
 5821|       |                              ctx.custom_error_message =
 5822|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5823|       |                           }
 5824|       |                           else {
 5825|       |                              ctx.scratch.clear();
 5826|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5827|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5828|       |                                    ctx.error = error_code::feature_not_supported;
 5829|       |                                    ctx.custom_error_message =
 5830|       |                                       "the tag must be the first key for a custom variant alternative";
 5831|       |                                 }
 5832|       |                                 else {
 5833|       |                                    yaml::skip_inline_ws(it, end);
 5834|       |                                    if (it == end || *it != ':') {
 5835|       |                                       ctx.error = error_code::syntax_error;
 5836|       |                                    }
 5837|       |                                    else {
 5838|       |                                       ++it;
 5839|       |                                       yaml::skip_inline_ws(it, end);
 5840|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5841|       |                                       if (!bool(ctx.error)) {
 5842|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5843|       |                                          // was the whole mapping: leave the alternative default.
 5844|       |                                          auto probe = it;
 5845|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5846|       |                                          if (probe == end) {
 5847|       |                                             it = probe;
 5848|       |                                          }
 5849|       |                                          else {
 5850|       |                                             // Publish the mapping's column so the custom handler's block
 5851|       |                                             // mapping (which would otherwise discover its own indent) reads
 5852|       |                                             // the remaining entries at the variant's indent and dedents
 5853|       |                                             // correctly in every context (root, sequence, nested).
 5854|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5855|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5856|       |                                             ctx.forced_block_mapping_indent = -1;
 5857|       |                                          }
 5858|       |                                       }
 5859|       |                                    }
 5860|       |                                 }
 5861|       |                              }
 5862|       |                           }
 5863|       |                        }
 5864|       |                        else {
 5865|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5866|       |                           // the value, but the mapping must still be consumed.
 5867|       |                           walk_tagged_mapping<Opts>(
 5868|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5869|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5870|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5871|       |                              });
 5872|       |                        }
 5873|       |                     },
 5874|       |                     value);
 5875|       |                  ctx.pop_indent();
 5876|       |                  return;
 5877|       |               }
 5878|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5879|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5880|       |               // otherwise the deduction path reports no_matching_variant_type.
 5881|       |            }
 5882|       |         }
 5883|       |
 5884|  2.15M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  2.15M|            using V = std::remove_cvref_t<T>;
 5886|  2.15M|            using counts = yaml_variant_type_count<V>;
 5887|  2.15M|            const char c = *it;
 5888|  2.15M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  2.15M|               switch (ch) {
 5890|  2.15M|               case ' ':
 5891|  2.15M|               case '\t':
 5892|  2.15M|               case '\n':
 5893|  2.15M|               case '\r':
 5894|  2.15M|               case ',':
 5895|  2.15M|               case ']':
 5896|  2.15M|               case '}':
 5897|  2.15M|                  return true;
 5898|  2.15M|               default:
 5899|  2.15M|                  return false;
 5900|  2.15M|               }
 5901|  2.15M|            };
 5902|       |
 5903|  2.15M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  2.15M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  2.15M|                  return false;
 5906|  2.15M|               }
 5907|  2.15M|               if (ctx.current_indent() < 0) {
 5908|  2.15M|                  return false;
 5909|  2.15M|               }
 5910|  2.15M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  2.15M|                  return false;
 5912|  2.15M|               }
 5913|       |
 5914|  2.15M|               auto look = word_end;
 5915|  2.15M|               yaml::skip_newline(look, end);
 5916|  2.15M|               while (look != end) {
 5917|  2.15M|                  int32_t line_indent = 0;
 5918|  2.15M|                  while (look != end && *look == ' ') {
 5919|  2.15M|                     ++line_indent;
 5920|  2.15M|                     ++look;
 5921|  2.15M|                  }
 5922|  2.15M|                  if (look != end && *look == '\t') {
 5923|  2.15M|                     return false;
 5924|  2.15M|                  }
 5925|  2.15M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  2.15M|                     if (look != end) {
 5927|  2.15M|                        yaml::skip_newline(look, end);
 5928|  2.15M|                        continue;
 5929|  2.15M|                     }
 5930|  2.15M|                     return false;
 5931|  2.15M|                  }
 5932|  2.15M|                  if (*look == '#') {
 5933|  2.15M|                     yaml::skip_comment(look, end);
 5934|  2.15M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  2.15M|                        yaml::skip_newline(look, end);
 5936|  2.15M|                        continue;
 5937|  2.15M|                     }
 5938|  2.15M|                     return false;
 5939|  2.15M|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  2.15M|                  {
 5945|  2.15M|                     auto scan = look;
 5946|  2.15M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  2.15M|                        if (*scan == ':') {
 5948|  2.15M|                           auto after_colon = scan + 1;
 5949|  2.15M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  2.15M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  2.15M|                              return false;
 5952|  2.15M|                           }
 5953|  2.15M|                        }
 5954|  2.15M|                        ++scan;
 5955|  2.15M|                     }
 5956|  2.15M|                  }
 5957|       |
 5958|  2.15M|                  return line_indent > ctx.current_indent();
 5959|  2.15M|               }
 5960|  2.15M|               return false;
 5961|  2.15M|            };
 5962|  2.15M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  2.15M|               if (ptr == end) {
 5964|  2.15M|                  return true;
 5965|  2.15M|               }
 5966|  2.15M|               if (*ptr == ':') {
 5967|  2.15M|                  auto next = ptr + 1;
 5968|  2.15M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  2.15M|               }
 5970|  2.15M|               return is_plain_scalar_boundary(*ptr);
 5971|  2.15M|            };
 5972|       |
 5973|  2.15M|            switch (c) {
 5974|   385k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 385k, False: 1.77M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   385k|               ++it;
 5977|   385k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   385k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 401, False: 385k]
  ------------------
 5979|    401|                  ctx.error = error_code::syntax_error;
 5980|    401|                  return;
 5981|    401|               }
 5982|   385k|               yaml::skip_inline_ws(it, end);
 5983|   385k|               bool anchor_on_same_line = true;
 5984|   385k|               bool value_is_indentless_sequence = false;
 5985|   385k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 4.35k, False: 381k]
  |  Branch (5985:33): [True: 23.5k, False: 357k]
  |  Branch (5985:48): [True: 37.1k, False: 320k]
  |  Branch (5985:63): [True: 23.2k, False: 297k]
  ------------------
 5986|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5987|       |                  // next line (indented past current context) or if this is an empty node.
 5988|  88.3k|                  bool value_on_next_line = false;
 5989|  88.3k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 83.9k, False: 4.35k]
  ------------------
 5990|  83.9k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|  83.9k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 23.2k, False: 60.7k]
  ------------------
 5993|   320k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 318k, False: 1.55k]
  |  Branch (5993:47): [True: 311k, False: 7.56k]
  |  Branch (5993:64): [True: 296k, False: 14.1k]
  ------------------
 5994|  23.2k|                     }
 5995|       |                     // Skip newline
 5996|  83.9k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 82.4k, False: 1.55k]
  |  Branch (5996:42): [True: 31.1k, False: 51.2k]
  |  Branch (5996:59): [True: 51.2k, False: 0]
  ------------------
 5997|  82.4k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   138k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 133k, False: 5.68k]
  |  Branch (5999:48): [True: 34.3k, False: 98.8k]
  |  Branch (5999:65): [True: 22.1k, False: 76.7k]
  ------------------
 6000|  56.5k|                           yaml::skip_newline(peek, end);
 6001|  56.5k|                        }
 6002|       |                        // Measure indent of next content line
 6003|  82.4k|                        int32_t next_indent = 0;
 6004|   276k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 269k, False: 6.83k]
  |  Branch (6004:47): [True: 194k, False: 75.5k]
  ------------------
 6005|   194k|                           ++next_indent;
 6006|   194k|                           ++peek;
 6007|   194k|                        }
 6008|  82.4k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 75.5k, False: 6.83k]
  |  Branch (6008:44): [True: 74.1k, False: 1.44k]
  |  Branch (6008:61): [True: 72.2k, False: 1.85k]
  ------------------
 6009|  72.2k|                           const bool indentless_sequence =
 6010|  72.2k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 63.4k, False: 8.81k]
  |  Branch (6010:69): [True: 28.7k, False: 34.6k]
  ------------------
 6011|  28.7k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 912, False: 27.8k]
  ------------------
 6012|  27.8k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 26.2k, False: 1.62k]
  ------------------
 6013|  27.1k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 12.7k, False: 14.4k]
  ------------------
 6014|  14.4k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 10.5k, False: 3.90k]
  |  Branch (6014:61): [True: 5.50k, False: 5.03k]
  ------------------
 6015|  72.2k|                           value_is_indentless_sequence = indentless_sequence;
 6016|  72.2k|                           const bool same_indent_property_node =
 6017|  72.2k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 26.0k, False: 46.2k]
  ------------------
 6018|  26.0k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 2.73k, False: 23.2k]
  |  Branch (6018:48): [True: 4.60k, False: 18.6k]
  |  Branch (6018:64): [True: 798, False: 17.8k]
  |  Branch (6018:80): [True: 676, False: 17.2k]
  |  Branch (6018:96): [True: 1.21k, False: 15.9k]
  ------------------
 6019|  15.9k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 759, False: 15.2k]
  |  Branch (6019:48): [True: 995, False: 14.2k]
  |  Branch (6019:65): [True: 762, False: 13.4k]
  |  Branch (6019:81): [True: 210, False: 13.2k]
  ------------------
 6020|  72.2k|                           value_on_next_line =
 6021|  72.2k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 26.9k, False: 45.3k]
  |  Branch (6021:71): [True: 18.2k, False: 27.0k]
  |  Branch (6021:94): [True: 12.7k, False: 14.3k]
  ------------------
 6022|  72.2k|                        }
 6023|  82.4k|                     }
 6024|  83.9k|                  }
 6025|  88.3k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 30.3k, False: 57.9k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  30.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  30.3k|                     return;
 6029|  30.3k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|  57.9k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 16.4k, False: 41.5k]
  ------------------
 6032|   215k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 215k, False: 0]
  |  Branch (6032:42): [True: 210k, False: 5.57k]
  |  Branch (6032:57): [True: 199k, False: 10.8k]
  ------------------
 6033|  16.4k|                  }
 6034|  57.9k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 57.9k, False: 0]
  ------------------
 6035|  99.3k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 99.3k, False: 0]
  |  Branch (6035:40): [True: 33.2k, False: 66.1k]
  |  Branch (6035:55): [True: 8.16k, False: 57.9k]
  ------------------
 6036|  41.4k|                     yaml::skip_newline(it, end);
 6037|  41.4k|                  }
 6038|  57.9k|                  yaml::skip_inline_ws(it, end);
 6039|  57.9k|                  anchor_on_same_line = false;
 6040|  57.9k|               }
 6041|       |
 6042|   355k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|   355k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6043:23): [True: 297k, False: 57.9k]
  |  Branch (6043:46): [True: 16.1k, False: 281k]
  ------------------
 6044|  16.1k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6044:24): [True: 8, False: 16.1k]
  |  Branch (6044:43): [True: 28, False: 16.1k]
  ------------------
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|     36|                     ctx.error = error_code::syntax_error;
 6047|     36|                     return;
 6048|     36|                  }
 6049|   355k|               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   355k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 355k, False: 59]
  |  Branch (6053:33): [True: 2.91k, False: 352k]
  |  Branch (6053:47): [True: 324, False: 2.59k]
  ------------------
 6054|    324|                  ctx.error = error_code::syntax_error;
 6055|    324|                  return;
 6056|    324|               }
 6057|       |
 6058|   354k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|   354k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6059:23): [True: 57.8k, False: 296k]
  |  Branch (6059:47): [True: 57.8k, False: 23]
  |  Branch (6059:60): [True: 6.66k, False: 51.2k]
  ------------------
 6060|  6.66k|                     auto probe = it + 1;
 6061|  6.66k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|  6.66k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6062:26): [True: 47, False: 6.61k]
  ------------------
 6063|     47|                        ctx.error = error_code::syntax_error;
 6064|     47|                        return;
 6065|     47|                     }
 6066|  6.61k|                     yaml::skip_inline_ws(probe, end);
 6067|       |                     // Allow nested anchor usage only when it clearly starts a
 6068|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6069|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6070|  6.61k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6070:26): [True: 209, False: 6.40k]
  ------------------
 6071|    209|                        ctx.error = error_code::syntax_error;
 6072|    209|                        return;
 6073|    209|                     }
 6074|  6.61k|                  }
 6075|   354k|               }
 6076|       |
 6077|   354k|               const char* anchor_start = &*it;
 6078|   354k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|   354k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6081|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6082|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6083|       |                  // next line, the anchor applies to the entire next-line content.
 6084|   354k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6084:23): [True: 296k, False: 57.9k]
  |  Branch (6084:46): [True: 145k, False: 151k]
  ------------------
 6085|   145k|                     auto key_start = it;
 6086|   145k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6086:26): [True: 2.35k, False: 142k]
  ------------------
 6087|  2.35k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|  2.35k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6088:29): [True: 10, False: 2.34k]
  |  Branch (6088:67): [True: 10, False: 2.33k]
  ------------------
 6089|     20|                           ctx.error = error_code::syntax_error;
 6090|     20|                           return;
 6091|     20|                        }
 6092|  2.33k|                        yaml::skip_inline_ws(key_start, end);
 6093|  2.33k|                        if (key_start == end) {
  ------------------
  |  Branch (6093:29): [True: 6, False: 2.33k]
  ------------------
 6094|      6|                           ctx.error = error_code::unexpected_end;
 6095|      6|                           return;
 6096|      6|                        }
 6097|  2.33k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6097:29): [True: 3, False: 2.32k]
  |  Branch (6097:51): [True: 3, False: 2.32k]
  ------------------
 6098|      6|                           ctx.error = error_code::syntax_error;
 6099|      6|                           return;
 6100|      6|                        }
 6101|       |
 6102|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6103|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6104|       |                        // key-span registration below while the untagged spelling was rejected;
 6105|       |                        // an alias node carries no other properties either way.
 6106|  2.32k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6106:29): [True: 497, False: 1.82k]
  |  Branch (6106:50): [True: 10, False: 487]
  ------------------
 6107|     10|                           ctx.error = error_code::syntax_error;
 6108|     10|                           return;
 6109|     10|                        }
 6110|  2.32k|                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|   145k|                     auto key_scan = key_start;
 6114|   145k|                     auto key_end = key_start;
 6115|   145k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6115:26): [True: 1.89k, False: 143k]
  |  Branch (6115:46): [True: 1.11k, False: 142k]
  ------------------
 6116|       |                        // Quoted key: skip to closing quote
 6117|  3.01k|                        const char quote = *key_scan;
 6118|  3.01k|                        ++key_scan;
 6119|  22.8k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6119:32): [True: 22.8k, False: 8]
  |  Branch (6119:51): [True: 19.8k, False: 3.00k]
  ------------------
 6120|  19.8k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6120:32): [True: 1.30k, False: 18.5k]
  |  Branch (6120:53): [True: 679, False: 622]
  ------------------
 6121|    679|                              ++key_scan;
 6122|    679|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6122:35): [True: 679, False: 0]
  ------------------
 6123|    679|                           }
 6124|  19.1k|                           else {
 6125|  19.1k|                              ++key_scan;
 6126|  19.1k|                           }
 6127|  19.8k|                        }
 6128|  3.01k|                        if (key_scan == end) {
  ------------------
  |  Branch (6128:29): [True: 8, False: 3.00k]
  ------------------
 6129|      8|                           ctx.error = error_code::syntax_error;
 6130|      8|                           return;
 6131|      8|                        }
 6132|  3.00k|                        ++key_scan; // past closing quote
 6133|  3.00k|                        key_end = key_scan;
 6134|  3.00k|                        yaml::skip_inline_ws(key_scan, end);
 6135|  3.00k|                     }
 6136|   142k|                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|  2.33M|                        while (key_scan != end) {
  ------------------
  |  Branch (6138:32): [True: 2.33M, False: 7]
  ------------------
 6139|  2.33M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6139:32): [True: 272k, False: 2.06M]
  ------------------
 6140|   272k|                              auto next = key_scan + 1;
 6141|   272k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6141:35): [True: 16.4k, False: 255k]
  |  Branch (6141:50): [True: 102k, False: 153k]
  |  Branch (6141:66): [True: 4.80k, False: 148k]
  |  Branch (6141:83): [True: 10.9k, False: 137k]
  |  Branch (6141:100): [True: 7.03k, False: 130k]
  ------------------
 6142|   142k|                                 break;
 6143|   142k|                              }
 6144|   272k|                           }
 6145|  2.19M|                           ++key_scan;
 6146|  2.19M|                        }
 6147|   142k|                        key_end = key_scan;
 6148|   166k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6148:32): [True: 155k, False: 11.1k]
  |  Branch (6148:57): [True: 23.3k, False: 132k]
  |  Branch (6148:82): [True: 1.42k, False: 130k]
  ------------------
 6149|  24.8k|                           --key_end;
 6150|  24.8k|                        }
 6151|   142k|                     }
 6152|   145k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6152:26): [True: 8, False: 145k]
  |  Branch (6152:45): [True: 59, False: 144k]
  ------------------
 6153|     67|                        ctx.error = error_code::syntax_error;
 6154|     67|                        return;
 6155|     67|                     }
 6156|       |                     // Store anchor with just the key text span
 6157|   144k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|   144k|                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|   144k|                     if constexpr (counts::n_object > 0) {
 6161|   144k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|   144k|                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|   144k|                     return;
 6168|   145k|                  }
 6169|   354k|               }
 6170|       |
 6171|   209k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   354k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   354k|               redispatch<Opts>(value, ctx, it, end);
 6174|   354k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   354k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 195k, False: 159k]
  ------------------
 6176|   195k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|   195k|               }
 6178|   354k|               return;
 6179|   355k|            }
 6180|   278k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 278k, False: 1.88M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|   278k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|   278k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6183:23): [True: 21.9k, False: 256k]
  ------------------
 6184|  21.9k|                     if constexpr (counts::n_object > 0) {
 6185|  21.9k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|  21.9k|                                                                                                        end);
 6187|  21.9k|                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|  21.9k|                  }
 6194|   278k|               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   278k|               return;
 6199|   355k|            }
 6200|   225k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 225k, False: 1.93M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   225k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   225k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 318, False: 224k]
  ------------------
 6204|    318|                  ctx.error = error_code::syntax_error;
 6205|    318|                  return;
 6206|    318|               }
 6207|   224k|               yaml::skip_inline_ws(it, end);
 6208|   224k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 223k, False: 1.55k]
  |  Branch (6208:33): [True: 26.1k, False: 196k]
  ------------------
 6209|  26.1k|                  yaml::skip_comment(it, end);
 6210|  26.1k|               }
 6211|   224k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 222k, False: 2.45k]
  |  Branch (6211:34): [True: 40.5k, False: 181k]
  |  Branch (6211:49): [True: 29.9k, False: 151k]
  ------------------
 6212|  70.4k|                  auto content = it;
 6213|  70.4k|                  yaml::skip_newline(content, end);
 6214|  70.4k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|  70.4k|                  bool consume_following_content = false;
 6217|  70.4k|                  auto content_token = content;
 6218|  70.4k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 65.9k, False: 4.53k]
  ------------------
 6219|  65.9k|                     auto indent_probe = content;
 6220|  65.9k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  65.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 12, False: 65.9k]
  ------------------
 6222|     12|                        return;
 6223|  65.9k|                     content_token = indent_probe;
 6224|       |
 6225|       |                     // A tag at the end of a sequence/map entry has an empty value
 6226|       |                     // unless the next non-empty content is nested under the current node.
 6227|  65.9k|                     bool tagged_indentless_sequence = false;
 6228|  65.9k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 7.38k, False: 58.5k]
  |  Branch (6228:56): [True: 7.38k, False: 0]
  |  Branch (6228:79): [True: 6.20k, False: 1.17k]
  ------------------
 6229|  6.20k|                        const auto after_dash = indent_probe + 1;
 6230|  6.20k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 746, False: 5.46k]
  ------------------
 6231|  5.47k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 4.73k, False: 731]
  ------------------
 6232|  5.47k|                           tagged_indentless_sequence =
 6233|  5.47k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 1.82k, False: 3.65k]
  ------------------
 6234|  3.65k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 1.76k, False: 1.89k]
  |  Branch (6234:60): [True: 1.46k, False: 291]
  ------------------
 6235|  5.47k|                        }
 6236|  6.20k|                     }
 6237|       |
 6238|  65.9k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 5.55k, False: 60.3k]
  ------------------
 6239|  60.3k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 14.2k, False: 46.1k]
  |  Branch (6239:93): [True: 3.29k, False: 42.8k]
  ------------------
 6240|  65.9k|                  }
 6241|       |
 6242|  70.4k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 23.1k, False: 47.3k]
  ------------------
 6243|  23.1k|                     it = content_token;
 6244|  23.1k|                  }
 6245|  47.3k|                  else {
 6246|  47.3k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 8.87k, False: 38.4k]
  ------------------
 6247|  8.87k|                        if constexpr (counts::n_str > 0) {
 6248|  8.87k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  8.87k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  8.87k|                           value = StrType{};
 6251|  8.87k|                           return;
 6252|  8.87k|                        }
 6253|  8.87k|                     }
 6254|  47.3k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 780, False: 46.5k]
  ------------------
 6255|    780|                        if constexpr (counts::n_null > 0) {
 6256|    780|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    780|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    780|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 780]
  ------------------
 6259|    780|                           return;
 6260|    780|                        }
 6261|    780|                     }
 6262|  47.3k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 35.5k, False: 11.7k]
  ------------------
 6263|  35.5k|                        if constexpr (counts::n_null > 0) {
 6264|  35.5k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  35.5k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  35.5k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 35.5k]
  ------------------
 6267|  35.5k|                           return;
 6268|  35.5k|                        }
 6269|  35.5k|                     }
 6270|  47.3k|                  }
 6271|  70.4k|               }
 6272|   224k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6273|       |                  // In block context, a comma immediately after a tag token is malformed
 6274|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6275|   224k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6275:23): [True: 176k, False: 47.7k]
  |  Branch (6275:36): [True: 44, False: 176k]
  ------------------
 6276|     44|                     ctx.error = error_code::syntax_error;
 6277|     44|                     return;
 6278|     44|                  }
 6279|   224k|                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|   224k|                     const bool starts_block_sequence_entry =
 6282|   224k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6282:26): [True: 176k, False: 47.7k]
  |  Branch (6282:39): [True: 10.8k, False: 166k]
  ------------------
 6283|  10.8k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6283:26): [True: 1.56k, False: 9.26k]
  |  Branch (6283:45): [True: 7.23k, False: 2.03k]
  ------------------
 6284|   224k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6284:26): [True: 170k, False: 54.0k]
  |  Branch (6284:58): [True: 45.9k, False: 124k]
  ------------------
 6285|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6286|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6287|  45.9k|                        redispatch<Opts>(value, ctx, it, end);
 6288|  45.9k|                        return;
 6289|  45.9k|                     }
 6290|   224k|                  }
 6291|   224k|               }
 6292|   224k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 2.45k, False: 222k]
  ------------------
 6293|  2.45k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 806, False: 1.64k]
  ------------------
 6294|    806|                     if constexpr (counts::n_str > 0) {
 6295|    806|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|    806|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|    806|                        value = StrType{};
 6298|    806|                        return;
 6299|    806|                     }
 6300|    806|                  }
 6301|  2.45k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 1.61k, False: 838]
  ------------------
 6302|  1.61k|                     if constexpr (counts::n_null > 0) {
 6303|  1.61k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  1.61k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  1.61k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 1.61k]
  ------------------
 6306|  1.61k|                        return;
 6307|  1.61k|                     }
 6308|  1.61k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  2.45k|                  return;
 6311|  2.45k|               }
 6312|   222k|               switch (tag) {
 6313|  3.51k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 3.51k, False: 218k]
  ------------------
 6314|  3.51k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  3.51k|                  return;
 6316|  3.82k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 3.82k, False: 218k]
  ------------------
 6317|  4.26k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 443, False: 221k]
  ------------------
 6318|  4.26k|                  if constexpr (counts::n_num > 0) {
 6319|  4.26k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  4.26k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  32.5k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 28.2k, False: 193k]
  ------------------
 6327|  32.5k|                  if constexpr (counts::n_bool > 0) {
 6328|  32.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  32.5k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  33.4k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 942, False: 221k]
  ------------------
 6336|  33.4k|                  if constexpr (counts::n_null > 0) {
 6337|  33.4k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  33.4k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  33.4k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 33.4k]
  ------------------
 6340|  33.4k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  33.4k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  48.3k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 14.8k, False: 207k]
  ------------------
 6348|  48.3k|                  if constexpr (counts::n_object > 0) {
 6349|  48.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  48.3k|                                                                                                     end);
 6351|  48.3k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  67.8k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 19.5k, False: 202k]
  ------------------
 6358|  67.8k|                  if constexpr (counts::n_array > 0) {
 6359|  67.8k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|  67.8k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|  67.8k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6361:29): [True: 19.5k, False: 48.3k]
  |  Branch (6361:42): [True: 5.63k, False: 13.8k]
  ------------------
 6362|  5.63k|                           ctx.allow_indentless_sequence = true;
 6363|  5.63k|                        }
 6364|  67.8k|                     }
 6365|  67.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  67.8k|                                                                                                    end);
 6367|  67.8k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  67.8k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   127k|               default: {
  ------------------
  |  Branch (6374:16): [True: 59.6k, False: 162k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   127k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 59.6k, False: 67.8k]
  |  Branch (6377:36): [True: 11.7k, False: 47.8k]
  ------------------
 6378|  11.7k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  11.7k|                     return;
 6380|  11.7k|                  }
 6381|       |
 6382|   115k|                  if constexpr (counts::n_array > 0) {
 6383|   115k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 47.8k, False: 67.8k]
  |  Branch (6383:39): [True: 1.04k, False: 46.8k]
  ------------------
 6384|  1.04k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  1.04k|                                                                                                       end);
 6386|  1.04k|                        return;
 6387|  1.04k|                     }
 6388|   115k|                  }
 6389|   115k|                  if constexpr (counts::n_object > 0) {
 6390|   115k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 46.8k, False: 68.8k]
  |  Branch (6390:39): [True: 1.45k, False: 45.3k]
  ------------------
 6391|  1.45k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  1.45k|                                                                                                        end);
 6393|  1.45k|                        return;
 6394|  1.45k|                     }
 6395|   115k|                  }
 6396|       |
 6397|   115k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|   115k|                     if constexpr (counts::n_array > 0) {
 6399|   115k|                        const bool starts_block_sequence_entry =
 6400|   115k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6400:29): [True: 45.3k, False: 70.3k]
  |  Branch (6400:42): [True: 4.10k, False: 41.2k]
  ------------------
 6401|  4.10k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6401:29): [True: 815, False: 3.28k]
  |  Branch (6401:48): [True: 2.42k, False: 859]
  ------------------
 6402|   115k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6402:29): [True: 3.24k, False: 112k]
  ------------------
 6403|  3.24k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|  3.24k|                                                                                                          it, end);
 6405|  3.24k|                           return;
 6406|  3.24k|                        }
 6407|   115k|                     }
 6408|   115k|                     if constexpr (counts::n_object > 0) {
 6409|   115k|                        const bool starts_explicit_mapping_indicator =
 6410|   115k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6410:29): [True: 42.1k, False: 73.5k]
  |  Branch (6410:43): [True: 4.52k, False: 37.5k]
  |  Branch (6410:57): [True: 1.71k, False: 35.8k]
  ------------------
 6411|  6.23k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6411:29): [True: 995, False: 5.24k]
  |  Branch (6411:48): [True: 3.30k, False: 1.93k]
  ------------------
 6412|   115k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6412:29): [True: 4.30k, False: 111k]
  ------------------
 6413|  4.30k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|  4.30k|                                                                                                           it, end);
 6415|  4.30k|                           return;
 6416|  4.30k|                        }
 6417|   111k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6417:29): [True: 0, False: 111k]
  ------------------
 6418|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6419|      0|                                                                                                           it, end);
 6420|      0|                           return;
 6421|      0|                        }
 6422|   111k|                     }
 6423|   115k|                  }
 6424|       |
 6425|   115k|                  if constexpr (counts::n_str > 0) {
 6426|   115k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   115k|                     return;
 6428|   115k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   115k|                  return;
 6433|   127k|               }
 6434|   222k|               }
 6435|      0|               return;
 6436|   222k|            }
 6437|  63.9k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 63.9k, False: 2.09M]
  ------------------
 6438|  63.9k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|  63.9k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6440:23): [True: 27.8k, False: 36.0k]
  |  Branch (6440:51): [True: 2.28k, False: 25.5k]
  ------------------
 6441|  2.28k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|  2.28k|                                                                                                     end);
 6443|  2.28k|                     return;
 6444|  2.28k|                  }
 6445|  63.9k|               }
 6446|       |               // Flow mapping - object type
 6447|  61.6k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  63.9k|               return;
 6449|  89.3k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 89.3k, False: 2.06M]
  ------------------
 6450|  89.3k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|  89.3k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6452:23): [True: 58.4k, False: 30.8k]
  |  Branch (6452:51): [True: 1.70k, False: 56.7k]
  ------------------
 6453|  1.70k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|  1.70k|                                                                                                     end);
 6455|  1.70k|                     return;
 6456|  1.70k|                  }
 6457|  89.3k|               }
 6458|       |               // Flow sequence - array type
 6459|  87.6k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  89.3k|               return;
 6461|   231k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 231k, False: 1.92M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   231k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 230k, False: 997]
  |  Branch (6463:39): [True: 9, False: 230k]
  ------------------
 6464|      9|                  ctx.error = error_code::syntax_error;
 6465|      9|                  return;
 6466|      9|               }
 6467|   231k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 230k, False: 997]
  |  Branch (6467:40): [True: 89.1k, False: 141k]
  |  Branch (6467:56): [True: 79.9k, False: 61.6k]
  |  Branch (6467:73): [True: 48.6k, False: 12.9k]
  ------------------
 6468|   217k|                  if constexpr (counts::n_object > 0) {
 6469|   217k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   217k|                                                                                                     end);
 6471|   217k|                     return;
 6472|   217k|                  }
 6473|   217k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   231k|               return;
 6476|     30|            case '%':
  ------------------
  |  Branch (6476:13): [True: 30, False: 2.15M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     30|               ctx.error = error_code::syntax_error;
 6479|     30|               return;
 6480|  5.49k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 5.49k, False: 2.15M]
  ------------------
 6481|  8.43k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 2.93k, False: 2.15M]
  ------------------
 6482|       |               // Could be a quoted string OR a quoted key in a block mapping
 6483|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6484|  8.43k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  8.43k|               return;
 6486|  32.1k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 32.1k, False: 2.12M]
  ------------------
 6487|  45.6k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 13.4k, False: 2.14M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  45.6k|               if constexpr (counts::n_bool > 0) {
 6490|  45.6k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 43.8k, False: 1.74k]
  |  Branch (6490:44): [True: 36.5k, False: 7.31k]
  |  Branch (6490:60): [True: 33.6k, False: 2.93k]
  |  Branch (6490:76): [True: 31.1k, False: 2.47k]
  ------------------
 6491|  33.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 4.29k, False: 8.42k]
  |  Branch (6491:60): [True: 3.44k, False: 850]
  |  Branch (6491:76): [True: 2.58k, False: 866]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  33.7k|                     const auto after_true = it + 4;
 6494|  33.7k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  33.7k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 32.0k, False: 1.66k]
  ------------------
 6497|  32.0k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 711, False: 31.3k]
  ------------------
 6498|    711|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|    711|                           return;
 6500|    711|                        }
 6501|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6502|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6503|  31.3k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 26.0k, False: 5.28k]
  |  Branch (6503:47): [True: 12.2k, False: 13.8k]
  ------------------
 6504|  12.2k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 7.95k, False: 4.25k]
  |  Branch (6504:47): [True: 1.73k, False: 2.51k]
  |  Branch (6504:63): [True: 777, False: 1.74k]
  |  Branch (6504:80): [True: 796, False: 945]
  |  Branch (6504:97): [True: 945, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  12.2k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  12.2k|                           return;
 6508|  12.2k|                        }
 6509|  19.1k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  19.1k|                                                                                                      end);
 6511|  19.1k|                        return;
 6512|  31.3k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  33.7k|                  }
 6515|  45.6k|               }
 6516|  13.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  45.6k|               return;
 6518|  30.5k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 30.5k, False: 2.12M]
  ------------------
 6519|  53.3k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 22.8k, False: 2.13M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  53.3k|               if constexpr (counts::n_bool > 0) {
 6522|  53.3k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 52.4k, False: 925]
  |  Branch (6522:44): [True: 38.1k, False: 14.3k]
  |  Branch (6522:60): [True: 36.0k, False: 2.07k]
  |  Branch (6522:76): [True: 27.4k, False: 8.58k]
  |  Branch (6522:92): [True: 25.1k, False: 2.28k]
  ------------------
 6523|  27.6k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 5.84k, False: 21.4k]
  |  Branch (6523:60): [True: 4.62k, False: 1.22k]
  |  Branch (6523:76): [True: 3.36k, False: 1.25k]
  |  Branch (6523:92): [True: 2.48k, False: 887]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  27.6k|                     const auto after_false = it + 5;
 6526|  27.6k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  27.6k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 24.7k, False: 2.94k]
  ------------------
 6529|  24.7k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 1.33k, False: 23.3k]
  ------------------
 6530|  1.33k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|  1.33k|                           return;
 6532|  1.33k|                        }
 6533|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6534|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6535|  23.3k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 23.0k, False: 385]
  |  Branch (6535:47): [True: 5.47k, False: 17.5k]
  ------------------
 6536|  5.47k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 773, False: 4.69k]
  |  Branch (6536:47): [True: 657, False: 4.04k]
  |  Branch (6536:63): [True: 1.30k, False: 2.73k]
  |  Branch (6536:80): [True: 816, False: 1.91k]
  |  Branch (6536:97): [True: 1.91k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  5.47k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  5.47k|                           return;
 6540|  5.47k|                        }
 6541|  17.9k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  17.9k|                                                                                                      end);
 6543|  17.9k|                        return;
 6544|  23.3k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  27.6k|                  }
 6547|  53.3k|               }
 6548|  28.6k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  53.3k|               return;
 6550|  13.0k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 13.0k, False: 2.14M]
  ------------------
 6551|  50.3k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 37.3k, False: 2.12M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  50.3k|               if constexpr (counts::n_null > 0) {
 6554|  50.3k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 49.4k, False: 912]
  |  Branch (6554:44): [True: 17.9k, False: 31.5k]
  |  Branch (6554:60): [True: 16.2k, False: 1.70k]
  |  Branch (6554:76): [True: 15.4k, False: 855]
  ------------------
 6555|  41.7k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 28.4k, False: 5.62k]
  |  Branch (6555:60): [True: 27.0k, False: 1.36k]
  |  Branch (6555:76): [True: 26.3k, False: 778]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  41.7k|                     const auto after_null = it + 4;
 6558|  41.7k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  41.7k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 34.6k, False: 7.09k]
  ------------------
 6561|  34.6k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 743, False: 33.8k]
  ------------------
 6562|    743|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|    743|                           return;
 6564|    743|                        }
 6565|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6566|       |                        // "null: value" should parse as {null: value}, not as the null type
 6567|  33.8k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 32.6k, False: 1.27k]
  |  Branch (6567:47): [True: 5.14k, False: 27.4k]
  ------------------
 6568|  5.14k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 781, False: 4.36k]
  |  Branch (6568:47): [True: 1.10k, False: 3.26k]
  |  Branch (6568:63): [True: 1.32k, False: 1.94k]
  |  Branch (6568:80): [True: 1.13k, False: 811]
  |  Branch (6568:97): [True: 811, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  5.14k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  5.14k|                           return;
 6572|  5.14k|                        }
 6573|  28.7k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  28.7k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  28.7k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 28.7k]
  ------------------
 6576|  28.7k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  28.7k|                        return;
 6578|  33.8k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  41.7k|                  }
 6581|  50.3k|               }
 6582|  15.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  50.3k|               return;
 6584|  4.12k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 4.12k, False: 2.15M]
  ------------------
 6585|       |               // Null indicator
 6586|  4.12k|               if constexpr (counts::n_null > 0) {
 6587|  4.12k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  4.12k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  4.12k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 4.12k]
  ------------------
 6590|  4.12k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  4.12k|                  return;
 6592|  4.12k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   134k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 134k, False: 2.02M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   134k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 1.81k, False: 132k]
  |  Branch (6596:41): [True: 105k, False: 27.3k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   107k|                  if constexpr (counts::n_array > 0) {
 6599|   107k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   107k|                                                                                                    end);
 6601|   107k|                     return;
 6602|   107k|                  }
 6603|   107k|               }
 6604|   134k|               if constexpr (counts::n_num > 0) {
 6605|   134k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 27.3k, False: 107k]
  |  Branch (6605:43): [True: 2.26k, False: 25.1k]
  |  Branch (6605:94): [True: 2.63k, False: 22.4k]
  ------------------
 6606|  4.89k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  4.89k|                     return;
 6608|  4.89k|                  }
 6609|   134k|               }
 6610|   129k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   134k|               return;
 6612|  8.49k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 8.49k, False: 2.15M]
  ------------------
 6613|  31.7k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 23.2k, False: 2.13M]
  ------------------
 6614|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6615|       |               // Try parsing as number speculatively, fall back to string on failure
 6616|  31.7k|               if constexpr (counts::n_num > 0) {
 6617|  31.7k|                  auto start_it = it;
 6618|  31.7k|                  auto temp_ctx = ctx.make_speculative();
 6619|  31.7k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  31.7k|                                                                                               end);
 6621|  31.7k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  31.7k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  31.7k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 10.7k, False: 20.9k]
  ------------------
 6624|  10.7k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  10.7k|                     return; // Successfully parsed as number
 6626|  10.7k|                  }
 6627|  20.9k|                  it = start_it; // Restore and fall through to string
 6628|  20.9k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  31.7k|               return;
 6631|   555k|            default:
  ------------------
  |  Branch (6631:13): [True: 555k, False: 1.60M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|   555k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 323k, False: 232k]
  |  Branch (6633:32): [True: 82.6k, False: 240k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  82.6k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 24.4k, False: 58.2k]
  ------------------
 6636|  24.4k|                     return;
 6637|  24.4k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  58.2k|                  if constexpr (counts::n_num > 0) {
 6640|  58.2k|                     auto start_it = it;
 6641|  58.2k|                     auto temp_ctx = ctx.make_speculative();
 6642|  58.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  58.2k|                                                                                                  end);
 6644|  58.2k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  58.2k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  58.2k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 6.37k, False: 51.8k]
  ------------------
 6647|  6.37k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  6.37k|                        return; // Successfully parsed as number
 6649|  6.37k|                     }
 6650|  51.8k|                     it = start_it; // Restore and fall through to string
 6651|  51.8k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|  58.2k|                  return;
 6655|  82.6k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   473k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   473k|               return;
 6659|  2.15M|            }
 6660|  2.15M|         }
 6661|       |
 6662|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6663|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6664|       |
 6665|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6666|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6667|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6668|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6669|  2.15M|         error_code expansion_error{};
 6670|  2.15M|         std::string_view expansion_message{};
 6671|       |
 6672|  2.15M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  2.15M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  2.15M|            auto start = it;
 6675|       |
 6676|  2.15M|            V v{};
 6677|  2.15M|            auto temp_ctx = ctx.make_speculative();
 6678|  2.15M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  2.15M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  2.15M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  2.15M|            if (!bool(temp_ctx.error)) {
 6683|  2.15M|               value = std::move(v);
 6684|  2.15M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  2.15M|               return true;
 6686|  2.15M|            }
 6687|       |
 6688|  2.15M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  2.15M|               expansion_error = temp_ctx.error;
 6690|  2.15M|               expansion_message = temp_ctx.custom_error_message;
 6691|  2.15M|            }
 6692|  2.15M|            it = start;
 6693|  2.15M|            return false;
 6694|  2.15M|         };
 6695|       |
 6696|  2.15M|         bool parsed = false;
 6697|  2.15M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  2.15M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  2.15M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  2.15M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 2.15M]
  ------------------
 6702|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6702:17): [True: 0, False: 0]
  ------------------
 6703|      0|               ctx.error = expansion_error;
 6704|      0|               ctx.custom_error_message = expansion_message;
 6705|      0|            }
 6706|      0|            else {
 6707|      0|               ctx.error = error_code::no_matching_variant_type;
 6708|      0|            }
 6709|      0|         }
 6710|  2.15M|      }
_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_:
 5310|   862k|      {
 5311|   862k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   862k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   862k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   862k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   862k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 862k, False: 0]
  ------------------
 5321|   862k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   862k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4616|   870k|      {
 4617|   870k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 870k]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|   870k|         yaml::node_preamble_state preamble{};
 4621|   870k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 11.2k, False: 859k]
  ------------------
 4622|   870k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  11.2k|            return;
 4624|       |
 4625|   859k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|   859k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 24, False: 859k]
  ------------------
 4627|     24|            return;
 4628|       |
 4629|   859k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|   859k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4631|       |
 4632|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4633|       |         // value of a key that existed before the read and adds new keys, while
 4634|       |         // pre-existing keys the document does not mention are preserved (like a
 4635|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4636|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4637|       |         // mappings disallow duplicate keys and the conformance suite expects
 4638|       |         // first-wins, which falls out of emplace into an empty map. Any
 4639|       |         // pre-existing entry the document leaves untouched is restored on scope
 4640|       |         // exit (including error paths). When the target starts empty (the common
 4641|       |         // case) this is a no-op with negligible cost.
 4642|   859k|         std::remove_cvref_t<T> preexisting_entries;
 4643|   859k|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 859k]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|   859k|         struct merge_restore_guard
 4648|   859k|         {
 4649|   859k|            std::remove_cvref_t<T>& target;
 4650|   859k|            std::remove_cvref_t<T>& saved;
 4651|   859k|            ~merge_restore_guard()
 4652|   859k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   859k|               for (auto& entry : saved) {
 4656|   859k|                  target.emplace(entry.first, std::move(entry.second));
 4657|   859k|               }
 4658|   859k|            }
 4659|   859k|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|   859k|         const bool treat_as_block_mapping =
 4662|   859k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [True: 859k, Folded]
  |  Branch (4662:48): [True: 77.1k, False: 781k]
  |  Branch (4662:62): [True: 1.16k, False: 76.0k]
  ------------------
 4663|       |
 4664|   859k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 77.1k, False: 781k]
  |  Branch (4664:28): [True: 76.0k, False: 1.16k]
  ------------------
 4665|       |            // Flow mapping
 4666|  76.0k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  76.0k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  76.0k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 74.2k, False: 1.79k]
  |  Branch (4670:30): [True: 13.7k, False: 60.4k]
  ------------------
 4671|  13.7k|               ++it;
 4672|  13.7k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  13.7k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 54, False: 13.7k]
  ------------------
 4674|     54|                  return;
 4675|  13.7k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  13.7k|               return;
 4677|  13.7k|            }
 4678|       |
 4679|   221k|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 214k, False: 6.63k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|   214k|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|   214k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 214k, False: 0]
  |  Branch (4683:33): [True: 9.27k, False: 205k]
  ------------------
 4684|  9.27k|                  ++it;
 4685|  9.27k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  9.27k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 49, False: 9.22k]
  ------------------
 4687|     49|                     return;
 4688|  9.22k|                  break;
 4689|  9.27k|               }
 4690|       |
 4691|   205k|               bool explicit_flow_key = false;
 4692|   205k|               auto explicit_probe = it;
 4693|   205k|               yaml::skip_inline_ws(explicit_probe, end);
 4694|   205k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 205k, False: 0]
  |  Branch (4694:45): [True: 7.03k, False: 198k]
  ------------------
 4695|  7.03k|                  const auto after_q = explicit_probe + 1;
 4696|  7.03k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 10, False: 7.02k]
  |  Branch (4696:41): [True: 2.87k, False: 4.14k]
  ------------------
 4697|  5.27k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 1.17k, False: 2.97k]
  |  Branch (4697:42): [True: 1.21k, False: 1.75k]
  ------------------
 4698|  5.27k|                     explicit_flow_key = true;
 4699|  5.27k|                     it = explicit_probe + 1;
 4700|  5.27k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  5.27k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 6, False: 5.27k]
  ------------------
 4702|      6|                        return;
 4703|  5.27k|                  }
 4704|  7.03k|               }
 4705|       |               // Parse key
 4706|   205k|               key_t key{};
 4707|   205k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|   205k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 5.27k, False: 200k]
  |  Branch (4708:44): [True: 5.24k, False: 22]
  |  Branch (4708:58): [True: 743, False: 4.50k]
  |  Branch (4708:72): [True: 1.82k, False: 2.68k]
  |  Branch (4708:86): [True: 1.45k, False: 1.22k]
  ------------------
 4709|  4.02k|                     key.clear();
 4710|  4.02k|                  }
 4711|   201k|                  else {
 4712|   201k|                     auto key_probe = it;
 4713|   201k|                     yaml::skip_inline_ws(key_probe, end);
 4714|       |
 4715|       |                     // Use full node parsing only for structurally complex flow keys.
 4716|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4717|   201k|                     bool parse_complex_flow_key = false;
 4718|   201k|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 201k, False: 22]
  ------------------
 4719|   201k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 1.90k, False: 199k]
  |  Branch (4719:50): [True: 8.16k, False: 191k]
  ------------------
 4720|  10.0k|                           parse_complex_flow_key = true;
 4721|  10.0k|                        }
 4722|   191k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 18.8k, False: 172k]
  ------------------
 4723|  18.8k|                           ++key_probe;
 4724|  18.8k|                           yaml::parse_anchor_name(key_probe, end);
 4725|  18.8k|                           yaml::skip_inline_ws(key_probe, end);
 4726|  18.8k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 18.7k, False: 150]
  |  Branch (4726:53): [True: 1.15k, False: 17.5k]
  |  Branch (4726:74): [True: 1.66k, False: 15.9k]
  ------------------
 4727|  2.82k|                              parse_complex_flow_key = true;
 4728|  2.82k|                           }
 4729|  18.8k|                        }
 4730|   201k|                     }
 4731|       |
 4732|   201k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 12.8k, False: 188k]
  ------------------
 4733|  12.8k|                        glz::generic key_node{};
 4734|  12.8k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  12.8k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 2.87k, False: 10.0k]
  ------------------
 4736|  2.87k|                           return;
 4737|  10.0k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 9, False: 10.0k]
  ------------------
 4738|      9|                           return;
 4739|  10.0k|                     }
 4740|   188k|                     else {
 4741|   188k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 6.63k, False: 181k]
  ------------------
 4742|  6.63k|                           return;
 4743|  6.63k|                        }
 4744|   188k|                     }
 4745|   201k|                  }
 4746|       |               }
 4747|       |               else {
 4748|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4749|       |                     ctx.error = error_code::syntax_error;
 4750|       |                     return;
 4751|       |                  }
 4752|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4753|       |                  if (bool(ctx.error)) [[unlikely]]
 4754|       |                     return;
 4755|       |               }
 4756|       |
 4757|       |               // Separation between flow key and ':' may include comments/newlines.
 4758|       |               // In flow context, newlines are allowed between key and ':'.
 4759|   195k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|   205k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 19, False: 205k]
  ------------------
 4761|     19|                  return;
 4762|       |
 4763|   205k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|   205k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|   205k|                     val = {};
 4766|   205k|                     return true;
 4767|   205k|                  }
 4768|   205k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   205k|                     val = glz::generic{};
 4770|   205k|                     return true;
 4771|   205k|                  }
 4772|   205k|                  else {
 4773|   205k|                     static constexpr std::string_view null_value{"null"};
 4774|   205k|                     auto null_it = null_value.data();
 4775|   205k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|   205k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|   205k|                     return !bool(ctx.error);
 4778|   205k|                  }
 4779|   205k|               };
 4780|       |
 4781|   205k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 194k, False: 10.6k]
  |  Branch (4781:34): [True: 125k, False: 69.4k]
  |  Branch (4781:48): [True: 17.3k, False: 52.0k]
  ------------------
 4782|   142k|                  val_t val{};
 4783|   142k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 142k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|   142k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|   142k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 17.3k, False: 125k]
  ------------------
 4789|  17.3k|                     ++it;
 4790|  17.3k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  17.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 112, False: 17.2k]
  ------------------
 4792|    112|                        return;
 4793|  17.2k|                     break;
 4794|  17.3k|                  }
 4795|       |
 4796|   125k|                  ++it; // skip comma
 4797|   125k|                  yaml::skip_ws_and_newlines(it, end);
 4798|   125k|                  continue;
 4799|   142k|               }
 4800|       |
 4801|  62.6k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 10.6k, False: 52.0k]
  |  Branch (4801:33): [True: 951, False: 51.0k]
  ------------------
 4802|  2.09k|                  ctx.error = error_code::syntax_error;
 4803|  2.09k|                  return;
 4804|  2.09k|               }
 4805|  60.6k|               ++it;
 4806|       |
 4807|  60.6k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  60.6k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 17, False: 60.5k]
  ------------------
 4809|     17|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  60.5k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 50.9k, False: 9.60k]
  |  Branch (4812:34): [True: 9.45k, False: 41.5k]
  |  Branch (4812:48): [True: 9.55k, False: 31.9k]
  ------------------
 4813|  19.0k|                  val_t val{};
 4814|  19.0k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 19.0k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  19.0k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  19.0k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 9.55k, False: 9.45k]
  ------------------
 4820|  9.55k|                     ++it;
 4821|  9.55k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  9.55k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 16, False: 9.54k]
  ------------------
 4823|     16|                        return;
 4824|  9.54k|                     break;
 4825|  9.55k|                  }
 4826|       |
 4827|  9.45k|                  ++it; // skip comma
 4828|  9.45k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  9.45k|                  continue;
 4830|  19.0k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  41.5k|               val_t val{};
 4834|  41.5k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  41.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 1.48k, False: 40.0k]
  ------------------
 4836|  1.48k|                  return;
 4837|       |
 4838|  40.0k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  40.0k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  40.0k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 30.3k, False: 9.78k]
  |  Branch (4842:33): [True: 4.73k, False: 25.5k]
  ------------------
 4843|  4.73k|                  ++it;
 4844|  4.73k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|  4.73k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 59, False: 4.67k]
  ------------------
 4846|     59|                     return;
 4847|  4.67k|                  break;
 4848|  4.73k|               }
 4849|  35.3k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 25.5k, False: 9.78k]
  |  Branch (4849:38): [True: 21.5k, False: 3.99k]
  ------------------
 4850|  21.5k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  21.5k|                  yaml::skip_ws_and_newlines(it, end);
 4853|  21.5k|               }
 4854|  13.7k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 3.99k, False: 9.78k]
  |  Branch (4854:39): [True: 1.43k, False: 2.56k]
  |  Branch (4854:54): [True: 2.35k, False: 205]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  3.78k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  3.78k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 3.71k, False: 74]
  |  Branch (4858:36): [True: 844, False: 2.87k]
  ------------------
 4859|    844|                     ++it;
 4860|    844|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|    844|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 6, False: 838]
  ------------------
 4862|      6|                        return;
 4863|    838|                     break;
 4864|    844|                  }
 4865|  2.94k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 2.87k, False: 74]
  |  Branch (4865:36): [True: 2.76k, False: 101]
  ------------------
 4866|  2.76k|                     ++it;
 4867|  2.76k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  2.76k|                     continue;
 4869|  2.76k|                  }
 4870|    175|                  ctx.error = error_code::syntax_error;
 4871|    175|                  return;
 4872|  2.94k|               }
 4873|  9.98k|               else {
 4874|  9.98k|                  ctx.error = error_code::syntax_error;
 4875|  9.98k|                  return;
 4876|  9.98k|               }
 4877|  40.0k|            }
 4878|  62.2k|         }
 4879|   783k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   783k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   783k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   783k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   783k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   783k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   783k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   783k|                           if (ctx.stream_begin) {
 4893|   783k|                              auto is_line_content_start = [&](auto pos) {
 4894|   783k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   783k|                              };
 4896|       |
 4897|   783k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   783k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   783k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   783k|                                 return line != end && *line == ':';
 4901|   783k|                              };
 4902|       |
 4903|   783k|                              if (!is_line_content_start(it) &&
 4904|   783k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   783k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   783k|                                 ctx.error = error_code::syntax_error;
 4907|   783k|                                 return false;
 4908|   783k|                              }
 4909|   783k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   783k|                           }
 4911|   783k|                        }
 4912|       |
 4913|   783k|                        if (*it == '-' &&
 4914|   783k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   783k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   783k|                           ctx.error = error_code::syntax_error;
 4918|   783k|                           return false;
 4919|   783k|                        }
 4920|       |
 4921|   783k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   783k|                           return false;
 4923|   783k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   783k|                        ctx.pop_indent();
 4925|   783k|                     }
 4926|   783k|                     else {
 4927|   783k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   783k|                        if (nested_indent >= 0) {
 4929|   783k|                           yaml::skip_to_content(it, end);
 4930|   783k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   783k|                              ctx.error = error_code::syntax_error;
 4932|   783k|                              return false;
 4933|   783k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   783k|                           const int32_t value_indent =
 4937|   783k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   783k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   783k|                              return false;
 4940|   783k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   783k|                           ctx.pop_indent();
 4942|   783k|                        }
 4943|   783k|                     }
 4944|   783k|                     return !bool(ctx.error);
 4945|   783k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   783k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   783k|                     ctx.error = error_code::syntax_error;
 4952|   783k|                     return false;
 4953|   783k|                  }
 4954|   783k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   783k|                     ++it; // skip '?'
 4956|   783k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   783k|                     const int32_t explicit_value_indicator_indent =
 4959|   783k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   783k|                     key_t key{};
 4962|   783k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   783k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   783k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   783k|                        };
 4966|       |
 4967|   783k|                        auto key_it = it;
 4968|   783k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   783k|                        auto content = key_it;
 4971|   783k|                        yaml::skip_to_content(content, end);
 4972|   783k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   783k|                        if (content != end && *content == '&') {
 4978|   783k|                           auto anchor_probe = content + 1;
 4979|   783k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   783k|                           if (!anchor_name.empty()) {
 4981|   783k|                              auto after_anchor = anchor_probe;
 4982|   783k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   783k|                              auto value_indicator = after_anchor;
 4985|   783k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   783k|                                 key.clear();
 4987|   783k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   783k|                                 it = value_indicator;
 4989|   783k|                                 handled_anchor_only_empty_key = true;
 4990|   783k|                              }
 4991|   783k|                              else {
 4992|   783k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   783k|                                    yaml::skip_comment(value_indicator, end);
 4994|   783k|                                 }
 4995|   783k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   783k|                                    yaml::skip_newline(value_indicator, end);
 4997|   783k|                                    auto value_line = value_indicator;
 4998|   783k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   783k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   783k|                                       return false;
 5001|   783k|                                    if (value_line != end && *value_line == ':' &&
 5002|   783k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   783k|                                       key.clear();
 5004|   783k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   783k|                                       it = value_line;
 5006|   783k|                                       handled_anchor_only_empty_key = true;
 5007|   783k|                                    }
 5008|   783k|                                    else if (value_line != end && *value_line == ':') {
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|   783k|                                       ctx.error = error_code::syntax_error;
 5013|   783k|                                       return false;
 5014|   783k|                                    }
 5015|   783k|                                 }
 5016|   783k|                              }
 5017|   783k|                           }
 5018|   783k|                        }
 5019|       |
 5020|   783k|                        const bool key_content_spans_lines = [&] {
 5021|   783k|                           auto scan = key_it;
 5022|   783k|                           while (scan != content && scan != end) {
 5023|   783k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   783k|                              ++scan;
 5025|   783k|                           }
 5026|   783k|                           return false;
 5027|   783k|                        }();
 5028|       |
 5029|   783k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   783k|                        }
 5032|   783k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   783k|                           key.clear();
 5034|   783k|                           it = content;
 5035|   783k|                        }
 5036|   783k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   783k|                           auto key_node_it = content;
 5042|   783k|                           auto key_node_end = end;
 5043|   783k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   783k|                              auto scan = content;
 5048|   783k|                              while (scan != end) {
 5049|   783k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   783k|                                    ++scan;
 5051|   783k|                                 }
 5052|   783k|                                 if (scan == end) {
 5053|   783k|                                    break;
 5054|   783k|                                 }
 5055|       |
 5056|   783k|                                 yaml::skip_newline(scan, end);
 5057|   783k|                                 auto line_start = scan;
 5058|       |
 5059|   783k|                                 int32_t indicator_indent = 0;
 5060|   783k|                                 while (scan != end && *scan == ' ') {
 5061|   783k|                                    ++indicator_indent;
 5062|   783k|                                    ++scan;
 5063|   783k|                                 }
 5064|       |
 5065|   783k|                                 if (scan != end && *scan == ':') {
 5066|   783k|                                    const auto after_colon = scan + 1;
 5067|   783k|                                    if ((after_colon == end ||
 5068|   783k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   783k|                                        indicator_indent <= line_indent) {
 5070|   783k|                                       key_node_end = line_start;
 5071|   783k|                                       break;
 5072|   783k|                                    }
 5073|   783k|                                 }
 5074|   783k|                              }
 5075|   783k|                           }
 5076|       |
 5077|   783k|                           glz::generic key_node{};
 5078|   783k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   783k|                           ctx.explicit_mapping_key_context = true;
 5080|   783k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   783k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   783k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   783k|                              return false;
 5084|   783k|                           it = key_node_it;
 5085|   783k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   783k|                              return false;
 5087|   783k|                        }
 5088|   783k|                     }
 5089|   783k|                     else {
 5090|   783k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   783k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   783k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   783k|                              return false;
 5094|   783k|                        }
 5095|   783k|                     }
 5096|       |
 5097|   783k|                     yaml::skip_inline_ws(it, end);
 5098|   783k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   783k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   783k|                        auto probe = it;
 5103|   783k|                        bool found_value_indicator = false;
 5104|       |
 5105|   783k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   783k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   783k|                           auto value_line = probe;
 5109|   783k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   783k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   783k|                              return false;
 5112|       |
 5113|   783k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   783k|                              probe = value_line;
 5115|   783k|                              continue; // blank line
 5116|   783k|                           }
 5117|   783k|                           if (*value_line == '#') {
 5118|   783k|                              yaml::skip_comment(value_line, end);
 5119|   783k|                              probe = value_line;
 5120|   783k|                              continue; // comment-only line
 5121|   783k|                           }
 5122|   783k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   783k|                              it = value_line;
 5124|   783k|                              found_value_indicator = true;
 5125|   783k|                           }
 5126|   783k|                           break;
 5127|   783k|                        }
 5128|       |
 5129|   783k|                        if (found_value_indicator) {
 5130|   783k|                           yaml::skip_inline_ws(it, end);
 5131|   783k|                        }
 5132|   783k|                     }
 5133|       |
 5134|   783k|                     val_t val{};
 5135|   783k|                     if (it != end && *it == ':') {
 5136|   783k|                        ++it;
 5137|   783k|                        if (it != end && *it == '\t') {
 5138|   783k|                           ctx.error = error_code::syntax_error;
 5139|   783k|                           return false;
 5140|   783k|                        }
 5141|   783k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   783k|                           auto probe = it;
 5143|   783k|                           yaml::skip_newline(probe, end);
 5144|   783k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   783k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   783k|                              ctx.error = error_code::syntax_error;
 5147|   783k|                              return false;
 5148|   783k|                           }
 5149|   783k|                        }
 5150|   783k|                        yaml::skip_inline_ws(it, end);
 5151|   783k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   783k|                           return false;
 5153|   783k|                     }
 5154|       |
 5155|   783k|                     value.emplace(std::move(key), std::move(val));
 5156|   783k|                     return true;
 5157|   783k|                  }
 5158|       |
 5159|   783k|                  key_t key{};
 5160|   783k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   783k|                     auto key_probe = it;
 5162|   783k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   783k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   783k|                     if (complex_flow_key) {
 5165|   783k|                        glz::generic key_node{};
 5166|   783k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   783k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   783k|                           return false;
 5169|   783k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   783k|                           return false;
 5171|   783k|                     }
 5172|   783k|                     else {
 5173|   783k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   783k|                           return false;
 5175|   783k|                        }
 5176|   783k|                     }
 5177|   783k|                  }
 5178|   783k|                  else {
 5179|   783k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   783k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   783k|                        return false;
 5182|   783k|                  }
 5183|       |
 5184|   783k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   783k|                  if (it == end || *it != ':') {
 5187|   783k|                     ctx.error = error_code::syntax_error;
 5188|   783k|                     return false;
 5189|   783k|                  }
 5190|   783k|                  ++it;
 5191|   783k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   783k|                  val_t val{};
 5194|   783k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   783k|                     return false;
 5196|       |
 5197|   783k|                  value.emplace(std::move(key), std::move(val));
 5198|   783k|                  return true;
 5199|   783k|               });
 5200|   783k|         }
 5201|       |
 5202|   831k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|   831k|      }
_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|   870k|      {
  466|   870k|         skip_inline_ws(it, end);
  467|       |
  468|   870k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 870k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|   870k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   870k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 10, False: 870k]
  ------------------
  477|     10|            ctx.error = error_code::syntax_error;
  478|     10|            return true;
  479|     10|         }
  480|   870k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 870k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   870k|         skip_inline_ws(it, end);
  486|       |
  487|   870k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 13, False: 870k]
  ------------------
  488|     13|            if constexpr (!AllowEmptyInput) {
  489|     13|               ctx.error = error_code::unexpected_end;
  490|     13|            }
  491|     13|            return true;
  492|     13|         }
  493|       |
  494|   870k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.1k, False: 859k]
  ------------------
  495|  11.1k|            return true;
  496|  11.1k|         }
  497|       |
  498|   859k|         return false;
  499|   870k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4622|   870k|                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|   870k|      {
  409|   870k|         state.has_anchor = false;
  410|   870k|         state.anchor_name.clear();
  411|   870k|         state.anchor_start = nullptr;
  412|   870k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   870k|         if constexpr (Policy.allow_alias) {
  415|   870k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   870k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 846k, False: 24.2k]
  ------------------
  417|   846k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 11.1k, False: 835k]
  ------------------
  418|   846k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   870k|         }
  424|       |
  425|   870k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 859k, False: 11.1k]
  |  Branch (425:27): [True: 61.4k, False: 797k]
  ------------------
  426|  61.4k|            ++it;
  427|  61.4k|            auto name = parse_anchor_name(it, end);
  428|  61.4k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 46, False: 61.3k]
  ------------------
  429|     46|               ctx.error = error_code::syntax_error;
  430|     46|               return true;
  431|     46|            }
  432|  61.3k|            skip_inline_ws(it, end);
  433|  61.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 13, False: 61.3k]
  ------------------
  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|  61.3k|            state.has_anchor = true;
  446|  61.3k|            state.anchor_name = std::string(name);
  447|  61.3k|            state.anchor_start = &*it;
  448|  61.3k|         }
  449|       |
  450|   870k|         return false;
  451|   870k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   846k|      {
  301|   846k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 846k]
  |  Branch (301:27): [True: 835k, False: 11.1k]
  ------------------
  302|       |
  303|  11.1k|         ++it; // skip '*'
  304|  11.1k|         auto name = parse_anchor_name(it, end);
  305|  11.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 34, False: 11.0k]
  ------------------
  306|     34|            ctx.error = error_code::syntax_error;
  307|     34|            return true;
  308|     34|         }
  309|       |
  310|  11.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 96, False: 10.9k]
  ------------------
  312|     96|            ctx.error = error_code::syntax_error; // undefined alias
  313|     96|            return true;
  314|     96|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  10.9k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  10.9k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.72k, False: 8.25k]
  ------------------
  322|  2.72k|            return true;
  323|  2.72k|         }
  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.25k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 51, False: 8.20k]
  ------------------
  329|     51|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     51|            return true;
  331|     51|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  8.20k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.20k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 8.19k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  8.19k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 8.19k]
  ------------------
  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|  8.19k|         auto replay_it = span.begin;
  348|  8.19k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.19k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.19k|         ctx.indent_stack.clear();
  353|  8.19k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 5.92k, False: 2.27k]
  ------------------
  354|  5.92k|            ctx.push_indent(span.base_indent - 1);
  355|  5.92k|         }
  356|       |
  357|  8.19k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.19k|         using V = std::remove_cvref_t<T>;
  360|  8.19k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.19k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.19k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.19k|         return true;
  367|  8.19k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  5.80M|      {
  275|  5.80M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  5.80M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  5.80M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  5.80M|      }
_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_:
 5752|  7.94M|      {
 5753|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5754|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5755|  7.94M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  7.94M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  7.94M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  7.94M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  7.94M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 7.94M]
  ------------------
 5760|      0|            return;
 5761|       |
 5762|       |         // No depth is taken here: the sequence and mapping readers this dispatches to count the
 5763|       |         // levels, so a scalar at the bottom of a document costs nothing, as in JSON. The one way
 5764|       |         // back into this reader that opens no collection is `redispatch`, which counts itself.
 5765|       |
 5766|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5767|       |         // For nested values, only skip inline whitespace to preserve block structure
 5768|  7.94M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 6.49M, False: 1.45M]
  ------------------
 5769|  6.49M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  6.49M|         }
 5771|  1.45M|         else {
 5772|  1.45M|            yaml::skip_inline_ws(it, end);
 5773|  1.45M|         }
 5774|       |
 5775|  7.94M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 460, False: 7.94M]
  ------------------
 5776|    460|            ctx.error = error_code::unexpected_end;
 5777|    460|            return;
 5778|    460|         }
 5779|       |
 5780|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5781|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5782|       |         // same variant definitions round-trip across both formats.
 5783|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5784|       |            using V = std::remove_cvref_t<T>;
 5785|       |            const bool value_is_mapping =
 5786|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5787|       |            if (value_is_mapping) {
 5788|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5789|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5790|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5791|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5792|       |               auto tag_ctx = ctx.make_speculative();
 5793|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5794|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5795|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5796|       |               if (index < ids_v<V>.size()) {
 5797|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5798|       |                  emplace_runtime_variant(value, index);
 5799|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5800|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5801|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5802|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5803|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5804|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5805|       |                     return;
 5806|       |                  }
 5807|       |                  std::visit(
 5808|       |                     [&](auto&& alt) {
 5809|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5810|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5811|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5812|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5813|       |                        }
 5814|       |                        else if constexpr (custom_read<Alt>) {
 5815|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5816|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5817|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5818|       |                           // entry, then hand the remaining mapping to the custom handler.
 5819|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5820|       |                              ctx.error = error_code::feature_not_supported;
 5821|       |                              ctx.custom_error_message =
 5822|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5823|       |                           }
 5824|       |                           else {
 5825|       |                              ctx.scratch.clear();
 5826|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5827|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5828|       |                                    ctx.error = error_code::feature_not_supported;
 5829|       |                                    ctx.custom_error_message =
 5830|       |                                       "the tag must be the first key for a custom variant alternative";
 5831|       |                                 }
 5832|       |                                 else {
 5833|       |                                    yaml::skip_inline_ws(it, end);
 5834|       |                                    if (it == end || *it != ':') {
 5835|       |                                       ctx.error = error_code::syntax_error;
 5836|       |                                    }
 5837|       |                                    else {
 5838|       |                                       ++it;
 5839|       |                                       yaml::skip_inline_ws(it, end);
 5840|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5841|       |                                       if (!bool(ctx.error)) {
 5842|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5843|       |                                          // was the whole mapping: leave the alternative default.
 5844|       |                                          auto probe = it;
 5845|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5846|       |                                          if (probe == end) {
 5847|       |                                             it = probe;
 5848|       |                                          }
 5849|       |                                          else {
 5850|       |                                             // Publish the mapping's column so the custom handler's block
 5851|       |                                             // mapping (which would otherwise discover its own indent) reads
 5852|       |                                             // the remaining entries at the variant's indent and dedents
 5853|       |                                             // correctly in every context (root, sequence, nested).
 5854|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5855|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5856|       |                                             ctx.forced_block_mapping_indent = -1;
 5857|       |                                          }
 5858|       |                                       }
 5859|       |                                    }
 5860|       |                                 }
 5861|       |                              }
 5862|       |                           }
 5863|       |                        }
 5864|       |                        else {
 5865|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5866|       |                           // the value, but the mapping must still be consumed.
 5867|       |                           walk_tagged_mapping<Opts>(
 5868|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5869|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5870|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5871|       |                              });
 5872|       |                        }
 5873|       |                     },
 5874|       |                     value);
 5875|       |                  ctx.pop_indent();
 5876|       |                  return;
 5877|       |               }
 5878|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5879|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5880|       |               // otherwise the deduction path reports no_matching_variant_type.
 5881|       |            }
 5882|       |         }
 5883|       |
 5884|  7.94M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  7.94M|            using V = std::remove_cvref_t<T>;
 5886|  7.94M|            using counts = yaml_variant_type_count<V>;
 5887|  7.94M|            const char c = *it;
 5888|  7.94M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  7.94M|               switch (ch) {
 5890|  7.94M|               case ' ':
 5891|  7.94M|               case '\t':
 5892|  7.94M|               case '\n':
 5893|  7.94M|               case '\r':
 5894|  7.94M|               case ',':
 5895|  7.94M|               case ']':
 5896|  7.94M|               case '}':
 5897|  7.94M|                  return true;
 5898|  7.94M|               default:
 5899|  7.94M|                  return false;
 5900|  7.94M|               }
 5901|  7.94M|            };
 5902|       |
 5903|  7.94M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  7.94M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  7.94M|                  return false;
 5906|  7.94M|               }
 5907|  7.94M|               if (ctx.current_indent() < 0) {
 5908|  7.94M|                  return false;
 5909|  7.94M|               }
 5910|  7.94M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  7.94M|                  return false;
 5912|  7.94M|               }
 5913|       |
 5914|  7.94M|               auto look = word_end;
 5915|  7.94M|               yaml::skip_newline(look, end);
 5916|  7.94M|               while (look != end) {
 5917|  7.94M|                  int32_t line_indent = 0;
 5918|  7.94M|                  while (look != end && *look == ' ') {
 5919|  7.94M|                     ++line_indent;
 5920|  7.94M|                     ++look;
 5921|  7.94M|                  }
 5922|  7.94M|                  if (look != end && *look == '\t') {
 5923|  7.94M|                     return false;
 5924|  7.94M|                  }
 5925|  7.94M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  7.94M|                     if (look != end) {
 5927|  7.94M|                        yaml::skip_newline(look, end);
 5928|  7.94M|                        continue;
 5929|  7.94M|                     }
 5930|  7.94M|                     return false;
 5931|  7.94M|                  }
 5932|  7.94M|                  if (*look == '#') {
 5933|  7.94M|                     yaml::skip_comment(look, end);
 5934|  7.94M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  7.94M|                        yaml::skip_newline(look, end);
 5936|  7.94M|                        continue;
 5937|  7.94M|                     }
 5938|  7.94M|                     return false;
 5939|  7.94M|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  7.94M|                  {
 5945|  7.94M|                     auto scan = look;
 5946|  7.94M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  7.94M|                        if (*scan == ':') {
 5948|  7.94M|                           auto after_colon = scan + 1;
 5949|  7.94M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  7.94M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  7.94M|                              return false;
 5952|  7.94M|                           }
 5953|  7.94M|                        }
 5954|  7.94M|                        ++scan;
 5955|  7.94M|                     }
 5956|  7.94M|                  }
 5957|       |
 5958|  7.94M|                  return line_indent > ctx.current_indent();
 5959|  7.94M|               }
 5960|  7.94M|               return false;
 5961|  7.94M|            };
 5962|  7.94M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  7.94M|               if (ptr == end) {
 5964|  7.94M|                  return true;
 5965|  7.94M|               }
 5966|  7.94M|               if (*ptr == ':') {
 5967|  7.94M|                  auto next = ptr + 1;
 5968|  7.94M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  7.94M|               }
 5970|  7.94M|               return is_plain_scalar_boundary(*ptr);
 5971|  7.94M|            };
 5972|       |
 5973|  7.94M|            switch (c) {
 5974|  1.59M|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 1.59M, False: 6.34M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|  1.59M|               ++it;
 5977|  1.59M|               auto aname = yaml::parse_anchor_name(it, end);
 5978|  1.59M|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 458, False: 1.59M]
  ------------------
 5979|    458|                  ctx.error = error_code::syntax_error;
 5980|    458|                  return;
 5981|    458|               }
 5982|  1.59M|               yaml::skip_inline_ws(it, end);
 5983|  1.59M|               bool anchor_on_same_line = true;
 5984|  1.59M|               bool value_is_indentless_sequence = false;
 5985|  1.59M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 15.8k, False: 1.58M]
  |  Branch (5985:33): [True: 70.5k, False: 1.51M]
  |  Branch (5985:48): [True: 117k, False: 1.39M]
  |  Branch (5985:63): [True: 14.6k, False: 1.38M]
  ------------------
 5986|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5987|       |                  // next line (indented past current context) or if this is an empty node.
 5988|   218k|                  bool value_on_next_line = false;
 5989|   218k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 202k, False: 15.8k]
  ------------------
 5990|   202k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|   202k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 14.6k, False: 187k]
  ------------------
 5993|   112k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 112k, False: 759]
  |  Branch (5993:47): [True: 106k, False: 5.83k]
  |  Branch (5993:64): [True: 98.1k, False: 8.09k]
  ------------------
 5994|  14.6k|                     }
 5995|       |                     // Skip newline
 5996|   202k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 201k, False: 759]
  |  Branch (5996:42): [True: 76.3k, False: 125k]
  |  Branch (5996:59): [True: 125k, False: 0]
  ------------------
 5997|   201k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   360k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 354k, False: 5.94k]
  |  Branch (5999:48): [True: 80.5k, False: 273k]
  |  Branch (5999:65): [True: 78.3k, False: 195k]
  ------------------
 6000|   158k|                           yaml::skip_newline(peek, end);
 6001|   158k|                        }
 6002|       |                        // Measure indent of next content line
 6003|   201k|                        int32_t next_indent = 0;
 6004|   537k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 528k, False: 8.36k]
  |  Branch (6004:47): [True: 335k, False: 193k]
  ------------------
 6005|   335k|                           ++next_indent;
 6006|   335k|                           ++peek;
 6007|   335k|                        }
 6008|   201k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 193k, False: 8.36k]
  |  Branch (6008:44): [True: 186k, False: 6.49k]
  |  Branch (6008:61): [True: 185k, False: 1.12k]
  ------------------
 6009|   185k|                           const bool indentless_sequence =
 6010|   185k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 180k, False: 5.12k]
  |  Branch (6010:69): [True: 45.1k, False: 135k]
  ------------------
 6011|  45.1k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 1.54k, False: 43.5k]
  ------------------
 6012|  43.5k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 41.7k, False: 1.85k]
  ------------------
 6013|  43.2k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 3.00k, False: 40.2k]
  ------------------
 6014|  40.2k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 25.0k, False: 15.2k]
  |  Branch (6014:61): [True: 22.8k, False: 2.21k]
  ------------------
 6015|   185k|                           value_is_indentless_sequence = indentless_sequence;
 6016|   185k|                           const bool same_indent_property_node =
 6017|   185k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 24.4k, False: 161k]
  ------------------
 6018|  24.4k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 1.20k, False: 23.2k]
  |  Branch (6018:48): [True: 4.46k, False: 18.8k]
  |  Branch (6018:64): [True: 963, False: 17.8k]
  |  Branch (6018:80): [True: 1.00k, False: 16.8k]
  |  Branch (6018:96): [True: 873, False: 15.9k]
  ------------------
 6019|  15.9k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 1.00k, False: 14.9k]
  |  Branch (6019:48): [True: 1.98k, False: 12.9k]
  |  Branch (6019:65): [True: 669, False: 12.3k]
  |  Branch (6019:81): [True: 1.64k, False: 10.6k]
  ------------------
 6020|   185k|                           value_on_next_line =
 6021|   185k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 113k, False: 71.9k]
  |  Branch (6021:71): [True: 25.8k, False: 46.1k]
  |  Branch (6021:94): [True: 13.8k, False: 32.3k]
  ------------------
 6022|   185k|                        }
 6023|   201k|                     }
 6024|   202k|                  }
 6025|   218k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 64.9k, False: 153k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  64.9k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  64.9k|                     return;
 6029|  64.9k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|   153k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 7.90k, False: 145k]
  ------------------
 6032|  59.4k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 59.4k, False: 0]
  |  Branch (6032:42): [True: 54.2k, False: 5.23k]
  |  Branch (6032:57): [True: 51.5k, False: 2.66k]
  ------------------
 6033|  7.90k|                  }
 6034|   153k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 153k, False: 0]
  ------------------
 6035|   251k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 251k, False: 0]
  |  Branch (6035:40): [True: 34.6k, False: 216k]
  |  Branch (6035:55): [True: 63.6k, False: 153k]
  ------------------
 6036|  98.2k|                     yaml::skip_newline(it, end);
 6037|  98.2k|                  }
 6038|   153k|                  yaml::skip_inline_ws(it, end);
 6039|   153k|                  anchor_on_same_line = false;
 6040|   153k|               }
 6041|       |
 6042|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|       |                  if (anchor_on_same_line && *it == '-' &&
 6044|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|       |                     ctx.error = error_code::syntax_error;
 6047|       |                     return;
 6048|       |                  }
 6049|       |               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|  1.53M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 1.53M, False: 22]
  |  Branch (6053:33): [True: 1.52k, False: 1.53M]
  |  Branch (6053:47): [True: 239, False: 1.28k]
  ------------------
 6054|    239|                  ctx.error = error_code::syntax_error;
 6055|    239|                  return;
 6056|    239|               }
 6057|       |
 6058|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 6060|       |                     auto probe = it + 1;
 6061|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|       |                     if (nested_anchor_name.empty()) {
 6063|       |                        ctx.error = error_code::syntax_error;
 6064|       |                        return;
 6065|       |                     }
 6066|       |                     yaml::skip_inline_ws(probe, end);
 6067|       |                     // Allow nested anchor usage only when it clearly starts a
 6068|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6069|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6070|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 6071|       |                        ctx.error = error_code::syntax_error;
 6072|       |                        return;
 6073|       |                     }
 6074|       |                  }
 6075|       |               }
 6076|       |
 6077|  1.53M|               const char* anchor_start = &*it;
 6078|  1.53M|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6081|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6082|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6083|       |                  // next line, the anchor applies to the entire next-line content.
 6084|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 6085|       |                     auto key_start = it;
 6086|       |                     if (*key_start == '!') {
 6087|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 6089|       |                           ctx.error = error_code::syntax_error;
 6090|       |                           return;
 6091|       |                        }
 6092|       |                        yaml::skip_inline_ws(key_start, end);
 6093|       |                        if (key_start == end) {
 6094|       |                           ctx.error = error_code::unexpected_end;
 6095|       |                           return;
 6096|       |                        }
 6097|       |                        if (*key_start == '\n' || *key_start == '\r') {
 6098|       |                           ctx.error = error_code::syntax_error;
 6099|       |                           return;
 6100|       |                        }
 6101|       |
 6102|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6103|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6104|       |                        // key-span registration below while the untagged spelling was rejected;
 6105|       |                        // an alias node carries no other properties either way.
 6106|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 6107|       |                           ctx.error = error_code::syntax_error;
 6108|       |                           return;
 6109|       |                        }
 6110|       |                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|       |                     auto key_scan = key_start;
 6114|       |                     auto key_end = key_start;
 6115|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6116|       |                        // Quoted key: skip to closing quote
 6117|       |                        const char quote = *key_scan;
 6118|       |                        ++key_scan;
 6119|       |                        while (key_scan != end && *key_scan != quote) {
 6120|       |                           if (*key_scan == '\\' && quote == '"') {
 6121|       |                              ++key_scan;
 6122|       |                              if (key_scan != end) ++key_scan;
 6123|       |                           }
 6124|       |                           else {
 6125|       |                              ++key_scan;
 6126|       |                           }
 6127|       |                        }
 6128|       |                        if (key_scan == end) {
 6129|       |                           ctx.error = error_code::syntax_error;
 6130|       |                           return;
 6131|       |                        }
 6132|       |                        ++key_scan; // past closing quote
 6133|       |                        key_end = key_scan;
 6134|       |                        yaml::skip_inline_ws(key_scan, end);
 6135|       |                     }
 6136|       |                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|       |                        while (key_scan != end) {
 6139|       |                           if (*key_scan == ':') {
 6140|       |                              auto next = key_scan + 1;
 6141|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6142|       |                                 break;
 6143|       |                              }
 6144|       |                           }
 6145|       |                           ++key_scan;
 6146|       |                        }
 6147|       |                        key_end = key_scan;
 6148|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6149|       |                           --key_end;
 6150|       |                        }
 6151|       |                     }
 6152|       |                     if (key_scan == end || *key_scan != ':') {
 6153|       |                        ctx.error = error_code::syntax_error;
 6154|       |                        return;
 6155|       |                     }
 6156|       |                     // Store anchor with just the key text span
 6157|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|       |                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|       |                     if constexpr (counts::n_object > 0) {
 6161|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|       |                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|       |                     return;
 6168|       |                  }
 6169|       |               }
 6170|       |
 6171|  1.53M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|  1.53M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|  1.53M|               redispatch<Opts>(value, ctx, it, end);
 6174|  1.53M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|  1.53M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 1.49M, False: 34.2k]
  ------------------
 6176|  1.49M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|  1.49M|               }
 6178|  1.53M|               return;
 6179|  1.53M|            }
 6180|   521k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 521k, False: 7.42M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6184|       |                     if constexpr (counts::n_object > 0) {
 6185|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|       |                                                                                                        end);
 6187|       |                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|       |                  }
 6194|       |               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|   521k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   521k|               return;
 6199|  1.53M|            }
 6200|   543k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 543k, False: 7.39M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   543k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   543k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 68, False: 542k]
  ------------------
 6204|     68|                  ctx.error = error_code::syntax_error;
 6205|     68|                  return;
 6206|     68|               }
 6207|   542k|               yaml::skip_inline_ws(it, end);
 6208|   542k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 539k, False: 3.09k]
  |  Branch (6208:33): [True: 29.4k, False: 510k]
  ------------------
 6209|  29.4k|                  yaml::skip_comment(it, end);
 6210|  29.4k|               }
 6211|   542k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 538k, False: 4.81k]
  |  Branch (6211:34): [True: 41.6k, False: 496k]
  |  Branch (6211:49): [True: 74.1k, False: 422k]
  ------------------
 6212|   115k|                  auto content = it;
 6213|   115k|                  yaml::skip_newline(content, end);
 6214|   115k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|   115k|                  bool consume_following_content = false;
 6217|   115k|                  auto content_token = content;
 6218|   115k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 105k, False: 10.4k]
  ------------------
 6219|   105k|                     auto indent_probe = content;
 6220|   105k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|   105k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 6, False: 105k]
  ------------------
 6222|      6|                        return;
 6223|   105k|                     content_token = indent_probe;
 6224|       |
 6225|       |                     // A tag at the end of a sequence/map entry has an empty value
 6226|       |                     // unless the next non-empty content is nested under the current node.
 6227|   105k|                     bool tagged_indentless_sequence = false;
 6228|   105k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 18.8k, False: 86.4k]
  |  Branch (6228:56): [True: 18.8k, False: 0]
  |  Branch (6228:79): [True: 16.7k, False: 2.08k]
  ------------------
 6229|  16.7k|                        const auto after_dash = indent_probe + 1;
 6230|  16.7k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 872, False: 15.8k]
  ------------------
 6231|  15.8k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 14.8k, False: 1.03k]
  ------------------
 6232|  15.6k|                           tagged_indentless_sequence =
 6233|  15.6k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 1.22k, False: 14.4k]
  ------------------
 6234|  14.4k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 7.32k, False: 7.14k]
  |  Branch (6234:60): [True: 1.28k, False: 6.04k]
  ------------------
 6235|  15.6k|                        }
 6236|  16.7k|                     }
 6237|       |
 6238|   105k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 49.6k, False: 55.6k]
  ------------------
 6239|  55.6k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 26.4k, False: 29.1k]
  |  Branch (6239:93): [True: 2.50k, False: 26.6k]
  ------------------
 6240|   105k|                  }
 6241|       |
 6242|   115k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 78.6k, False: 37.1k]
  ------------------
 6243|  78.6k|                     it = content_token;
 6244|  78.6k|                  }
 6245|  37.1k|                  else {
 6246|  37.1k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 1.16k, False: 35.9k]
  ------------------
 6247|  1.16k|                        if constexpr (counts::n_str > 0) {
 6248|  1.16k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  1.16k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  1.16k|                           value = StrType{};
 6251|  1.16k|                           return;
 6252|  1.16k|                        }
 6253|  1.16k|                     }
 6254|  37.1k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 948, False: 36.1k]
  ------------------
 6255|    948|                        if constexpr (counts::n_null > 0) {
 6256|    948|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    948|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    948|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 948]
  ------------------
 6259|    948|                           return;
 6260|    948|                        }
 6261|    948|                     }
 6262|  37.1k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 29.4k, False: 7.69k]
  ------------------
 6263|  29.4k|                        if constexpr (counts::n_null > 0) {
 6264|  29.4k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  29.4k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  29.4k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 29.4k]
  ------------------
 6267|  29.4k|                           return;
 6268|  29.4k|                        }
 6269|  29.4k|                     }
 6270|  37.1k|                  }
 6271|   115k|               }
 6272|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6273|       |                  // In block context, a comma immediately after a tag token is malformed
 6274|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6275|       |                  if (it != end && *it == ',') {
 6276|       |                     ctx.error = error_code::syntax_error;
 6277|       |                     return;
 6278|       |                  }
 6279|       |                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|       |                     const bool starts_block_sequence_entry =
 6282|       |                        (it != end && *it == '-') &&
 6283|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6284|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6285|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6286|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6287|       |                        redispatch<Opts>(value, ctx, it, end);
 6288|       |                        return;
 6289|       |                     }
 6290|       |                  }
 6291|       |               }
 6292|   542k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 4.81k, False: 538k]
  ------------------
 6293|  4.81k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 1.57k, False: 3.24k]
  ------------------
 6294|  1.57k|                     if constexpr (counts::n_str > 0) {
 6295|  1.57k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|  1.57k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|  1.57k|                        value = StrType{};
 6298|  1.57k|                        return;
 6299|  1.57k|                     }
 6300|  1.57k|                  }
 6301|  4.81k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 3.22k, False: 1.59k]
  ------------------
 6302|  3.22k|                     if constexpr (counts::n_null > 0) {
 6303|  3.22k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  3.22k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  3.22k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 3.22k]
  ------------------
 6306|  3.22k|                        return;
 6307|  3.22k|                     }
 6308|  3.22k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  4.81k|                  return;
 6311|  4.81k|               }
 6312|   538k|               switch (tag) {
 6313|  1.07k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 1.07k, False: 537k]
  ------------------
 6314|  1.07k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  1.07k|                  return;
 6316|  5.63k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 5.63k, False: 532k]
  ------------------
 6317|  14.3k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 8.76k, False: 529k]
  ------------------
 6318|  14.3k|                  if constexpr (counts::n_num > 0) {
 6319|  14.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  14.3k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  58.5k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 44.1k, False: 493k]
  ------------------
 6327|  58.5k|                  if constexpr (counts::n_bool > 0) {
 6328|  58.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  58.5k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  59.7k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 1.25k, False: 536k]
  ------------------
 6336|  59.7k|                  if constexpr (counts::n_null > 0) {
 6337|  59.7k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  59.7k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  59.7k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 59.7k]
  ------------------
 6340|  59.7k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  59.7k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|   114k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 54.4k, False: 483k]
  ------------------
 6348|   114k|                  if constexpr (counts::n_object > 0) {
 6349|   114k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|   114k|                                                                                                     end);
 6351|   114k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|   155k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 41.2k, False: 496k]
  ------------------
 6358|   155k|                  if constexpr (counts::n_array > 0) {
 6359|   155k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|       |                        if (it != end && *it == '-') {
 6362|       |                           ctx.allow_indentless_sequence = true;
 6363|       |                        }
 6364|       |                     }
 6365|   155k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|   155k|                                                                                                    end);
 6367|   155k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|   155k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   505k|               default: {
  ------------------
  |  Branch (6374:16): [True: 350k, False: 188k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   505k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 350k, False: 155k]
  |  Branch (6377:36): [True: 172k, False: 177k]
  ------------------
 6378|   172k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|   172k|                     return;
 6380|   172k|                  }
 6381|       |
 6382|   333k|                  if constexpr (counts::n_array > 0) {
 6383|   333k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 177k, False: 155k]
  |  Branch (6383:39): [True: 2.53k, False: 175k]
  ------------------
 6384|  2.53k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  2.53k|                                                                                                       end);
 6386|  2.53k|                        return;
 6387|  2.53k|                     }
 6388|   333k|                  }
 6389|   333k|                  if constexpr (counts::n_object > 0) {
 6390|   333k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 175k, False: 158k]
  |  Branch (6390:39): [True: 2.75k, False: 172k]
  ------------------
 6391|  2.75k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  2.75k|                                                                                                        end);
 6393|  2.75k|                        return;
 6394|  2.75k|                     }
 6395|   333k|                  }
 6396|       |
 6397|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|       |                     if constexpr (counts::n_array > 0) {
 6399|       |                        const bool starts_block_sequence_entry =
 6400|       |                           (it != end && *it == '-') &&
 6401|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6402|       |                        if (starts_block_sequence_entry) {
 6403|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|       |                                                                                                          it, end);
 6405|       |                           return;
 6406|       |                        }
 6407|       |                     }
 6408|       |                     if constexpr (counts::n_object > 0) {
 6409|       |                        const bool starts_explicit_mapping_indicator =
 6410|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6411|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6412|       |                        if (starts_explicit_mapping_indicator) {
 6413|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|       |                                                                                                           it, end);
 6415|       |                           return;
 6416|       |                        }
 6417|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6418|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6419|       |                                                                                                           it, end);
 6420|       |                           return;
 6421|       |                        }
 6422|       |                     }
 6423|       |                  }
 6424|       |
 6425|   333k|                  if constexpr (counts::n_str > 0) {
 6426|   333k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   333k|                     return;
 6428|   333k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   333k|                  return;
 6433|   505k|               }
 6434|   538k|               }
 6435|      0|               return;
 6436|   538k|            }
 6437|  1.23M|            case '{':
  ------------------
  |  Branch (6437:13): [True: 1.23M, False: 6.71M]
  ------------------
 6438|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6441|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|       |                                                                                                     end);
 6443|       |                     return;
 6444|       |                  }
 6445|       |               }
 6446|       |               // Flow mapping - object type
 6447|  1.23M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  1.23M|               return;
 6449|   115k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 115k, False: 7.82M]
  ------------------
 6450|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6453|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|       |                                                                                                     end);
 6455|       |                     return;
 6456|       |                  }
 6457|       |               }
 6458|       |               // Flow sequence - array type
 6459|   115k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|   115k|               return;
 6461|   334k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 334k, False: 7.60M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   334k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 332k, False: 1.89k]
  |  Branch (6463:39): [True: 9, False: 332k]
  ------------------
 6464|      9|                  ctx.error = error_code::syntax_error;
 6465|      9|                  return;
 6466|      9|               }
 6467|   334k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 332k, False: 1.89k]
  |  Branch (6467:40): [True: 104k, False: 227k]
  |  Branch (6467:56): [True: 167k, False: 59.4k]
  |  Branch (6467:73): [True: 27.4k, False: 32.0k]
  ------------------
 6468|   300k|                  if constexpr (counts::n_object > 0) {
 6469|   300k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   300k|                                                                                                     end);
 6471|   300k|                     return;
 6472|   300k|                  }
 6473|   300k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   334k|               return;
 6476|     44|            case '%':
  ------------------
  |  Branch (6476:13): [True: 44, False: 7.94M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     44|               ctx.error = error_code::syntax_error;
 6479|     44|               return;
 6480|  17.4k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 17.4k, False: 7.92M]
  ------------------
 6481|  24.9k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 7.46k, False: 7.93M]
  ------------------
 6482|       |               // Could be a quoted string OR a quoted key in a block mapping
 6483|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6484|  24.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  24.9k|               return;
 6486|  39.5k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 39.5k, False: 7.90M]
  ------------------
 6487|  69.6k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 30.1k, False: 7.91M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  69.6k|               if constexpr (counts::n_bool > 0) {
 6490|  69.6k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 67.7k, False: 1.92k]
  |  Branch (6490:44): [True: 40.8k, False: 26.8k]
  |  Branch (6490:60): [True: 37.6k, False: 3.15k]
  |  Branch (6490:76): [True: 29.9k, False: 7.71k]
  ------------------
 6491|  37.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 6.02k, False: 31.7k]
  |  Branch (6491:60): [True: 3.93k, False: 2.08k]
  |  Branch (6491:76): [True: 2.93k, False: 1.00k]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  32.9k|                     const auto after_true = it + 4;
 6494|  32.9k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  32.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 30.0k, False: 2.83k]
  ------------------
 6497|  30.0k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 0, False: 30.0k]
  ------------------
 6498|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|      0|                           return;
 6500|      0|                        }
 6501|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6502|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6503|  30.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 28.9k, False: 1.09k]
  |  Branch (6503:47): [True: 19.2k, False: 9.69k]
  ------------------
 6504|  19.2k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 872, False: 18.4k]
  |  Branch (6504:47): [True: 8.95k, False: 9.44k]
  |  Branch (6504:63): [True: 5.83k, False: 3.61k]
  |  Branch (6504:80): [True: 687, False: 2.92k]
  |  Branch (6504:97): [True: 2.92k, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  19.2k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  19.2k|                           return;
 6508|  19.2k|                        }
 6509|  10.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  10.7k|                                                                                                      end);
 6511|  10.7k|                        return;
 6512|  30.0k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  32.9k|                  }
 6515|  69.6k|               }
 6516|  39.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  69.6k|               return;
 6518|  58.6k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 58.6k, False: 7.88M]
  ------------------
 6519|  76.6k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 17.9k, False: 7.92M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  76.6k|               if constexpr (counts::n_bool > 0) {
 6522|  76.6k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 75.2k, False: 1.37k]
  |  Branch (6522:44): [True: 38.9k, False: 36.2k]
  |  Branch (6522:60): [True: 27.7k, False: 11.1k]
  |  Branch (6522:76): [True: 24.5k, False: 3.22k]
  |  Branch (6522:92): [True: 22.6k, False: 1.86k]
  ------------------
 6523|  52.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 6.81k, False: 45.7k]
  |  Branch (6523:60): [True: 5.45k, False: 1.35k]
  |  Branch (6523:76): [True: 4.39k, False: 1.06k]
  |  Branch (6523:92): [True: 1.20k, False: 3.18k]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  23.8k|                     const auto after_false = it + 5;
 6526|  23.8k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  23.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 20.2k, False: 3.67k]
  ------------------
 6529|  20.2k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 0, False: 20.2k]
  ------------------
 6530|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|      0|                           return;
 6532|      0|                        }
 6533|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6534|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6535|  20.2k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 18.9k, False: 1.25k]
  |  Branch (6535:47): [True: 14.4k, False: 4.54k]
  ------------------
 6536|  14.4k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 699, False: 13.7k]
  |  Branch (6536:47): [True: 1.67k, False: 12.0k]
  |  Branch (6536:63): [True: 5.87k, False: 6.18k]
  |  Branch (6536:80): [True: 2.64k, False: 3.53k]
  |  Branch (6536:97): [True: 3.53k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  14.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  14.4k|                           return;
 6540|  14.4k|                        }
 6541|  5.79k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  5.79k|                                                                                                      end);
 6543|  5.79k|                        return;
 6544|  20.2k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  23.8k|                  }
 6547|  76.6k|               }
 6548|  56.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  76.6k|               return;
 6550|  35.6k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 35.6k, False: 7.90M]
  ------------------
 6551|  64.6k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 28.9k, False: 7.91M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  64.6k|               if constexpr (counts::n_null > 0) {
 6554|  64.6k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 63.1k, False: 1.53k]
  |  Branch (6554:44): [True: 36.6k, False: 26.4k]
  |  Branch (6554:60): [True: 31.5k, False: 5.04k]
  |  Branch (6554:76): [True: 29.1k, False: 2.43k]
  ------------------
 6555|  33.9k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 7.46k, False: 26.4k]
  |  Branch (6555:60): [True: 5.59k, False: 1.86k]
  |  Branch (6555:76): [True: 4.33k, False: 1.26k]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  33.4k|                     const auto after_null = it + 4;
 6558|  33.4k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  33.4k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 25.4k, False: 8.06k]
  ------------------
 6561|  25.4k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 0, False: 25.4k]
  ------------------
 6562|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|      0|                           return;
 6564|      0|                        }
 6565|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6566|       |                        // "null: value" should parse as {null: value}, not as the null type
 6567|  25.4k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 24.4k, False: 976]
  |  Branch (6567:47): [True: 12.1k, False: 12.2k]
  ------------------
 6568|  12.1k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 1.08k, False: 11.1k]
  |  Branch (6568:47): [True: 807, False: 10.2k]
  |  Branch (6568:63): [True: 8.29k, False: 1.99k]
  |  Branch (6568:80): [True: 852, False: 1.14k]
  |  Branch (6568:97): [True: 1.14k, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  12.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  12.1k|                           return;
 6572|  12.1k|                        }
 6573|  13.2k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  13.2k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  13.2k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 13.2k]
  ------------------
 6576|  13.2k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  13.2k|                        return;
 6578|  25.4k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  33.4k|                  }
 6581|  64.6k|               }
 6582|  39.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  64.6k|               return;
 6584|  6.61k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 6.61k, False: 7.93M]
  ------------------
 6585|       |               // Null indicator
 6586|  6.61k|               if constexpr (counts::n_null > 0) {
 6587|  6.61k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  6.61k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  6.61k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 6.61k]
  ------------------
 6590|  6.61k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  6.61k|                  return;
 6592|  6.61k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   233k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 233k, False: 7.70M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   233k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 11.7k, False: 221k]
  |  Branch (6596:41): [True: 149k, False: 72.2k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   161k|                  if constexpr (counts::n_array > 0) {
 6599|   161k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   161k|                                                                                                    end);
 6601|   161k|                     return;
 6602|   161k|                  }
 6603|   161k|               }
 6604|   233k|               if constexpr (counts::n_num > 0) {
 6605|   233k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 72.2k, False: 161k]
  |  Branch (6605:43): [True: 4.93k, False: 67.2k]
  |  Branch (6605:94): [True: 3.21k, False: 64.0k]
  ------------------
 6606|  8.15k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  8.15k|                     return;
 6608|  8.15k|                  }
 6609|   233k|               }
 6610|   225k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   233k|               return;
 6612|  25.7k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 25.7k, False: 7.91M]
  ------------------
 6613|  74.0k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 48.2k, False: 7.89M]
  ------------------
 6614|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6615|       |               // Try parsing as number speculatively, fall back to string on failure
 6616|  74.0k|               if constexpr (counts::n_num > 0) {
 6617|  74.0k|                  auto start_it = it;
 6618|  74.0k|                  auto temp_ctx = ctx.make_speculative();
 6619|  74.0k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  74.0k|                                                                                               end);
 6621|  74.0k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  74.0k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  74.0k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 7.49k, False: 66.5k]
  ------------------
 6624|  7.49k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  7.49k|                     return; // Successfully parsed as number
 6626|  7.49k|                  }
 6627|  66.5k|                  it = start_it; // Restore and fall through to string
 6628|  66.5k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  74.0k|               return;
 6631|  3.04M|            default:
  ------------------
  |  Branch (6631:13): [True: 3.04M, False: 4.89M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|  3.04M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 2.72M, False: 324k]
  |  Branch (6633:32): [True: 2.34M, False: 380k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  2.34M|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 20.1k, False: 2.32M]
  ------------------
 6636|  20.1k|                     return;
 6637|  20.1k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  2.32M|                  if constexpr (counts::n_num > 0) {
 6640|  2.32M|                     auto start_it = it;
 6641|  2.32M|                     auto temp_ctx = ctx.make_speculative();
 6642|  2.32M|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  2.32M|                                                                                                  end);
 6644|  2.32M|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  2.32M|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  2.32M|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 2.20M, False: 121k]
  ------------------
 6647|  2.20M|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  2.20M|                        return; // Successfully parsed as number
 6649|  2.20M|                     }
 6650|   121k|                     it = start_it; // Restore and fall through to string
 6651|   121k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|  2.32M|                  return;
 6655|  2.34M|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   704k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   704k|               return;
 6659|  7.94M|            }
 6660|  7.94M|         }
 6661|       |
 6662|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6663|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6664|       |
 6665|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6666|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6667|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6668|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6669|  7.94M|         error_code expansion_error{};
 6670|  7.94M|         std::string_view expansion_message{};
 6671|       |
 6672|  7.94M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  7.94M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  7.94M|            auto start = it;
 6675|       |
 6676|  7.94M|            V v{};
 6677|  7.94M|            auto temp_ctx = ctx.make_speculative();
 6678|  7.94M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  7.94M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  7.94M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  7.94M|            if (!bool(temp_ctx.error)) {
 6683|  7.94M|               value = std::move(v);
 6684|  7.94M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  7.94M|               return true;
 6686|  7.94M|            }
 6687|       |
 6688|  7.94M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  7.94M|               expansion_error = temp_ctx.error;
 6690|  7.94M|               expansion_message = temp_ctx.custom_error_message;
 6691|  7.94M|            }
 6692|  7.94M|            it = start;
 6693|  7.94M|            return false;
 6694|  7.94M|         };
 6695|       |
 6696|  7.94M|         bool parsed = false;
 6697|  7.94M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  7.94M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  7.94M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  7.94M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 7.94M]
  ------------------
 6702|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6702:17): [True: 0, False: 0]
  ------------------
 6703|      0|               ctx.error = expansion_error;
 6704|      0|               ctx.custom_error_message = expansion_message;
 6705|      0|            }
 6706|      0|            else {
 6707|      0|               ctx.error = error_code::no_matching_variant_type;
 6708|      0|            }
 6709|      0|         }
 6710|  7.94M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE10redispatchITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 6717|  1.53M|      {
 6718|  1.53M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|  1.53M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 36, False: 1.53M]
  ------------------
 6720|     36|            return;
 6721|  1.53M|         op<Opts>(value, ctx, it, end);
 6722|  1.53M|      }
_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|   693k|      {
  301|   693k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 693k]
  |  Branch (301:27): [True: 0, False: 693k]
  ------------------
  302|       |
  303|   693k|         ++it; // skip '*'
  304|   693k|         auto name = parse_anchor_name(it, end);
  305|   693k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 331, False: 693k]
  ------------------
  306|    331|            ctx.error = error_code::syntax_error;
  307|    331|            return true;
  308|    331|         }
  309|       |
  310|   693k|         auto anchor_it = ctx.anchors.find(name);
  311|   693k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 3.04k, False: 690k]
  ------------------
  312|  3.04k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  3.04k|            return true;
  314|  3.04k|         }
  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|   690k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   690k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 90.8k, False: 599k]
  ------------------
  322|  90.8k|            return true;
  323|  90.8k|         }
  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|   599k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 34, False: 599k]
  ------------------
  329|     34|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     34|            return true;
  331|     34|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|   599k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   599k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 599k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   599k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 45, False: 599k]
  ------------------
  342|     45|            ctx.error = error_code::exceeded_max_expansion;
  343|     45|            ctx.custom_error_message = "alias expansion";
  344|     45|            return true;
  345|     45|         }
  346|       |
  347|   599k|         auto replay_it = span.begin;
  348|   599k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   599k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   599k|         ctx.indent_stack.clear();
  353|   599k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 49.9k, False: 549k]
  ------------------
  354|  49.9k|            ctx.push_indent(span.base_indent - 1);
  355|  49.9k|         }
  356|       |
  357|   599k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   599k|         using V = std::remove_cvref_t<T>;
  360|   599k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   599k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   599k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   599k|         return true;
  367|   599k|      }
_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_:
 5310|   964k|      {
 5311|   964k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   964k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   964k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   964k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   964k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 964k, False: 0]
  ------------------
 5321|   964k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   964k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1960|   984k|      {
 1961|   984k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 16.7k, False: 968k]
  ------------------
 1962|  16.7k|            return;
 1963|       |
 1964|   968k|         yaml::node_preamble_state preamble{};
 1965|   968k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 25.8k, False: 942k]
  ------------------
 1966|   968k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  25.8k|            return;
 1968|       |
 1969|   942k|         std::string str;
 1970|   942k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   942k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 942k, False: 0]
  ------------------
 1973|  10.6k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 10.6k, False: 931k]
  ------------------
 1974|  10.6k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  10.6k|            break;
 1976|  5.99k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 5.99k, False: 936k]
  ------------------
 1977|  5.99k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  5.99k|            break;
 1979|  1.60k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 1.60k, False: 940k]
  ------------------
 1980|  13.6k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 12.0k, False: 930k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  13.6k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  13.6k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 4.92k, False: 8.75k]
  ------------------
 1986|  13.6k|            break;
 1987|   911k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 911k, False: 30.3k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|       |               if (ctx.current_indent() >= 0) {
 1992|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|       |               }
 1994|       |               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|       |               }
 1998|       |            }
 1999|   911k|            else {
 2000|   911k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|   911k|            }
 2002|   911k|            break;
 2003|   942k|         }
 2004|       |
 2005|   942k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 932k, False: 10.1k]
  ------------------
 2006|   932k|            value = std::move(str);
 2007|   932k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   932k|         }
 2009|   942k|      }
_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|   968k|      {
  466|   968k|         skip_inline_ws(it, end);
  467|       |
  468|   968k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 17, False: 968k]
  ------------------
  469|     17|            if constexpr (!AllowEmptyInput) {
  470|     17|               ctx.error = error_code::unexpected_end;
  471|     17|            }
  472|     17|            return true;
  473|     17|         }
  474|       |
  475|   968k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   968k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 42, False: 968k]
  ------------------
  477|     42|            ctx.error = error_code::syntax_error;
  478|     42|            return true;
  479|     42|         }
  480|   968k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 968k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   968k|         skip_inline_ws(it, end);
  486|       |
  487|   968k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 24, False: 968k]
  ------------------
  488|     24|            if constexpr (!AllowEmptyInput) {
  489|     24|               ctx.error = error_code::unexpected_end;
  490|     24|            }
  491|     24|            return true;
  492|     24|         }
  493|       |
  494|   968k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 25.7k, False: 942k]
  ------------------
  495|  25.7k|            return true;
  496|  25.7k|         }
  497|       |
  498|   942k|         return false;
  499|   968k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1966|   968k|                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|   968k|      {
  409|   968k|         state.has_anchor = false;
  410|   968k|         state.anchor_name.clear();
  411|   968k|         state.anchor_start = nullptr;
  412|   968k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   968k|         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|   968k|            else {
  421|   968k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 25.6k, False: 942k]
  ------------------
  422|   968k|            }
  423|   968k|         }
  424|       |
  425|   968k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 942k, False: 25.6k]
  |  Branch (425:27): [True: 27.5k, False: 914k]
  ------------------
  426|  27.5k|            ++it;
  427|  27.5k|            auto name = parse_anchor_name(it, end);
  428|  27.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 40, False: 27.4k]
  ------------------
  429|     40|               ctx.error = error_code::syntax_error;
  430|     40|               return true;
  431|     40|            }
  432|  27.4k|            skip_inline_ws(it, end);
  433|  27.4k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 49, False: 27.4k]
  ------------------
  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|  27.4k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  27.4k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 27.4k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  27.4k|            }
  445|  27.4k|            state.has_anchor = true;
  446|  27.4k|            state.anchor_name = std::string(name);
  447|  27.4k|            state.anchor_start = &*it;
  448|  27.4k|         }
  449|       |
  450|   967k|         return false;
  451|   968k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   968k|      {
  301|   968k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 968k]
  |  Branch (301:27): [True: 942k, False: 25.6k]
  ------------------
  302|       |
  303|  25.6k|         ++it; // skip '*'
  304|  25.6k|         auto name = parse_anchor_name(it, end);
  305|  25.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 37, False: 25.6k]
  ------------------
  306|     37|            ctx.error = error_code::syntax_error;
  307|     37|            return true;
  308|     37|         }
  309|       |
  310|  25.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  25.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 114, False: 25.4k]
  ------------------
  312|    114|            ctx.error = error_code::syntax_error; // undefined alias
  313|    114|            return true;
  314|    114|         }
  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|  25.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  25.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.72k, False: 20.7k]
  ------------------
  322|  4.72k|            return true;
  323|  4.72k|         }
  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.7k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 29, False: 20.7k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  20.7k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  20.7k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 20.7k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  20.7k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 21, False: 20.7k]
  ------------------
  342|     21|            ctx.error = error_code::exceeded_max_expansion;
  343|     21|            ctx.custom_error_message = "alias expansion";
  344|     21|            return true;
  345|     21|         }
  346|       |
  347|  20.7k|         auto replay_it = span.begin;
  348|  20.7k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  20.7k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  20.7k|         ctx.indent_stack.clear();
  353|  20.7k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.34k, False: 18.3k]
  ------------------
  354|  2.34k|            ctx.push_indent(span.base_indent - 1);
  355|  2.34k|         }
  356|       |
  357|  20.7k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  20.7k|         using V = std::remove_cvref_t<T>;
  360|  20.7k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  20.7k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  20.7k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  20.7k|         return true;
  367|  20.7k|      }
_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_:
 5310|  2.41M|      {
 5311|  2.41M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  2.41M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  2.41M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  2.41M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  2.41M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 2.41M, False: 0]
  ------------------
 5321|  2.41M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  2.41M|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2115|  2.42M|      {
 2116|  2.42M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 2.42M]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  2.42M|         yaml::node_preamble_state preamble{};
 2120|  2.42M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 17.9k, False: 2.41M]
  ------------------
 2121|  2.42M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  2.42M|                   return yaml::tag_valid_for_float(tag);
 2123|  2.42M|                }
 2124|  2.42M|                else {
 2125|  2.42M|                   return yaml::tag_valid_for_int(tag);
 2126|  2.42M|                }
 2127|  2.42M|             }))
 2128|  17.9k|            return;
 2129|       |
 2130|  2.41M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  2.41M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  2.41M|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  2.41M|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 50.9k, False: 2.36M]
  ------------------
 2138|  50.9k|               ++it;
 2139|  50.9k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 47.0k, False: 3.97k]
  |  Branch (2139:38): [True: 1.93k, False: 45.0k]
  |  Branch (2139:74): [True: 774, False: 44.3k]
  ------------------
 2140|  44.3k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 1.12k, False: 43.1k]
  ------------------
 2141|  3.84k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  3.84k|                  it += 3;
 2143|  3.84k|                  finalize();
 2144|  3.84k|                  return;
 2145|  3.84k|               }
 2146|  47.1k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 43.1k, False: 3.97k]
  |  Branch (2146:38): [True: 941, False: 42.2k]
  |  Branch (2146:74): [True: 816, False: 41.4k]
  ------------------
 2147|  41.4k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 2.33k, False: 39.0k]
  ------------------
 2148|  4.09k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  4.09k|                  it += 3;
 2150|  4.09k|                  finalize();
 2151|  4.09k|                  return;
 2152|  4.09k|               }
 2153|  43.0k|               it = start;
 2154|  43.0k|            }
 2155|       |
 2156|  2.40M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 9.02k, False: 2.39M]
  |  Branch (2156:31): [True: 25.7k, False: 2.36M]
  ------------------
 2157|  34.7k|               const char sign = *it;
 2158|  34.7k|               ++it;
 2159|  34.7k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 32.9k, False: 1.76k]
  |  Branch (2159:33): [True: 6.90k, False: 26.0k]
  ------------------
 2160|  6.90k|                  ++it;
 2161|  6.90k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 6.13k, False: 766]
  |  Branch (2161:41): [True: 1.79k, False: 4.34k]
  |  Branch (2161:77): [True: 1.11k, False: 3.22k]
  ------------------
 2162|  3.92k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 1.01k, False: 2.20k]
  ------------------
 2163|  3.92k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 2.94k, False: 979]
  ------------------
 2164|  2.94k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  2.94k|                     }
 2166|    979|                     else {
 2167|    979|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    979|                     }
 2169|  3.92k|                     it += 3;
 2170|  3.92k|                     finalize();
 2171|  3.92k|                     return;
 2172|  3.92k|                  }
 2173|  6.90k|               }
 2174|  30.8k|               it = start;
 2175|  30.8k|            }
 2176|  2.40M|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  2.39M|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  67.9M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 67.9M, False: 23.2k]
  ------------------
 2183|  67.9M|            const char c = *it;
 2184|  67.9M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 44.4k, False: 67.8M]
  |  Branch (2184:29): [True: 19.5k, False: 67.8M]
  |  Branch (2184:42): [True: 20.0k, False: 67.8M]
  |  Branch (2184:55): [True: 7.12k, False: 67.8M]
  |  Branch (2184:68): [True: 2.24M, False: 65.5M]
  |  Branch (2184:80): [True: 6.60k, False: 65.5M]
  |  Branch (2184:92): [True: 4.88k, False: 65.5M]
  |  Branch (2184:104): [True: 25.2k, False: 65.5M]
  ------------------
 2185|  2.37M|               break;
 2186|  2.37M|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  65.5M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 1.41M, False: 64.1M]
  ------------------
 2189|  1.41M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 1.54k, False: 1.41M]
  |  Branch (2189:39): [True: 7.20k, False: 1.40M]
  |  Branch (2189:59): [True: 1.77k, False: 1.40M]
  |  Branch (2189:80): [True: 1.74k, False: 1.39M]
  |  Branch (2189:101): [True: 3.44k, False: 1.39M]
  ------------------
 2190|  15.7k|                  break;
 2191|  15.7k|               }
 2192|  1.41M|            }
 2193|  65.5M|            ++it;
 2194|  65.5M|         }
 2195|       |
 2196|  2.41M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  2.41M|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 3.47k, False: 2.40M]
  ------------------
 2199|  3.47k|            ctx.error = error_code::parse_number_failure;
 2200|  3.47k|            return;
 2201|  3.47k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  2.40M|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  2.40M|            bool negative = false;
 2254|  2.40M|            std::string_view digits = num_str;
 2255|       |
 2256|  2.40M|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 2.39M, False: 11.8k]
  |  Branch (2256:37): [True: 24.7k, False: 2.37M]
  |  Branch (2256:62): [True: 6.07k, False: 2.36M]
  ------------------
 2257|  30.8k|               negative = (digits.front() == '-');
 2258|  30.8k|               digits.remove_prefix(1);
 2259|  30.8k|            }
 2260|       |
 2261|  2.40M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 349k, False: 2.05M]
  |  Branch (2261:38): [True: 55.0k, False: 294k]
  ------------------
 2262|  55.0k|               int base = 10;
 2263|  55.0k|               size_t offset = 0;
 2264|       |
 2265|  55.0k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 6.36k, False: 48.7k]
  |  Branch (2265:40): [True: 1.77k, False: 46.9k]
  ------------------
 2266|  8.13k|                  base = 16;
 2267|  8.13k|                  offset = 2;
 2268|  8.13k|               }
 2269|  46.9k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 1.97k, False: 44.9k]
  |  Branch (2269:45): [True: 1.41k, False: 43.5k]
  ------------------
 2270|  3.38k|                  base = 8;
 2271|  3.38k|                  offset = 2;
 2272|  3.38k|               }
 2273|  43.5k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 1.50k, False: 42.0k]
  |  Branch (2273:45): [True: 1.68k, False: 40.3k]
  ------------------
 2274|  3.19k|                  base = 2;
 2275|  3.19k|                  offset = 2;
 2276|  3.19k|               }
 2277|       |
 2278|  55.0k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 14.7k, False: 40.3k]
  ------------------
 2279|  14.7k|                  auto raw_digits = digits.substr(offset);
 2280|  14.7k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  14.7k|                  std::string clean_storage;
 2283|  14.7k|                  std::string_view clean_view;
 2284|  14.7k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 3.79k, False: 10.9k]
  ------------------
 2285|  3.79k|                     clean_storage.reserve(raw_digits.size());
 2286|  9.38M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 9.38M, False: 3.79k]
  ------------------
 2287|  9.38M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 9.37M, False: 10.1k]
  ------------------
 2288|  9.37M|                           clean_storage.push_back(c);
 2289|  9.37M|                        }
 2290|  9.38M|                     }
 2291|  3.79k|                     clean_view = clean_storage;
 2292|  3.79k|                  }
 2293|  10.9k|                  else {
 2294|  10.9k|                     clean_view = raw_digits;
 2295|  10.9k|                  }
 2296|       |
 2297|  14.7k|                  uint64_t parsed_int{};
 2298|  14.7k|                  auto [ptr, ec] =
 2299|  14.7k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  14.7k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 6.48k, False: 8.22k]
  |  Branch (2300:44): [True: 2.90k, False: 5.31k]
  ------------------
 2301|  9.39k|                     ctx.error = error_code::parse_number_failure;
 2302|  9.39k|                     finalize();
 2303|  9.39k|                     return;
 2304|  9.39k|                  }
 2305|       |
 2306|  5.31k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  5.31k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 2.89k, False: 2.42k]
  ------------------
 2308|  5.31k|                  finalize();
 2309|  5.31k|                  return;
 2310|  14.7k|               }
 2311|  55.0k|            }
 2312|  2.40M|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  2.39M|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  2.40M|         std::string clean_storage;
 2318|  2.40M|         std::string_view clean_view;
 2319|       |
 2320|  2.40M|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 6.16k, False: 2.40M]
  ------------------
 2321|  6.16k|            clean_storage.reserve(num_str.size());
 2322|  29.2M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 29.2M, False: 6.16k]
  ------------------
 2323|  29.2M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 29.2M, False: 32.6k]
  ------------------
 2324|  29.2M|                  clean_storage.push_back(c);
 2325|  29.2M|               }
 2326|  29.2M|            }
 2327|  6.16k|            clean_view = clean_storage;
 2328|  6.16k|         }
 2329|  2.40M|         else {
 2330|  2.40M|            clean_view = num_str;
 2331|  2.40M|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  2.40M|         auto parse_view = clean_view;
 2336|  2.40M|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 2.38M, False: 26.8k]
  |  Branch (2336:37): [True: 24.7k, False: 2.35M]
  ------------------
 2337|  24.7k|            parse_view.remove_prefix(1);
 2338|  24.7k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 11.7k, False: 12.9k]
  ------------------
 2339|  11.7k|               ctx.error = error_code::parse_number_failure;
 2340|  11.7k|               return;
 2341|  11.7k|            }
 2342|  24.7k|         }
 2343|       |
 2344|  2.39M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  2.39M|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  2.39M|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 81.9k, False: 2.31M]
  |  Branch (2347:45): [True: 101k, False: 2.21M]
  ------------------
 2348|   156k|               ctx.error = error_code::parse_number_failure;
 2349|   156k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  2.39M|         finalize();
 2360|  2.39M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  2.42M|      {
  466|  2.42M|         skip_inline_ws(it, end);
  467|       |
  468|  2.42M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 734, False: 2.42M]
  ------------------
  469|    734|            if constexpr (!AllowEmptyInput) {
  470|    734|               ctx.error = error_code::unexpected_end;
  471|    734|            }
  472|    734|            return true;
  473|    734|         }
  474|       |
  475|  2.42M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.42M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 404, False: 2.42M]
  ------------------
  477|    404|            ctx.error = error_code::syntax_error;
  478|    404|            return true;
  479|    404|         }
  480|  2.42M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 410, False: 2.42M]
  ------------------
  481|    410|            ctx.error = error_code::syntax_error;
  482|    410|            return true;
  483|    410|         }
  484|       |
  485|  2.42M|         skip_inline_ws(it, end);
  486|       |
  487|  2.42M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 490, False: 2.42M]
  ------------------
  488|    490|            if constexpr (!AllowEmptyInput) {
  489|    490|               ctx.error = error_code::unexpected_end;
  490|    490|            }
  491|    490|            return true;
  492|    490|         }
  493|       |
  494|  2.42M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 15.8k, False: 2.41M]
  ------------------
  495|  15.8k|            return true;
  496|  15.8k|         }
  497|       |
  498|  2.41M|         return false;
  499|  2.42M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2120|  2.42M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  2.42M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  2.42M|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  2.42M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  2.42M|      {
  409|  2.42M|         state.has_anchor = false;
  410|  2.42M|         state.anchor_name.clear();
  411|  2.42M|         state.anchor_start = nullptr;
  412|  2.42M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.42M|         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.42M|            else {
  421|  2.42M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 14.7k, False: 2.41M]
  ------------------
  422|  2.42M|            }
  423|  2.42M|         }
  424|       |
  425|  2.42M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.41M, False: 14.7k]
  |  Branch (425:27): [True: 10.3k, False: 2.40M]
  ------------------
  426|  10.3k|            ++it;
  427|  10.3k|            auto name = parse_anchor_name(it, end);
  428|  10.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 515, False: 9.81k]
  ------------------
  429|    515|               ctx.error = error_code::syntax_error;
  430|    515|               return true;
  431|    515|            }
  432|  9.81k|            skip_inline_ws(it, end);
  433|  9.81k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 655, False: 9.15k]
  ------------------
  434|    655|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    655|                  ctx.error = error_code::unexpected_end;
  436|    655|               }
  437|    655|               return true;
  438|    655|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  9.15k|            state.has_anchor = true;
  446|  9.15k|            state.anchor_name = std::string(name);
  447|  9.15k|            state.anchor_start = &*it;
  448|  9.15k|         }
  449|       |
  450|  2.42M|         return false;
  451|  2.42M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  2.42M|      {
  301|  2.42M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.42M]
  |  Branch (301:27): [True: 2.41M, False: 14.7k]
  ------------------
  302|       |
  303|  14.7k|         ++it; // skip '*'
  304|  14.7k|         auto name = parse_anchor_name(it, end);
  305|  14.7k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 817, False: 13.8k]
  ------------------
  306|    817|            ctx.error = error_code::syntax_error;
  307|    817|            return true;
  308|    817|         }
  309|       |
  310|  13.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  13.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.50k, False: 11.3k]
  ------------------
  312|  2.50k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.50k|            return true;
  314|  2.50k|         }
  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: 2.10k, False: 9.27k]
  ------------------
  322|  2.10k|            return true;
  323|  2.10k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  9.27k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 255, False: 9.01k]
  ------------------
  329|    255|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    255|            return true;
  331|    255|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  9.01k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.01k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 9.01k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  9.01k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 27, False: 8.98k]
  ------------------
  342|     27|            ctx.error = error_code::exceeded_max_expansion;
  343|     27|            ctx.custom_error_message = "alias expansion";
  344|     27|            return true;
  345|     27|         }
  346|       |
  347|  8.98k|         auto replay_it = span.begin;
  348|  8.98k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.98k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.98k|         ctx.indent_stack.clear();
  353|  8.98k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.27k, False: 6.71k]
  ------------------
  354|  2.27k|            ctx.push_indent(span.base_indent - 1);
  355|  2.27k|         }
  356|       |
  357|  8.98k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.98k|         using V = std::remove_cvref_t<T>;
  360|  8.98k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.98k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.98k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.98k|         return true;
  367|  9.01k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  2.39M|         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_:
 5310|  60.7k|      {
 5311|  60.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  60.7k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  60.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  60.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  60.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 60.7k, False: 0]
  ------------------
 5321|  60.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  60.7k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2080|  74.7k|      {
 2081|  74.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 74.7k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  74.7k|         yaml::node_preamble_state preamble{};
 2085|  74.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 16.8k, False: 57.8k]
  ------------------
 2086|  74.7k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  16.8k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  57.8k|         std::string str;
 2091|  57.8k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  57.8k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 5.30k, False: 52.5k]
  |  Branch (2093:31): [True: 2.78k, False: 49.7k]
  |  Branch (2093:48): [True: 2.66k, False: 47.1k]
  |  Branch (2093:65): [True: 1.03k, False: 46.0k]
  |  Branch (2093:81): [True: 1.50k, False: 44.5k]
  |  Branch (2093:97): [True: 945, False: 43.6k]
  ------------------
 2094|  43.6k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 2.12k, False: 41.5k]
  |  Branch (2094:29): [True: 880, False: 40.6k]
  |  Branch (2094:44): [True: 930, False: 39.6k]
  ------------------
 2095|  18.1k|            value = true;
 2096|  18.1k|         }
 2097|  39.6k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 11.4k, False: 28.2k]
  |  Branch (2097:37): [True: 2.09k, False: 26.1k]
  |  Branch (2097:55): [True: 2.15k, False: 23.9k]
  |  Branch (2097:73): [True: 2.16k, False: 21.7k]
  |  Branch (2097:88): [True: 17.2k, False: 4.53k]
  |  Branch (2097:103): [True: 934, False: 3.59k]
  ------------------
 2098|  39.1k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 949, False: 2.64k]
  |  Branch (2098:35): [True: 935, False: 1.71k]
  |  Branch (2098:51): [True: 1.17k, False: 535]
  ------------------
 2099|  39.1k|            value = false;
 2100|  39.1k|         }
 2101|    535|         else {
 2102|    535|            ctx.error = error_code::expected_true_or_false;
 2103|    535|         }
 2104|       |
 2105|  57.8k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  57.8k|      }
_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|  74.7k|      {
  466|  74.7k|         skip_inline_ws(it, end);
  467|       |
  468|  74.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 74.6k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|  74.6k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  74.6k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 22, False: 74.6k]
  ------------------
  477|     22|            ctx.error = error_code::syntax_error;
  478|     22|            return true;
  479|     22|         }
  480|  74.6k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 74.6k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  74.6k|         skip_inline_ws(it, end);
  486|       |
  487|  74.6k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 11, False: 74.6k]
  ------------------
  488|     11|            if constexpr (!AllowEmptyInput) {
  489|     11|               ctx.error = error_code::unexpected_end;
  490|     11|            }
  491|     11|            return true;
  492|     11|         }
  493|       |
  494|  74.6k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.7k, False: 57.8k]
  ------------------
  495|  16.7k|            return true;
  496|  16.7k|         }
  497|       |
  498|  57.8k|         return false;
  499|  74.6k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2086|  74.6k|                                             [](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|  74.6k|      {
  409|  74.6k|         state.has_anchor = false;
  410|  74.6k|         state.anchor_name.clear();
  411|  74.6k|         state.anchor_start = nullptr;
  412|  74.6k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  74.6k|         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|  74.6k|            else {
  421|  74.6k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 16.7k, False: 57.9k]
  ------------------
  422|  74.6k|            }
  423|  74.6k|         }
  424|       |
  425|  74.6k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 57.9k, False: 16.7k]
  |  Branch (425:27): [True: 11.9k, False: 46.0k]
  ------------------
  426|  11.9k|            ++it;
  427|  11.9k|            auto name = parse_anchor_name(it, end);
  428|  11.9k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 19, False: 11.8k]
  ------------------
  429|     19|               ctx.error = error_code::syntax_error;
  430|     19|               return true;
  431|     19|            }
  432|  11.8k|            skip_inline_ws(it, end);
  433|  11.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 42, False: 11.8k]
  ------------------
  434|     42|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     42|                  ctx.error = error_code::unexpected_end;
  436|     42|               }
  437|     42|               return true;
  438|     42|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  11.8k|            state.has_anchor = true;
  446|  11.8k|            state.anchor_name = std::string(name);
  447|  11.8k|            state.anchor_start = &*it;
  448|  11.8k|         }
  449|       |
  450|  74.5k|         return false;
  451|  74.6k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  74.6k|      {
  301|  74.6k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 74.6k]
  |  Branch (301:27): [True: 57.9k, False: 16.7k]
  ------------------
  302|       |
  303|  16.7k|         ++it; // skip '*'
  304|  16.7k|         auto name = parse_anchor_name(it, end);
  305|  16.7k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 29, False: 16.6k]
  ------------------
  306|     29|            ctx.error = error_code::syntax_error;
  307|     29|            return true;
  308|     29|         }
  309|       |
  310|  16.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  16.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 99, False: 16.5k]
  ------------------
  312|     99|            ctx.error = error_code::syntax_error; // undefined alias
  313|     99|            return true;
  314|     99|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  16.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  16.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.58k, False: 14.0k]
  ------------------
  322|  2.58k|            return true;
  323|  2.58k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  14.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 13.9k]
  ------------------
  329|     14|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     14|            return true;
  331|     14|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  13.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  13.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 13.9k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  13.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 13.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|  13.9k|         auto replay_it = span.begin;
  348|  13.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  13.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  13.9k|         ctx.indent_stack.clear();
  353|  13.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.34k, False: 9.64k]
  ------------------
  354|  4.34k|            ctx.push_indent(span.base_indent - 1);
  355|  4.34k|         }
  356|       |
  357|  13.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  13.9k|         using V = std::remove_cvref_t<T>;
  360|  13.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  13.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  13.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  13.9k|         return true;
  367|  13.9k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2466|  21.1k|      {
 2467|  21.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 21.1k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  21.1k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  21.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 14, False: 21.0k]
  ------------------
 2473|     14|            ctx.error = error_code::unexpected_end;
 2474|     14|            return;
 2475|     14|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  21.0k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 6.61k, False: 14.4k]
  ------------------
 2479|  6.61k|            ++it;
 2480|  6.61k|            return;
 2481|  6.61k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  14.4k|         auto start = it;
 2485|  68.0k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 67.0k, False: 985]
  |  Branch (2485:30): [True: 53.5k, False: 13.4k]
  ------------------
 2486|  53.5k|            ++it;
 2487|  53.5k|         }
 2488|       |
 2489|  14.4k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  14.4k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 68, False: 14.4k]
  ------------------
 2491|     68|            ctx.error = error_code::syntax_error;
 2492|     68|         }
 2493|  14.4k|      }
_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_:
 5310|  2.03M|      {
 5311|  2.03M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  2.03M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  2.03M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  2.03M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  2.03M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 2.03M, False: 0]
  ------------------
 5321|  2.03M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  2.03M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4616|  2.06M|      {
 4617|  2.06M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 2.06M]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|  2.06M|         yaml::node_preamble_state preamble{};
 4621|  2.06M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 35.9k, False: 2.02M]
  ------------------
 4622|  2.06M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  35.9k|            return;
 4624|       |
 4625|  2.02M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|  2.02M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 36, False: 2.02M]
  ------------------
 4627|     36|            return;
 4628|       |
 4629|  2.02M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|  2.02M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4631|       |
 4632|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4633|       |         // value of a key that existed before the read and adds new keys, while
 4634|       |         // pre-existing keys the document does not mention are preserved (like a
 4635|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4636|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4637|       |         // mappings disallow duplicate keys and the conformance suite expects
 4638|       |         // first-wins, which falls out of emplace into an empty map. Any
 4639|       |         // pre-existing entry the document leaves untouched is restored on scope
 4640|       |         // exit (including error paths). When the target starts empty (the common
 4641|       |         // case) this is a no-op with negligible cost.
 4642|  2.02M|         std::remove_cvref_t<T> preexisting_entries;
 4643|  2.02M|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 2.02M]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|  2.02M|         struct merge_restore_guard
 4648|  2.02M|         {
 4649|  2.02M|            std::remove_cvref_t<T>& target;
 4650|  2.02M|            std::remove_cvref_t<T>& saved;
 4651|  2.02M|            ~merge_restore_guard()
 4652|  2.02M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  2.02M|               for (auto& entry : saved) {
 4656|  2.02M|                  target.emplace(entry.first, std::move(entry.second));
 4657|  2.02M|               }
 4658|  2.02M|            }
 4659|  2.02M|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|  2.02M|         const bool treat_as_block_mapping =
 4662|  2.02M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [Folded, False: 2.02M]
  |  Branch (4662:48): [True: 0, False: 0]
  |  Branch (4662:62): [True: 0, False: 0]
  ------------------
 4663|       |
 4664|  2.02M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 1.25M, False: 771k]
  |  Branch (4664:28): [True: 0, Folded]
  ------------------
 4665|       |            // Flow mapping
 4666|  1.25M|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  1.25M|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  1.25M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 1.25M, False: 4.42k]
  |  Branch (4670:30): [True: 25.7k, False: 1.22M]
  ------------------
 4671|  25.7k|               ++it;
 4672|  25.7k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  25.7k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 29, False: 25.7k]
  ------------------
 4674|     29|                  return;
 4675|  25.7k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  25.7k|               return;
 4677|  25.7k|            }
 4678|       |
 4679|  3.97M|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 3.95M, False: 11.7k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  3.95M|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  3.95M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 3.95M, False: 0]
  |  Branch (4683:33): [True: 33.5k, False: 3.92M]
  ------------------
 4684|  33.5k|                  ++it;
 4685|  33.5k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  33.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 43, False: 33.5k]
  ------------------
 4687|     43|                     return;
 4688|  33.5k|                  break;
 4689|  33.5k|               }
 4690|       |
 4691|  3.92M|               bool explicit_flow_key = false;
 4692|  3.92M|               auto explicit_probe = it;
 4693|  3.92M|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  3.92M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 3.92M, False: 0]
  |  Branch (4694:45): [True: 50.3k, False: 3.87M]
  ------------------
 4695|  50.3k|                  const auto after_q = explicit_probe + 1;
 4696|  50.3k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 11, False: 50.3k]
  |  Branch (4696:41): [True: 30.6k, False: 19.6k]
  ------------------
 4697|  35.6k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 3.22k, False: 16.4k]
  |  Branch (4697:42): [True: 1.67k, False: 14.7k]
  ------------------
 4698|  35.6k|                     explicit_flow_key = true;
 4699|  35.6k|                     it = explicit_probe + 1;
 4700|  35.6k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  35.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 9, False: 35.5k]
  ------------------
 4702|      9|                        return;
 4703|  35.6k|                  }
 4704|  50.3k|               }
 4705|       |               // Parse key
 4706|  3.92M|               key_t key{};
 4707|  3.92M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  3.92M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 35.5k, False: 3.88M]
  |  Branch (4708:44): [True: 35.5k, False: 15]
  |  Branch (4708:58): [True: 2.76k, False: 32.8k]
  |  Branch (4708:72): [True: 8.62k, False: 24.1k]
  |  Branch (4708:86): [True: 2.19k, False: 21.9k]
  ------------------
 4709|  13.5k|                     key.clear();
 4710|  13.5k|                  }
 4711|  3.91M|                  else {
 4712|  3.91M|                     auto key_probe = it;
 4713|  3.91M|                     yaml::skip_inline_ws(key_probe, end);
 4714|       |
 4715|       |                     // Use full node parsing only for structurally complex flow keys.
 4716|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4717|  3.91M|                     bool parse_complex_flow_key = false;
 4718|  3.91M|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 3.91M, False: 15]
  ------------------
 4719|  3.91M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 12.9k, False: 3.89M]
  |  Branch (4719:50): [True: 75.6k, False: 3.82M]
  ------------------
 4720|  88.5k|                           parse_complex_flow_key = true;
 4721|  88.5k|                        }
 4722|  3.82M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 1.09M, False: 2.72M]
  ------------------
 4723|  1.09M|                           ++key_probe;
 4724|  1.09M|                           yaml::parse_anchor_name(key_probe, end);
 4725|  1.09M|                           yaml::skip_inline_ws(key_probe, end);
 4726|  1.09M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 1.09M, False: 173]
  |  Branch (4726:53): [True: 9.61k, False: 1.08M]
  |  Branch (4726:74): [True: 601k, False: 482k]
  ------------------
 4727|   611k|                              parse_complex_flow_key = true;
 4728|   611k|                           }
 4729|  1.09M|                        }
 4730|  3.91M|                     }
 4731|       |
 4732|  3.91M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 700k, False: 3.21M]
  ------------------
 4733|   700k|                        glz::generic key_node{};
 4734|   700k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|   700k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 29.5k, False: 670k]
  ------------------
 4736|  29.5k|                           return;
 4737|   670k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 60, False: 670k]
  ------------------
 4738|     60|                           return;
 4739|   670k|                     }
 4740|  3.21M|                     else {
 4741|  3.21M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 17.4k, False: 3.19M]
  ------------------
 4742|  17.4k|                           return;
 4743|  17.4k|                        }
 4744|  3.21M|                     }
 4745|  3.91M|                  }
 4746|       |               }
 4747|       |               else {
 4748|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4749|       |                     ctx.error = error_code::syntax_error;
 4750|       |                     return;
 4751|       |                  }
 4752|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4753|       |                  if (bool(ctx.error)) [[unlikely]]
 4754|       |                     return;
 4755|       |               }
 4756|       |
 4757|       |               // Separation between flow key and ':' may include comments/newlines.
 4758|       |               // In flow context, newlines are allowed between key and ':'.
 4759|  3.87M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  3.92M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 58, False: 3.92M]
  ------------------
 4761|     58|                  return;
 4762|       |
 4763|  3.92M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  3.92M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  3.92M|                     val = {};
 4766|  3.92M|                     return true;
 4767|  3.92M|                  }
 4768|  3.92M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  3.92M|                     val = glz::generic{};
 4770|  3.92M|                     return true;
 4771|  3.92M|                  }
 4772|  3.92M|                  else {
 4773|  3.92M|                     static constexpr std::string_view null_value{"null"};
 4774|  3.92M|                     auto null_it = null_value.data();
 4775|  3.92M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  3.92M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  3.92M|                     return !bool(ctx.error);
 4778|  3.92M|                  }
 4779|  3.92M|               };
 4780|       |
 4781|  3.92M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 3.87M, False: 48.8k]
  |  Branch (4781:34): [True: 1.50M, False: 2.37M]
  |  Branch (4781:48): [True: 418k, False: 1.95M]
  ------------------
 4782|  1.92M|                  val_t val{};
 4783|  1.92M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 1.92M]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|  1.92M|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|  1.92M|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 418k, False: 1.50M]
  ------------------
 4789|   418k|                     ++it;
 4790|   418k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|   418k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 540, False: 418k]
  ------------------
 4792|    540|                        return;
 4793|   418k|                     break;
 4794|   418k|                  }
 4795|       |
 4796|  1.50M|                  ++it; // skip comma
 4797|  1.50M|                  yaml::skip_ws_and_newlines(it, end);
 4798|  1.50M|                  continue;
 4799|  1.92M|               }
 4800|       |
 4801|  2.00M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 48.8k, False: 1.95M]
  |  Branch (4801:33): [True: 2.38k, False: 1.95M]
  ------------------
 4802|  4.18k|                  ctx.error = error_code::syntax_error;
 4803|  4.18k|                  return;
 4804|  4.18k|               }
 4805|  1.99M|               ++it;
 4806|       |
 4807|  1.99M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  1.99M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 15, False: 1.99M]
  ------------------
 4809|     15|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  1.99M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 1.95M, False: 47.2k]
  |  Branch (4812:34): [True: 77.1k, False: 1.87M]
  |  Branch (4812:48): [True: 36.5k, False: 1.83M]
  ------------------
 4813|   113k|                  val_t val{};
 4814|   113k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 113k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|   113k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|   113k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 36.5k, False: 77.1k]
  ------------------
 4820|  36.5k|                     ++it;
 4821|  36.5k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  36.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 17, False: 36.4k]
  ------------------
 4823|     17|                        return;
 4824|  36.4k|                     break;
 4825|  36.5k|                  }
 4826|       |
 4827|  77.1k|                  ++it; // skip comma
 4828|  77.1k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  77.1k|                  continue;
 4830|   113k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  1.88M|               val_t val{};
 4834|  1.88M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  1.88M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 9.64k, False: 1.87M]
  ------------------
 4836|  9.64k|                  return;
 4837|       |
 4838|  1.87M|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  1.87M|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  1.87M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 1.82M, False: 47.6k]
  |  Branch (4842:33): [True: 653k, False: 1.17M]
  ------------------
 4843|   653k|                  ++it;
 4844|   653k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|   653k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 786, False: 652k]
  ------------------
 4846|    786|                     return;
 4847|   652k|                  break;
 4848|   653k|               }
 4849|  1.22M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 1.17M, False: 47.6k]
  |  Branch (4849:38): [True: 1.11M, False: 60.5k]
  ------------------
 4850|  1.11M|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  1.11M|                  yaml::skip_ws_and_newlines(it, end);
 4853|  1.11M|               }
 4854|   108k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 60.5k, False: 47.6k]
  |  Branch (4854:39): [True: 29.0k, False: 31.5k]
  |  Branch (4854:54): [True: 30.5k, False: 985]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  59.6k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  59.6k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 59.5k, False: 58]
  |  Branch (4858:36): [True: 11.9k, False: 47.5k]
  ------------------
 4859|  11.9k|                     ++it;
 4860|  11.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  11.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 8, False: 11.9k]
  ------------------
 4862|      8|                        return;
 4863|  11.9k|                     break;
 4864|  11.9k|                  }
 4865|  47.6k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 47.5k, False: 58]
  |  Branch (4865:36): [True: 47.3k, False: 258]
  ------------------
 4866|  47.3k|                     ++it;
 4867|  47.3k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  47.3k|                     continue;
 4869|  47.3k|                  }
 4870|    316|                  ctx.error = error_code::syntax_error;
 4871|    316|                  return;
 4872|  47.6k|               }
 4873|  48.6k|               else {
 4874|  48.6k|                  ctx.error = error_code::syntax_error;
 4875|  48.6k|                  return;
 4876|  48.6k|               }
 4877|  1.87M|            }
 4878|  1.22M|         }
 4879|   771k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   771k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   771k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   771k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   771k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   771k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   771k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   771k|                           if (ctx.stream_begin) {
 4893|   771k|                              auto is_line_content_start = [&](auto pos) {
 4894|   771k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   771k|                              };
 4896|       |
 4897|   771k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   771k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   771k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   771k|                                 return line != end && *line == ':';
 4901|   771k|                              };
 4902|       |
 4903|   771k|                              if (!is_line_content_start(it) &&
 4904|   771k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   771k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   771k|                                 ctx.error = error_code::syntax_error;
 4907|   771k|                                 return false;
 4908|   771k|                              }
 4909|   771k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   771k|                           }
 4911|   771k|                        }
 4912|       |
 4913|   771k|                        if (*it == '-' &&
 4914|   771k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   771k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   771k|                           ctx.error = error_code::syntax_error;
 4918|   771k|                           return false;
 4919|   771k|                        }
 4920|       |
 4921|   771k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   771k|                           return false;
 4923|   771k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   771k|                        ctx.pop_indent();
 4925|   771k|                     }
 4926|   771k|                     else {
 4927|   771k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   771k|                        if (nested_indent >= 0) {
 4929|   771k|                           yaml::skip_to_content(it, end);
 4930|   771k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   771k|                              ctx.error = error_code::syntax_error;
 4932|   771k|                              return false;
 4933|   771k|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   771k|                           const int32_t value_indent =
 4937|   771k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   771k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   771k|                              return false;
 4940|   771k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   771k|                           ctx.pop_indent();
 4942|   771k|                        }
 4943|   771k|                     }
 4944|   771k|                     return !bool(ctx.error);
 4945|   771k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   771k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   771k|                     ctx.error = error_code::syntax_error;
 4952|   771k|                     return false;
 4953|   771k|                  }
 4954|   771k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   771k|                     ++it; // skip '?'
 4956|   771k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   771k|                     const int32_t explicit_value_indicator_indent =
 4959|   771k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   771k|                     key_t key{};
 4962|   771k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   771k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   771k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   771k|                        };
 4966|       |
 4967|   771k|                        auto key_it = it;
 4968|   771k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   771k|                        auto content = key_it;
 4971|   771k|                        yaml::skip_to_content(content, end);
 4972|   771k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   771k|                        if (content != end && *content == '&') {
 4978|   771k|                           auto anchor_probe = content + 1;
 4979|   771k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   771k|                           if (!anchor_name.empty()) {
 4981|   771k|                              auto after_anchor = anchor_probe;
 4982|   771k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   771k|                              auto value_indicator = after_anchor;
 4985|   771k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   771k|                                 key.clear();
 4987|   771k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   771k|                                 it = value_indicator;
 4989|   771k|                                 handled_anchor_only_empty_key = true;
 4990|   771k|                              }
 4991|   771k|                              else {
 4992|   771k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   771k|                                    yaml::skip_comment(value_indicator, end);
 4994|   771k|                                 }
 4995|   771k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   771k|                                    yaml::skip_newline(value_indicator, end);
 4997|   771k|                                    auto value_line = value_indicator;
 4998|   771k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   771k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   771k|                                       return false;
 5001|   771k|                                    if (value_line != end && *value_line == ':' &&
 5002|   771k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   771k|                                       key.clear();
 5004|   771k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   771k|                                       it = value_line;
 5006|   771k|                                       handled_anchor_only_empty_key = true;
 5007|   771k|                                    }
 5008|   771k|                                    else if (value_line != end && *value_line == ':') {
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|   771k|                                       ctx.error = error_code::syntax_error;
 5013|   771k|                                       return false;
 5014|   771k|                                    }
 5015|   771k|                                 }
 5016|   771k|                              }
 5017|   771k|                           }
 5018|   771k|                        }
 5019|       |
 5020|   771k|                        const bool key_content_spans_lines = [&] {
 5021|   771k|                           auto scan = key_it;
 5022|   771k|                           while (scan != content && scan != end) {
 5023|   771k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   771k|                              ++scan;
 5025|   771k|                           }
 5026|   771k|                           return false;
 5027|   771k|                        }();
 5028|       |
 5029|   771k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   771k|                        }
 5032|   771k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   771k|                           key.clear();
 5034|   771k|                           it = content;
 5035|   771k|                        }
 5036|   771k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   771k|                           auto key_node_it = content;
 5042|   771k|                           auto key_node_end = end;
 5043|   771k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   771k|                              auto scan = content;
 5048|   771k|                              while (scan != end) {
 5049|   771k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   771k|                                    ++scan;
 5051|   771k|                                 }
 5052|   771k|                                 if (scan == end) {
 5053|   771k|                                    break;
 5054|   771k|                                 }
 5055|       |
 5056|   771k|                                 yaml::skip_newline(scan, end);
 5057|   771k|                                 auto line_start = scan;
 5058|       |
 5059|   771k|                                 int32_t indicator_indent = 0;
 5060|   771k|                                 while (scan != end && *scan == ' ') {
 5061|   771k|                                    ++indicator_indent;
 5062|   771k|                                    ++scan;
 5063|   771k|                                 }
 5064|       |
 5065|   771k|                                 if (scan != end && *scan == ':') {
 5066|   771k|                                    const auto after_colon = scan + 1;
 5067|   771k|                                    if ((after_colon == end ||
 5068|   771k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   771k|                                        indicator_indent <= line_indent) {
 5070|   771k|                                       key_node_end = line_start;
 5071|   771k|                                       break;
 5072|   771k|                                    }
 5073|   771k|                                 }
 5074|   771k|                              }
 5075|   771k|                           }
 5076|       |
 5077|   771k|                           glz::generic key_node{};
 5078|   771k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   771k|                           ctx.explicit_mapping_key_context = true;
 5080|   771k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   771k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   771k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   771k|                              return false;
 5084|   771k|                           it = key_node_it;
 5085|   771k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   771k|                              return false;
 5087|   771k|                        }
 5088|   771k|                     }
 5089|   771k|                     else {
 5090|   771k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   771k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   771k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   771k|                              return false;
 5094|   771k|                        }
 5095|   771k|                     }
 5096|       |
 5097|   771k|                     yaml::skip_inline_ws(it, end);
 5098|   771k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   771k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   771k|                        auto probe = it;
 5103|   771k|                        bool found_value_indicator = false;
 5104|       |
 5105|   771k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   771k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   771k|                           auto value_line = probe;
 5109|   771k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   771k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   771k|                              return false;
 5112|       |
 5113|   771k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   771k|                              probe = value_line;
 5115|   771k|                              continue; // blank line
 5116|   771k|                           }
 5117|   771k|                           if (*value_line == '#') {
 5118|   771k|                              yaml::skip_comment(value_line, end);
 5119|   771k|                              probe = value_line;
 5120|   771k|                              continue; // comment-only line
 5121|   771k|                           }
 5122|   771k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   771k|                              it = value_line;
 5124|   771k|                              found_value_indicator = true;
 5125|   771k|                           }
 5126|   771k|                           break;
 5127|   771k|                        }
 5128|       |
 5129|   771k|                        if (found_value_indicator) {
 5130|   771k|                           yaml::skip_inline_ws(it, end);
 5131|   771k|                        }
 5132|   771k|                     }
 5133|       |
 5134|   771k|                     val_t val{};
 5135|   771k|                     if (it != end && *it == ':') {
 5136|   771k|                        ++it;
 5137|   771k|                        if (it != end && *it == '\t') {
 5138|   771k|                           ctx.error = error_code::syntax_error;
 5139|   771k|                           return false;
 5140|   771k|                        }
 5141|   771k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   771k|                           auto probe = it;
 5143|   771k|                           yaml::skip_newline(probe, end);
 5144|   771k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   771k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   771k|                              ctx.error = error_code::syntax_error;
 5147|   771k|                              return false;
 5148|   771k|                           }
 5149|   771k|                        }
 5150|   771k|                        yaml::skip_inline_ws(it, end);
 5151|   771k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   771k|                           return false;
 5153|   771k|                     }
 5154|       |
 5155|   771k|                     value.emplace(std::move(key), std::move(val));
 5156|   771k|                     return true;
 5157|   771k|                  }
 5158|       |
 5159|   771k|                  key_t key{};
 5160|   771k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   771k|                     auto key_probe = it;
 5162|   771k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   771k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   771k|                     if (complex_flow_key) {
 5165|   771k|                        glz::generic key_node{};
 5166|   771k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   771k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   771k|                           return false;
 5169|   771k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   771k|                           return false;
 5171|   771k|                     }
 5172|   771k|                     else {
 5173|   771k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   771k|                           return false;
 5175|   771k|                        }
 5176|   771k|                     }
 5177|   771k|                  }
 5178|   771k|                  else {
 5179|   771k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   771k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   771k|                        return false;
 5182|   771k|                  }
 5183|       |
 5184|   771k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   771k|                  if (it == end || *it != ':') {
 5187|   771k|                     ctx.error = error_code::syntax_error;
 5188|   771k|                     return false;
 5189|   771k|                  }
 5190|   771k|                  ++it;
 5191|   771k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   771k|                  val_t val{};
 5194|   771k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   771k|                     return false;
 5196|       |
 5197|   771k|                  value.emplace(std::move(key), std::move(val));
 5198|   771k|                  return true;
 5199|   771k|               });
 5200|   771k|         }
 5201|       |
 5202|  1.93M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|  1.93M|      }
_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.06M|      {
  466|  2.06M|         skip_inline_ws(it, end);
  467|       |
  468|  2.06M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 15, False: 2.06M]
  ------------------
  469|     15|            if constexpr (!AllowEmptyInput) {
  470|     15|               ctx.error = error_code::unexpected_end;
  471|     15|            }
  472|     15|            return true;
  473|     15|         }
  474|       |
  475|  2.06M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.06M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 2.06M]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|  2.06M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 2.06M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  2.06M|         skip_inline_ws(it, end);
  486|       |
  487|  2.06M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 16, False: 2.06M]
  ------------------
  488|     16|            if constexpr (!AllowEmptyInput) {
  489|     16|               ctx.error = error_code::unexpected_end;
  490|     16|            }
  491|     16|            return true;
  492|     16|         }
  493|       |
  494|  2.06M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 35.8k, False: 2.02M]
  ------------------
  495|  35.8k|            return true;
  496|  35.8k|         }
  497|       |
  498|  2.02M|         return false;
  499|  2.06M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4622|  2.06M|                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.06M|      {
  409|  2.06M|         state.has_anchor = false;
  410|  2.06M|         state.anchor_name.clear();
  411|  2.06M|         state.anchor_start = nullptr;
  412|  2.06M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.06M|         if constexpr (Policy.allow_alias) {
  415|  2.06M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  2.06M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 2.06M, False: 1.61k]
  ------------------
  417|  2.06M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 35.8k, False: 2.02M]
  ------------------
  418|  2.06M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  2.06M|         }
  424|       |
  425|  2.06M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.02M, False: 35.8k]
  |  Branch (425:27): [True: 25.3k, False: 2.00M]
  ------------------
  426|  25.3k|            ++it;
  427|  25.3k|            auto name = parse_anchor_name(it, end);
  428|  25.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 18, False: 25.3k]
  ------------------
  429|     18|               ctx.error = error_code::syntax_error;
  430|     18|               return true;
  431|     18|            }
  432|  25.3k|            skip_inline_ws(it, end);
  433|  25.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 29, False: 25.3k]
  ------------------
  434|     29|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     29|                  ctx.error = error_code::unexpected_end;
  436|     29|               }
  437|     29|               return true;
  438|     29|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  25.3k|            state.has_anchor = true;
  446|  25.3k|            state.anchor_name = std::string(name);
  447|  25.3k|            state.anchor_start = &*it;
  448|  25.3k|         }
  449|       |
  450|  2.06M|         return false;
  451|  2.06M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  2.06M|      {
  301|  2.06M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.06M]
  |  Branch (301:27): [True: 2.02M, False: 35.8k]
  ------------------
  302|       |
  303|  35.8k|         ++it; // skip '*'
  304|  35.8k|         auto name = parse_anchor_name(it, end);
  305|  35.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 30, False: 35.7k]
  ------------------
  306|     30|            ctx.error = error_code::syntax_error;
  307|     30|            return true;
  308|     30|         }
  309|       |
  310|  35.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  35.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 150, False: 35.6k]
  ------------------
  312|    150|            ctx.error = error_code::syntax_error; // undefined alias
  313|    150|            return true;
  314|    150|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  35.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  35.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.30k, False: 31.3k]
  ------------------
  322|  4.30k|            return true;
  323|  4.30k|         }
  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|  31.3k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 19, False: 31.3k]
  ------------------
  329|     19|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     19|            return true;
  331|     19|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  31.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  31.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 31.3k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  31.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 21, False: 31.2k]
  ------------------
  342|     21|            ctx.error = error_code::exceeded_max_expansion;
  343|     21|            ctx.custom_error_message = "alias expansion";
  344|     21|            return true;
  345|     21|         }
  346|       |
  347|  31.2k|         auto replay_it = span.begin;
  348|  31.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  31.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  31.2k|         ctx.indent_stack.clear();
  353|  31.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.49k, False: 28.7k]
  ------------------
  354|  2.49k|            ctx.push_indent(span.base_indent - 1);
  355|  2.49k|         }
  356|       |
  357|  31.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  31.2k|         using V = std::remove_cvref_t<T>;
  360|  31.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  31.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  31.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  31.2k|         return true;
  367|  31.3k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|  2.03M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|       |                     val = {};
 4766|       |                     return true;
 4767|       |                  }
 4768|  2.03M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  2.03M|                     val = glz::generic{};
 4770|  2.03M|                     return true;
 4771|       |                  }
 4772|       |                  else {
 4773|       |                     static constexpr std::string_view null_value{"null"};
 4774|       |                     auto null_it = null_value.data();
 4775|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|       |                     return !bool(ctx.error);
 4778|       |                  }
 4779|  2.03M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   771k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   771k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 771k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   771k|         const int32_t parent_indent = ctx.current_indent();
 3722|   771k|         const bool discover_indent = (mapping_indent < 0);
 3723|   771k|         bool first_key = !discover_indent;
 3724|   771k|         bool discovered_first_key_mid_line = false;
 3725|   771k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  1.85M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.19M, False: 664k]
  ------------------
 3728|  1.19M|            auto line_start = it;
 3729|  1.19M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.19M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  1.71M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 1.69M, False: 18.9k]
  ------------------
 3733|  1.69M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 39.0k, False: 1.65M]
  ------------------
 3734|  39.0k|                  skip_comment(it, end);
 3735|  39.0k|                  skip_newline(it, end);
 3736|  39.0k|                  first_key = false;
 3737|  39.0k|                  line_indent = 0;
 3738|  39.0k|               }
 3739|  1.65M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 83.2k, False: 1.57M]
  |  Branch (3739:40): [True: 340k, False: 1.23M]
  ------------------
 3740|   423k|                  skip_newline(it, end);
 3741|   423k|                  first_key = false;
 3742|   423k|                  line_indent = 0;
 3743|   423k|               }
 3744|  1.23M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 224k, False: 1.00M]
  ------------------
 3745|   224k|                  line_start = it;
 3746|   224k|                  line_indent = 0;
 3747|  1.01M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 1.01M, False: 7.87k]
  |  Branch (3747:39): [True: 795k, False: 216k]
  ------------------
 3748|   795k|                     ++line_indent;
 3749|   795k|                     ++it;
 3750|   795k|                  }
 3751|       |
 3752|   224k|                  bool saw_tab = false;
 3753|   230k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 220k, False: 9.42k]
  |  Branch (3753:40): [True: 1.31k, False: 219k]
  |  Branch (3753:54): [True: 4.81k, False: 214k]
  ------------------
 3754|  6.13k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 3.39k, False: 2.74k]
  |  Branch (3754:43): [True: 2.74k, False: 0]
  ------------------
 3755|  6.13k|                     ++it;
 3756|  6.13k|                  }
 3757|       |
 3758|   224k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 9.42k, False: 214k]
  |  Branch (3758:36): [True: 7.62k, False: 207k]
  |  Branch (3758:51): [True: 4.93k, False: 202k]
  |  Branch (3758:66): [True: 7.31k, False: 194k]
  ------------------
 3759|  29.2k|                     first_key = false;
 3760|  29.2k|                     line_indent = 0;
 3761|  29.2k|                     continue; // Blank or comment line
 3762|  29.2k|                  }
 3763|       |
 3764|   194k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 106, False: 194k]
  ------------------
 3765|    106|                     ctx.error = error_code::syntax_error;
 3766|    106|                     return;
 3767|    106|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   194k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 189k, False: 5.20k]
  |  Branch (3770:46): [True: 1.15k, False: 188k]
  ------------------
 3771|  1.15k|                     it = line_start;
 3772|  1.15k|                     return;
 3773|  1.15k|                  }
 3774|       |
 3775|   193k|                  first_key = false;
 3776|   193k|                  break; // Found content
 3777|   194k|               }
 3778|  1.00M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 29.0k, False: 980k]
  ------------------
 3779|  29.0k|                  line_start = it;
 3780|  66.0k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 64.5k, False: 1.48k]
  |  Branch (3780:40): [True: 3.39k, False: 61.1k]
  |  Branch (3780:54): [True: 33.6k, False: 27.5k]
  ------------------
 3781|  29.0k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 1.48k, False: 27.5k]
  |  Branch (3781:36): [True: 3.20k, False: 24.3k]
  |  Branch (3781:51): [True: 23.2k, False: 1.03k]
  |  Branch (3781:66): [True: 904, False: 127]
  ------------------
 3782|  28.8k|                     first_key = false;
 3783|  28.8k|                     line_indent = 0;
 3784|  28.8k|                     continue; // Blank or comment-only line with tab indentation
 3785|  28.8k|                  }
 3786|    127|                  ctx.error = error_code::syntax_error;
 3787|    127|                  return;
 3788|  29.0k|               }
 3789|   980k|               else {
 3790|   980k|                  line_start = it;
 3791|   980k|                  break; // Content at column 0
 3792|   980k|               }
 3793|  1.69M|            }
 3794|       |
 3795|  1.19M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 18.9k, False: 1.17M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.17M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 3.98k, False: 1.16M]
  |  Branch (3799:45): [True: 3.43k, False: 1.16M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.16M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.16M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.16M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.16M, False: 0]
  |  Branch (3806:39): [True: 396k, False: 769k]
  |  Branch (3806:62): [True: 53.4k, False: 343k]
  |  Branch (3806:84): [True: 36.4k, False: 17.0k]
  ------------------
 3807|  36.4k|                  it = line_start;
 3808|  36.4k|                  return;
 3809|  36.4k|               }
 3810|  1.13M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 360k, False: 769k]
  |  Branch (3810:43): [True: 839, False: 359k]
  ------------------
 3811|    839|                  it = line_start;
 3812|    839|                  return;
 3813|    839|               }
 3814|  1.13M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.12M|            bool established_mapping_indent_this_line = false;
 3818|  1.12M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 769k, False: 359k]
  ------------------
 3819|   769k|               mapping_indent = line_indent;
 3820|   769k|               established_mapping_indent_this_line = true;
 3821|   769k|               discovered_first_key_visual_indent = line_indent;
 3822|   769k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   769k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 769k, False: 0]
  |  Branch (3823:43): [True: 769k, False: 0]
  ------------------
 3824|   769k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   769k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 329, False: 769k]
  ------------------
 3826|    329|                        ctx.error = error_code::syntax_error;
 3827|    329|                        return;
 3828|    329|                     }
 3829|       |
 3830|   769k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   769k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 764k, False: 5.20k]
  |  Branch (3831:49): [True: 608k, False: 155k]
  ------------------
 3832|   608k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   608k|                     }
 3834|   769k|                  }
 3835|   769k|               }
 3836|   769k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.12M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.12M, False: 329]
  |  Branch (3840:36): [True: 1.12M, False: 0]
  |  Branch (3840:59): [True: 359k, False: 769k]
  ------------------
 3841|   359k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 171k, False: 187k]
  ------------------
 3842|   171k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 171k, False: 944]
  |  Branch (3842:43): [True: 86.6k, False: 84.3k]
  ------------------
 3843|  86.6k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 75, False: 86.5k]
  ------------------
 3844|     75|                     ctx.error = error_code::syntax_error;
 3845|     75|                     return;
 3846|     75|                  }
 3847|  86.5k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 2.90k, False: 83.6k]
  ------------------
 3848|  2.90k|                     it = line_start;
 3849|  2.90k|                     return;
 3850|  2.90k|                  }
 3851|  86.5k|               }
 3852|  85.3k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 809, False: 84.5k]
  ------------------
 3853|    809|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 59, False: 750]
  |  Branch (3853:47): [True: 8, False: 742]
  ------------------
 3854|    742|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 742, False: 0]
  |  Branch (3854:49): [True: 742, False: 0]
  |  Branch (3854:72): [True: 9, False: 733]
  ------------------
 3855|     76|                  ctx.error = error_code::syntax_error;
 3856|     76|                  return;
 3857|     76|               }
 3858|   171k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.12M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.12M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.12M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.12M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.12M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 329, False: 1.12M]
  |  Branch (3876:32): [True: 0, False: 1.12M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.12M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 377k, False: 748k]
  |  Branch (3885:53): [True: 127k, False: 249k]
  |  Branch (3885:94): [True: 44.8k, False: 83.1k]
  ------------------
 3886|  44.8k|               const auto after_colon = it + 1;
 3887|  44.8k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 39.9k, False: 4.82k]
  ------------------
 3888|  44.8k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 1.06k, False: 43.7k]
  |  Branch (3888:43): [True: 41.2k, False: 2.46k]
  ------------------
 3889|  42.3k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 3.12k, False: 39.2k]
  ------------------
 3890|  3.12k|                  it = line_start;
 3891|  3.12k|                  return;
 3892|  3.12k|               }
 3893|  44.8k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.12M|            int32_t effective_line_indent = line_indent;
 3897|  1.12M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.12M, False: 329]
  |  Branch (3897:36): [True: 769k, False: 353k]
  ------------------
 3898|   769k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 608k, False: 160k]
  ------------------
 3899|   608k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 441k, False: 166k]
  |  Branch (3899:52): [True: 267k, False: 174k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   341k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   341k|            }
 3912|       |
 3913|  1.12M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 35.9k, False: 1.08M]
  ------------------
 3914|  35.9k|               return;
 3915|  35.9k|            }
 3916|  1.08M|            first_key = false;
 3917|       |
 3918|  1.08M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.08M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|  1.08M|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|  1.08M|               auto flow_end = it;
 3925|  1.08M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|  1.08M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 116, False: 1.08M]
  ------------------
 3927|    116|                  return;
 3928|  1.08M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 907k, False: 179k]
  |  Branch (3928:40): [True: 365k, False: 542k]
  |  Branch (3928:60): [True: 13.7k, False: 528k]
  |  Branch (3928:80): [True: 122k, False: 406k]
  ------------------
 3929|   501k|                  it = flow_end;
 3930|   501k|                  return;
 3931|   501k|               }
 3932|  1.08M|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.08M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 443k, False: 644k]
  ------------------
 3938|   443k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 109k, False: 333k]
  |  Branch (3938:34): [True: 3.67k, False: 329k]
  ------------------
 3939|   113k|                  auto peek = it;
 3940|   113k|                  skip_inline_ws(peek, end);
 3941|   113k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 107k, False: 5.49k]
  |  Branch (3941:38): [True: 103k, False: 4.26k]
  |  Branch (3941:55): [True: 100k, False: 3.25k]
  |  Branch (3941:72): [True: 95.6k, False: 4.77k]
  ------------------
 3942|  95.6k|                     continue; // At leading indent of new line
 3943|  95.6k|                  }
 3944|   113k|               }
 3945|   347k|               skip_inline_ws(it, end);
 3946|   347k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 341k, False: 5.49k]
  |  Branch (3946:33): [True: 18.2k, False: 323k]
  ------------------
 3947|  18.2k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  18.2k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 18.2k, False: 0]
  ------------------
 3949|  18.2k|                        const char prev = *(it - 1);
 3950|  18.2k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 7.35k, False: 10.9k]
  |  Branch (3950:44): [True: 4.28k, False: 3.06k]
  |  Branch (3950:60): [True: 2.04k, False: 2.23k]
  |  Branch (3950:76): [True: 18, False: 2.02k]
  ------------------
 3951|     18|                           ctx.error = error_code::syntax_error;
 3952|     18|                           return;
 3953|     18|                        }
 3954|  18.2k|                     }
 3955|  18.2k|                  }
 3956|  18.2k|               }
 3957|  18.2k|               skip_comment(it, end);
 3958|   347k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 341k, False: 6.24k]
  |  Branch (3958:34): [True: 78.3k, False: 262k]
  |  Branch (3958:49): [True: 124k, False: 138k]
  ------------------
 3959|   202k|                  skip_newline(it, end);
 3960|   202k|               }
 3961|   144k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 138k, False: 6.24k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   138k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   138k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 584, False: 138k]
  ------------------
 3968|    584|                        ctx.error = error_code::syntax_error;
 3969|    584|                        return;
 3970|    584|                     }
 3971|   138k|                  }
 3972|   138k|               }
 3973|   347k|            }
 3974|  1.08M|         }
 3975|   771k|      }
_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:
 4882|  1.12M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.12M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.12M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.12M|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|  1.12M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.12M|                           if (ctx.stream_begin) {
 4893|  1.12M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.12M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.12M|                              };
 4896|       |
 4897|  1.12M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.12M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.12M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.12M|                                 return line != end && *line == ':';
 4901|  1.12M|                              };
 4902|       |
 4903|  1.12M|                              if (!is_line_content_start(it) &&
 4904|  1.12M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.12M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.12M|                                 ctx.error = error_code::syntax_error;
 4907|  1.12M|                                 return false;
 4908|  1.12M|                              }
 4909|  1.12M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.12M|                           }
 4911|  1.12M|                        }
 4912|       |
 4913|  1.12M|                        if (*it == '-' &&
 4914|  1.12M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.12M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.12M|                           ctx.error = error_code::syntax_error;
 4918|  1.12M|                           return false;
 4919|  1.12M|                        }
 4920|       |
 4921|  1.12M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.12M|                           return false;
 4923|  1.12M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.12M|                        ctx.pop_indent();
 4925|  1.12M|                     }
 4926|  1.12M|                     else {
 4927|  1.12M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.12M|                        if (nested_indent >= 0) {
 4929|  1.12M|                           yaml::skip_to_content(it, end);
 4930|  1.12M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.12M|                              ctx.error = error_code::syntax_error;
 4932|  1.12M|                              return false;
 4933|  1.12M|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  1.12M|                           const int32_t value_indent =
 4937|  1.12M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.12M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.12M|                              return false;
 4940|  1.12M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.12M|                           ctx.pop_indent();
 4942|  1.12M|                        }
 4943|  1.12M|                     }
 4944|  1.12M|                     return !bool(ctx.error);
 4945|  1.12M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.12M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 449k, False: 673k]
  |  Branch (4950:37): [True: 447k, False: 1.27k]
  |  Branch (4950:58): [True: 6, False: 447k]
  ------------------
 4951|      6|                     ctx.error = error_code::syntax_error;
 4952|      6|                     return false;
 4953|      6|                  }
 4954|  1.12M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 449k, False: 673k]
  |  Branch (4954:38): [True: 1.27k, False: 447k]
  |  Branch (4954:57): [True: 140k, False: 307k]
  |  Branch (4954:77): [True: 195k, False: 112k]
  |  Branch (4954:98): [True: 85.3k, False: 26.8k]
  ------------------
 4955|   422k|                     ++it; // skip '?'
 4956|   422k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   422k|                     const int32_t explicit_value_indicator_indent =
 4959|   422k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 296k, False: 125k]
  ------------------
 4960|       |
 4961|   422k|                     key_t key{};
 4962|   422k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   422k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   422k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   422k|                        };
 4966|       |
 4967|   422k|                        auto key_it = it;
 4968|   422k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   422k|                        auto content = key_it;
 4971|   422k|                        yaml::skip_to_content(content, end);
 4972|   422k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   422k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 415k, False: 6.90k]
  |  Branch (4977:47): [True: 127k, False: 287k]
  ------------------
 4978|   127k|                           auto anchor_probe = content + 1;
 4979|   127k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   127k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 127k, False: 43]
  ------------------
 4981|   127k|                              auto after_anchor = anchor_probe;
 4982|   127k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   127k|                              auto value_indicator = after_anchor;
 4985|   127k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 119k, False: 7.82k]
  |  Branch (4985:61): [True: 8.91k, False: 110k]
  ------------------
 4986|  8.91k|                                 key.clear();
 4987|  8.91k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  8.91k|                                 it = value_indicator;
 4989|  8.91k|                                 handled_anchor_only_empty_key = true;
 4990|  8.91k|                              }
 4991|   118k|                              else {
 4992|   118k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 110k, False: 7.82k]
  |  Branch (4992:64): [True: 5.95k, False: 104k]
  ------------------
 4993|  5.95k|                                    yaml::skip_comment(value_indicator, end);
 4994|  5.95k|                                 }
 4995|   118k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 110k, False: 8.29k]
  |  Branch (4995:65): [True: 16.9k, False: 93.4k]
  |  Branch (4995:93): [True: 40.0k, False: 53.3k]
  ------------------
 4996|  56.9k|                                    yaml::skip_newline(value_indicator, end);
 4997|  56.9k|                                    auto value_line = value_indicator;
 4998|  56.9k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  56.9k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 12, False: 56.9k]
  ------------------
 5000|     12|                                       return false;
 5001|  56.9k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 54.1k, False: 2.84k]
  |  Branch (5001:62): [True: 4.81k, False: 49.3k]
  ------------------
 5002|  4.81k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 4.79k, False: 15]
  ------------------
 5003|  4.79k|                                       key.clear();
 5004|  4.79k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  4.79k|                                       it = value_line;
 5006|  4.79k|                                       handled_anchor_only_empty_key = true;
 5007|  4.79k|                                    }
 5008|  52.1k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 49.3k, False: 2.84k]
  |  Branch (5008:67): [True: 15, False: 49.3k]
  ------------------
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|     15|                                       ctx.error = error_code::syntax_error;
 5013|     15|                                       return false;
 5014|     15|                                    }
 5015|  56.9k|                                 }
 5016|   118k|                              }
 5017|   127k|                           }
 5018|   127k|                        }
 5019|       |
 5020|   422k|                        const bool key_content_spans_lines = [&] {
 5021|   422k|                           auto scan = key_it;
 5022|   422k|                           while (scan != content && scan != end) {
 5023|   422k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   422k|                              ++scan;
 5025|   422k|                           }
 5026|   422k|                           return false;
 5027|   422k|                        }();
 5028|       |
 5029|   422k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 13.7k, False: 408k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  13.7k|                        }
 5032|   408k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 6.90k, False: 401k]
  |  Branch (5032:53): [True: 12.2k, False: 389k]
  |  Branch (5032:72): [True: 9.07k, False: 3.20k]
  ------------------
 5033|  15.9k|                           key.clear();
 5034|  15.9k|                           it = content;
 5035|  15.9k|                        }
 5036|   392k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   392k|                           auto key_node_it = content;
 5042|   392k|                           auto key_node_end = end;
 5043|   392k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   392k|                              auto scan = content;
 5048|  4.27M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 4.22M, False: 53.4k]
  ------------------
 5049|   224M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 223M, False: 239k]
  |  Branch (5049:56): [True: 222M, False: 1.30M]
  |  Branch (5049:73): [True: 219M, False: 2.68M]
  ------------------
 5050|   219M|                                    ++scan;
 5051|   219M|                                 }
 5052|  4.22M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 239k, False: 3.98M]
  ------------------
 5053|   239k|                                    break;
 5054|   239k|                                 }
 5055|       |
 5056|  3.98M|                                 yaml::skip_newline(scan, end);
 5057|  3.98M|                                 auto line_start = scan;
 5058|       |
 5059|  3.98M|                                 int32_t indicator_indent = 0;
 5060|  5.73M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 5.68M, False: 53.4k]
  |  Branch (5060:56): [True: 1.75M, False: 3.92M]
  ------------------
 5061|  1.75M|                                    ++indicator_indent;
 5062|  1.75M|                                    ++scan;
 5063|  1.75M|                                 }
 5064|       |
 5065|  3.98M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 3.92M, False: 53.4k]
  |  Branch (5065:53): [True: 252k, False: 3.67M]
  ------------------
 5066|   252k|                                    const auto after_colon = scan + 1;
 5067|   252k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 2.64k, False: 250k]
  ------------------
 5068|   250k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 209k, False: 40.9k]
  ------------------
 5069|   211k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 99.4k, False: 112k]
  ------------------
 5070|  99.4k|                                       key_node_end = line_start;
 5071|  99.4k|                                       break;
 5072|  99.4k|                                    }
 5073|   252k|                                 }
 5074|  3.98M|                              }
 5075|   392k|                           }
 5076|       |
 5077|   392k|                           glz::generic key_node{};
 5078|   392k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   392k|                           ctx.explicit_mapping_key_context = true;
 5080|   392k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   392k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   392k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 5.15k, False: 387k]
  ------------------
 5083|  5.15k|                              return false;
 5084|   387k|                           it = key_node_it;
 5085|   387k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 19, False: 387k]
  ------------------
 5086|     19|                              return false;
 5087|   387k|                        }
 5088|       |                     }
 5089|       |                     else {
 5090|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|       |                           if (bool(ctx.error)) [[unlikely]]
 5093|       |                              return false;
 5094|       |                        }
 5095|       |                     }
 5096|       |
 5097|   416k|                     yaml::skip_inline_ws(it, end);
 5098|   422k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   422k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 353k, False: 69.1k]
  |  Branch (5101:40): [True: 29.4k, False: 323k]
  |  Branch (5101:55): [True: 73.8k, False: 249k]
  ------------------
 5102|   103k|                        auto probe = it;
 5103|   103k|                        bool found_value_indicator = false;
 5104|       |
 5105|   145k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 130k, False: 15.2k]
  |  Branch (5105:49): [True: 40.4k, False: 89.8k]
  |  Branch (5105:67): [True: 89.8k, False: 27]
  ------------------
 5106|   130k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   130k|                           auto value_line = probe;
 5109|   130k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   130k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 6, False: 130k]
  ------------------
 5111|      6|                              return false;
 5112|       |
 5113|   130k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 14.3k, False: 115k]
  |  Branch (5113:53): [True: 6.10k, False: 109k]
  |  Branch (5113:76): [True: 11.2k, False: 98.5k]
  ------------------
 5114|  31.7k|                              probe = value_line;
 5115|  31.7k|                              continue; // blank line
 5116|  31.7k|                           }
 5117|  98.5k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 10.4k, False: 88.1k]
  ------------------
 5118|  10.4k|                              yaml::skip_comment(value_line, end);
 5119|  10.4k|                              probe = value_line;
 5120|  10.4k|                              continue; // comment-only line
 5121|  10.4k|                           }
 5122|  88.1k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 42.9k, False: 45.1k]
  |  Branch (5122:54): [True: 13.4k, False: 29.5k]
  ------------------
 5123|  13.4k|                              it = value_line;
 5124|  13.4k|                              found_value_indicator = true;
 5125|  13.4k|                           }
 5126|  88.1k|                           break;
 5127|  98.5k|                        }
 5128|       |
 5129|   103k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 13.4k, False: 89.8k]
  ------------------
 5130|  13.4k|                           yaml::skip_inline_ws(it, end);
 5131|  13.4k|                        }
 5132|   103k|                     }
 5133|       |
 5134|   422k|                     val_t val{};
 5135|   422k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 353k, False: 69.1k]
  |  Branch (5135:39): [True: 130k, False: 222k]
  ------------------
 5136|   130k|                        ++it;
 5137|   130k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 127k, False: 3.18k]
  |  Branch (5137:42): [True: 9, False: 127k]
  ------------------
 5138|      9|                           ctx.error = error_code::syntax_error;
 5139|      9|                           return false;
 5140|      9|                        }
 5141|   130k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 127k, False: 3.18k]
  |  Branch (5141:43): [True: 11.0k, False: 116k]
  |  Branch (5141:58): [True: 35.0k, False: 81.2k]
  ------------------
 5142|  46.1k|                           auto probe = it;
 5143|  46.1k|                           yaml::skip_newline(probe, end);
 5144|  89.0k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 83.4k, False: 5.55k]
  |  Branch (5144:51): [True: 42.9k, False: 40.5k]
  ------------------
 5145|  46.1k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 40.5k, False: 5.55k]
  |  Branch (5145:48): [True: 14.3k, False: 26.1k]
  |  Branch (5145:65): [True: 13.5k, False: 853]
  |  Branch (5145:89): [True: 4, False: 13.5k]
  ------------------
 5146|      4|                              ctx.error = error_code::syntax_error;
 5147|      4|                              return false;
 5148|      4|                           }
 5149|  46.1k|                        }
 5150|   130k|                        yaml::skip_inline_ws(it, end);
 5151|   130k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 850, False: 129k]
  ------------------
 5152|    850|                           return false;
 5153|   130k|                     }
 5154|       |
 5155|   421k|                     value.emplace(std::move(key), std::move(val));
 5156|   421k|                     return true;
 5157|   422k|                  }
 5158|       |
 5159|   700k|                  key_t key{};
 5160|   700k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   700k|                     auto key_probe = it;
 5162|   700k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   700k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 700k, False: 0]
  |  Branch (5163:74): [True: 3.84k, False: 696k]
  |  Branch (5163:95): [True: 2.83k, False: 693k]
  ------------------
 5164|   700k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 6.68k, False: 693k]
  ------------------
 5165|  6.68k|                        glz::generic key_node{};
 5166|  6.68k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  6.68k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 2.30k, False: 4.38k]
  ------------------
 5168|  2.30k|                           return false;
 5169|  4.38k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 4, False: 4.37k]
  ------------------
 5170|      4|                           return false;
 5171|  4.38k|                     }
 5172|   693k|                     else {
 5173|   693k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 2.06k, False: 691k]
  ------------------
 5174|  2.06k|                           return false;
 5175|  2.06k|                        }
 5176|   693k|                     }
 5177|       |                  }
 5178|       |                  else {
 5179|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|       |                     if (bool(ctx.error)) [[unlikely]]
 5181|       |                        return false;
 5182|       |                  }
 5183|       |
 5184|   696k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   700k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 4.55k, False: 696k]
  |  Branch (5186:36): [True: 549, False: 695k]
  ------------------
 5187|    730|                     ctx.error = error_code::syntax_error;
 5188|    730|                     return false;
 5189|    730|                  }
 5190|   699k|                  ++it;
 5191|   699k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   699k|                  val_t val{};
 5194|   699k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 24.7k, False: 675k]
  ------------------
 5195|  24.7k|                     return false;
 5196|       |
 5197|   675k|                  value.emplace(std::move(key), std::move(val));
 5198|   675k|                  return true;
 5199|   699k|               });
_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:
 5020|   422k|                        const bool key_content_spans_lines = [&] {
 5021|   422k|                           auto scan = key_it;
 5022|   453k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 321k, False: 132k]
  |  Branch (5022:54): [True: 321k, False: 0]
  ------------------
 5023|   321k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 200k, False: 121k]
  |  Branch (5023:52): [True: 89.6k, False: 31.5k]
  ------------------
 5024|  31.5k|                              ++scan;
 5025|  31.5k|                           }
 5026|   132k|                           return false;
 5027|   422k|                        }();
_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_:
 4963|   387k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   387k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   387k|                        };
_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_:
 4883|   826k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   826k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 812k, False: 13.5k]
  |  Branch (4884:39): [True: 598k, False: 213k]
  ------------------
 4885|   598k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   598k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   598k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 598k, False: 0]
  ------------------
 4893|   598k|                              auto is_line_content_start = [&](auto pos) {
 4894|   598k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   598k|                              };
 4896|       |
 4897|   598k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   598k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   598k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   598k|                                 return line != end && *line == ':';
 4901|   598k|                              };
 4902|       |
 4903|   598k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 598k, False: 0]
  ------------------
 4904|   598k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 43.1k, False: 555k]
  ------------------
 4905|  43.1k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 764, False: 42.4k]
  ------------------
 4906|    764|                                 ctx.error = error_code::syntax_error;
 4907|    764|                                 return false;
 4908|    764|                              }
 4909|   598k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   598k|                           }
 4911|   598k|                        }
 4912|       |
 4913|   598k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 14.8k, False: 584k]
  ------------------
 4914|  14.8k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 844, False: 14.0k]
  |  Branch (4914:49): [True: 1.79k, False: 12.2k]
  ------------------
 4915|  2.64k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 27, False: 2.61k]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     27|                           ctx.error = error_code::syntax_error;
 4918|     27|                           return false;
 4919|     27|                        }
 4920|       |
 4921|   598k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 598k]
  ------------------
 4922|      0|                           return false;
 4923|   598k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   598k|                        ctx.pop_indent();
 4925|   598k|                     }
 4926|   227k|                     else {
 4927|   227k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   227k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 70.8k, False: 156k]
  ------------------
 4929|  70.8k|                           yaml::skip_to_content(it, end);
 4930|  70.8k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 70.8k, False: 0]
  |  Branch (4930:45): [True: 0, False: 70.8k]
  |  Branch (4930:59): [True: 0, False: 0]
  |  Branch (4930:78): [True: 0, False: 0]
  ------------------
 4931|      0|                              ctx.error = error_code::syntax_error;
 4932|      0|                              return false;
 4933|      0|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  70.8k|                           const int32_t value_indent =
 4937|  70.8k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 70.8k]
  ------------------
 4938|  70.8k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 70.8k]
  ------------------
 4939|      0|                              return false;
 4940|  70.8k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  70.8k|                           ctx.pop_indent();
 4942|  70.8k|                        }
 4943|   227k|                     }
 4944|   825k|                     return !bool(ctx.error);
 4945|   826k|                  };
_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_:
 4893|   598k|                              auto is_line_content_start = [&](auto pos) {
 4894|   598k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   598k|                              };
_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_:
 4897|   641k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   641k|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.21M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 1.21M, False: 0]
  |  Branch (4899:57): [True: 568k, False: 642k]
  |  Branch (4899:73): [True: 1.39k, False: 641k]
  ------------------
 4900|   641k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 641k, False: 0]
  |  Branch (4900:56): [True: 382k, False: 258k]
  ------------------
 4901|   641k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|  2.02M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  2.02M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 2.02M]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|  2.02M|            }
_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_:
 5310|   320k|      {
 5311|   320k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   320k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   320k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   320k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   320k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 320k, False: 0]
  ------------------
 5321|   320k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   320k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4182|   331k|      {
 4183|   331k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 331k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   331k|         auto peek = it;
 4188|   331k|         yaml::node_preamble_state preamble{};
 4189|   331k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 16.0k, False: 315k]
  ------------------
 4190|   331k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  16.0k|            it = peek;
 4192|  16.0k|            return;
 4193|  16.0k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   315k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   315k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 28, False: 315k]
  ------------------
 4198|     28|            return;
 4199|       |
 4200|   315k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 122k, False: 192k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|   122k|            it = peek;
 4203|   122k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|   122k|         }
 4205|   192k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 192k, False: 300]
  ------------------
 4206|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4207|       |            // But if there was a tag, we need to advance past it
 4208|   192k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 859, False: 191k]
  |  Branch (4208:57): [True: 6.45k, False: 184k]
  ------------------
 4209|  7.30k|               it = peek;
 4210|  7.30k|            }
 4211|   192k|            int32_t seq_indent = ctx.current_indent();
 4212|   192k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 191k, False: 678]
  |  Branch (4212:31): [True: 107k, False: 84.1k]
  ------------------
 4213|   107k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 35.6k, False: 71.7k]
  |  Branch (4213:62): [True: 33.6k, False: 1.98k]
  ------------------
 4214|   107k|                                                          : (ctx.current_indent() + 1);
 4215|   107k|            }
 4216|   192k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   192k|         }
 4218|    300|         else {
 4219|    300|            ctx.error = error_code::syntax_error;
 4220|    300|         }
 4221|       |
 4222|   315k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   315k|      }
_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|   331k|      {
  466|   331k|         skip_inline_ws(it, end);
  467|       |
  468|   331k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 331k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  474|       |
  475|   331k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   331k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 331k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   331k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 331k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   331k|         skip_inline_ws(it, end);
  486|       |
  487|   331k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 9, False: 331k]
  ------------------
  488|      9|            if constexpr (!AllowEmptyInput) {
  489|      9|               ctx.error = error_code::unexpected_end;
  490|      9|            }
  491|      9|            return true;
  492|      9|         }
  493|       |
  494|   331k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.0k, False: 315k]
  ------------------
  495|  16.0k|            return true;
  496|  16.0k|         }
  497|       |
  498|   315k|         return false;
  499|   331k|      }
_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_:
 4190|   331k|                                             [](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|   331k|      {
  409|   331k|         state.has_anchor = false;
  410|   331k|         state.anchor_name.clear();
  411|   331k|         state.anchor_start = nullptr;
  412|   331k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   331k|         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|   331k|            else {
  421|   331k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 15.9k, False: 315k]
  ------------------
  422|   331k|            }
  423|   331k|         }
  424|       |
  425|   331k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 315k, False: 15.9k]
  |  Branch (425:27): [True: 9.13k, False: 306k]
  ------------------
  426|  9.13k|            ++it;
  427|  9.13k|            auto name = parse_anchor_name(it, end);
  428|  9.13k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 27, False: 9.10k]
  ------------------
  429|     27|               ctx.error = error_code::syntax_error;
  430|     27|               return true;
  431|     27|            }
  432|  9.10k|            skip_inline_ws(it, end);
  433|  9.10k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 45, False: 9.06k]
  ------------------
  434|     45|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     45|                  ctx.error = error_code::unexpected_end;
  436|     45|               }
  437|     45|               return true;
  438|     45|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  9.06k|            state.has_anchor = true;
  446|  9.06k|            state.anchor_name = std::string(name);
  447|  9.06k|            state.anchor_start = &*it;
  448|  9.06k|         }
  449|       |
  450|   331k|         return false;
  451|   331k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   331k|      {
  301|   331k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 331k]
  |  Branch (301:27): [True: 315k, False: 15.9k]
  ------------------
  302|       |
  303|  15.9k|         ++it; // skip '*'
  304|  15.9k|         auto name = parse_anchor_name(it, end);
  305|  15.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 23, False: 15.9k]
  ------------------
  306|     23|            ctx.error = error_code::syntax_error;
  307|     23|            return true;
  308|     23|         }
  309|       |
  310|  15.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  15.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 85, False: 15.8k]
  ------------------
  312|     85|            ctx.error = error_code::syntax_error; // undefined alias
  313|     85|            return true;
  314|     85|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  15.8k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  15.8k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.40k, False: 11.4k]
  ------------------
  322|  4.40k|            return true;
  323|  4.40k|         }
  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|  11.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 11.4k]
  ------------------
  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 without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  11.4k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  11.4k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 11.4k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  11.4k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 11.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|  11.4k|         auto replay_it = span.begin;
  348|  11.4k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  11.4k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  11.4k|         ctx.indent_stack.clear();
  353|  11.4k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.00k, False: 7.41k]
  ------------------
  354|  4.00k|            ctx.push_indent(span.base_indent - 1);
  355|  4.00k|         }
  356|       |
  357|  11.4k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  11.4k|         using V = std::remove_cvref_t<T>;
  360|  11.4k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  11.4k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  11.4k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  11.4k|         return true;
  367|  11.4k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|   122k|      {
 2665|   122k|         using V = std::remove_cvref_t<T>;
 2666|   122k|         using value_type = typename V::value_type;
 2667|       |
 2668|   122k|         struct sequence_container_adapter
 2669|   122k|         {
 2670|   122k|            size_t index = 0;
 2671|       |
 2672|   122k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|   122k|            {
 2674|   122k|               if constexpr (!resizable<V>) {
 2675|   122k|                  return index >= container.size();
 2676|   122k|               }
 2677|   122k|               else {
 2678|   122k|                  (void)container;
 2679|   122k|                  return false;
 2680|   122k|               }
 2681|   122k|            }
 2682|       |
 2683|   122k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|   122k|            inline void append(V& container, value_type&& element) noexcept
 2686|   122k|            {
 2687|   122k|               if constexpr (emplace_backable<V>) {
 2688|   122k|                  container.emplace_back(std::move(element));
 2689|   122k|               }
 2690|   122k|               else if constexpr (emplaceable<V>) {
 2691|   122k|                  container.emplace(std::move(element));
 2692|   122k|               }
 2693|   122k|            }
 2694|   122k|         };
 2695|       |
 2696|   122k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 122k]
  |  Branch (2696:27): [True: 0, False: 122k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|   122k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|   122k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|   122k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|   122k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 49, False: 122k]
  ------------------
 2709|     49|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|   122k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 119k, False: 2.95k]
  |  Branch (2712:27): [True: 24.5k, False: 95.3k]
  ------------------
 2713|  24.5k|            ++it;
 2714|  24.5k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  24.5k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 69, False: 24.4k]
  ------------------
 2716|     69|               return;
 2717|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|       |               if (ctx.current_indent() < 0) {
 2719|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|       |               }
 2721|       |            }
 2722|  24.4k|            return;
 2723|  24.5k|         }
 2724|       |
 2725|  98.3k|         bool just_saw_comma = false;
 2726|  98.3k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  98.3k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   179k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 176k, False: 3.21k]
  ------------------
 2731|   176k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   176k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 176k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   176k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 176k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   176k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 18.5k, False: 158k]
  ------------------
 2741|  18.5k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 18.5k, False: 0]
  ------------------
 2742|  18.5k|                     ++it;
 2743|  18.5k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  18.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 18, False: 18.4k]
  ------------------
 2745|     18|                        return;
 2746|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|       |                        if (ctx.current_indent() < 0) {
 2748|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|       |                        }
 2750|       |                     }
 2751|  18.4k|                     return;
 2752|  18.5k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  18.5k|               }
 2756|       |
 2757|   158k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 117, False: 158k]
  |  Branch (2757:34): [True: 55, False: 158k]
  ------------------
 2758|    172|                  ctx.error = error_code::syntax_error;
 2759|    172|                  return;
 2760|    172|               }
 2761|   158k|               just_saw_comma = false;
 2762|       |
 2763|   158k|               value_type element{};
 2764|   158k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   158k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 25.4k, False: 132k]
  ------------------
 2767|  25.4k|                  return;
 2768|       |
 2769|   132k|               bool saw_line_break_before_separator = false;
 2770|   132k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   132k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 47, False: 132k]
  ------------------
 2772|     47|                  return;
 2773|       |
 2774|   132k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 131k, False: 1.14k]
  |  Branch (2774:33): [True: 21.7k, False: 109k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  21.7k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 39, False: 21.6k]
  ------------------
 2777|     39|                     ctx.error = error_code::syntax_error;
 2778|     39|                     return;
 2779|     39|                  }
 2780|  21.6k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  21.6k|                     glz::generic key_node = std::move(element);
 2782|  21.6k|                     ++it;
 2783|  21.6k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  21.6k|                     glz::generic mapped{};
 2786|  21.6k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  21.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 2.02k, False: 19.6k]
  ------------------
 2788|  2.02k|                        return;
 2789|       |
 2790|  19.6k|                     std::string key;
 2791|  19.6k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 4, False: 19.6k]
  ------------------
 2792|      4|                        return;
 2793|       |
 2794|  19.6k|                     glz::generic pair{};
 2795|  19.6k|                     pair[key] = std::move(mapped);
 2796|  19.6k|                     element = std::move(pair);
 2797|       |
 2798|  19.6k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  19.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 0, False: 19.6k]
  ------------------
 2800|      0|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  21.6k|               }
 2807|       |
 2808|   132k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   132k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 1.18k, False: 131k]
  ------------------
 2811|  1.18k|                  ctx.error = error_code::unexpected_end;
 2812|  1.18k|                  return;
 2813|  1.18k|               }
 2814|       |
 2815|   131k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 46.1k, False: 85.1k]
  ------------------
 2816|  46.1k|                  ++it;
 2817|  46.1k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  46.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 94, False: 46.0k]
  ------------------
 2819|     94|                     return;
 2820|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|       |                     if (ctx.current_indent() < 0) {
 2822|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|       |                     }
 2824|       |                  }
 2825|  46.0k|                  return;
 2826|  46.1k|               }
 2827|  85.1k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 81.6k, False: 3.51k]
  ------------------
 2828|  81.6k|                  ++it;
 2829|  81.6k|                  just_saw_comma = true;
 2830|  81.6k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  81.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 33, False: 81.5k]
  ------------------
 2832|     33|                     return;
 2833|  81.6k|               }
 2834|  3.51k|               else {
 2835|  3.51k|                  ctx.error = error_code::syntax_error;
 2836|  3.51k|                  return;
 2837|  3.51k|               }
 2838|   131k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  98.3k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   315k|      {
 2649|   315k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   315k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   315k|               value.clear();
 2653|   315k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   315k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|   130k|            {
 2687|   130k|               if constexpr (emplace_backable<V>) {
 2688|   130k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   130k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   192k|      {
 3160|   192k|         using V = std::remove_cvref_t<T>;
 3161|   192k|         using value_type = typename V::value_type;
 3162|       |
 3163|   192k|         struct sequence_container_adapter
 3164|   192k|         {
 3165|   192k|            size_t index = 0;
 3166|       |
 3167|   192k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   192k|            {
 3169|   192k|               if constexpr (!resizable<V>) {
 3170|   192k|                  return index >= container.size();
 3171|   192k|               }
 3172|   192k|               else {
 3173|   192k|                  (void)container;
 3174|   192k|                  return false;
 3175|   192k|               }
 3176|   192k|            }
 3177|       |
 3178|   192k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   192k|            inline void append(V& container, value_type&& element) noexcept
 3181|   192k|            {
 3182|   192k|               if constexpr (emplace_backable<V>) {
 3183|   192k|                  container.emplace_back(std::move(element));
 3184|   192k|               }
 3185|   192k|               else if constexpr (emplaceable<V>) {
 3186|   192k|                  container.emplace(std::move(element));
 3187|   192k|               }
 3188|   192k|            }
 3189|   192k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   192k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   192k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   192k|         bool first_item = true;
 3200|   192k|         bool has_pending_item_anchor = false;
 3201|   192k|         std::string pending_item_anchor_name{};
 3202|   192k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   519k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 465k, False: 53.3k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   465k|            int32_t line_indent = 0;
 3215|   465k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   465k|            auto line_start = it;
 3217|       |
 3218|   607k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 584k, False: 23.2k]
  ------------------
 3219|   584k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 25.2k, False: 559k]
  ------------------
 3220|  25.2k|                  skip_comment(it, end);
 3221|  25.2k|                  skip_newline(it, end);
 3222|  25.2k|                  line_start = it;
 3223|  25.2k|                  line_indent = 0;
 3224|  25.2k|               }
 3225|   559k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 27.6k, False: 531k]
  |  Branch (3225:40): [True: 66.4k, False: 464k]
  ------------------
 3226|  94.1k|                  skip_newline(it, end);
 3227|  94.1k|                  line_start = it;
 3228|  94.1k|                  line_indent = 0;
 3229|  94.1k|               }
 3230|   464k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 41.2k, False: 423k]
  ------------------
 3231|  41.2k|                  line_start = it;
 3232|  41.2k|                  line_indent = 0;
 3233|   636k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 631k, False: 4.90k]
  |  Branch (3233:39): [True: 595k, False: 36.3k]
  ------------------
 3234|   595k|                     ++line_indent;
 3235|   595k|                     ++it;
 3236|   595k|                  }
 3237|       |
 3238|  41.2k|                  bool saw_tab = false;
 3239|  46.6k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 40.9k, False: 5.63k]
  |  Branch (3239:40): [True: 2.29k, False: 38.6k]
  |  Branch (3239:54): [True: 3.09k, False: 35.5k]
  ------------------
 3240|  5.39k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 2.97k, False: 2.42k]
  |  Branch (3240:43): [True: 2.42k, False: 0]
  ------------------
 3241|  5.39k|                     ++it;
 3242|  5.39k|                  }
 3243|       |
 3244|  41.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 5.63k, False: 35.5k]
  |  Branch (3244:36): [True: 2.07k, False: 33.5k]
  |  Branch (3244:51): [True: 2.82k, False: 30.6k]
  |  Branch (3244:66): [True: 4.54k, False: 26.1k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  15.0k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 9.45k, False: 5.63k]
  |  Branch (3246:39): [True: 4.54k, False: 4.90k]
  ------------------
 3247|  4.54k|                        skip_comment(it, end);
 3248|  4.54k|                     }
 3249|  15.0k|                     line_indent = 0;
 3250|  15.0k|                     continue;
 3251|  15.0k|                  }
 3252|       |
 3253|  26.1k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 51, False: 26.0k]
  ------------------
 3254|     51|                     ctx.error = error_code::syntax_error;
 3255|     51|                     return;
 3256|     51|                  }
 3257|  26.0k|                  break; // Found content
 3258|  26.1k|               }
 3259|   423k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 7.23k, False: 416k]
  ------------------
 3260|  7.23k|                  line_start = it;
 3261|  20.2k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 19.4k, False: 865]
  |  Branch (3261:40): [True: 3.29k, False: 16.1k]
  |  Branch (3261:54): [True: 9.74k, False: 6.36k]
  ------------------
 3262|  7.23k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 865, False: 6.36k]
  |  Branch (3262:36): [True: 2.24k, False: 4.12k]
  |  Branch (3262:51): [True: 936, False: 3.18k]
  |  Branch (3262:66): [True: 3.12k, False: 59]
  ------------------
 3263|  7.17k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 6.30k, False: 865]
  |  Branch (3263:39): [True: 3.12k, False: 3.17k]
  ------------------
 3264|  3.12k|                        skip_comment(it, end);
 3265|  3.12k|                     }
 3266|  7.17k|                     line_indent = 0;
 3267|  7.17k|                     continue;
 3268|  7.17k|                  }
 3269|     59|                  ctx.error = error_code::syntax_error;
 3270|     59|                  return;
 3271|  7.23k|               }
 3272|   416k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   416k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 192k, False: 224k]
  |  Branch (3276:37): [True: 191k, False: 675]
  ------------------
 3277|   191k|                     line_indent = sequence_indent;
 3278|   191k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   191k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 191k, False: 0]
  |  Branch (3279:49): [True: 191k, False: 0]
  ------------------
 3280|   191k|                           auto probe = it;
 3281|   191k|                           int32_t leading_ws = 0;
 3282|   191k|                           bool saw_tab = false;
 3283|   481k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 481k, False: 0]
  |  Branch (3283:64): [True: 271k, False: 210k]
  |  Branch (3283:87): [True: 18.7k, False: 191k]
  ------------------
 3284|   290k|                              --probe;
 3285|   290k|                              ++leading_ws;
 3286|   290k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 8.77k, False: 281k]
  |  Branch (3286:52): [True: 13.6k, False: 267k]
  ------------------
 3287|   290k|                           }
 3288|   191k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 191k]
  |  Branch (3288:61): [True: 10.6k, False: 180k]
  |  Branch (3288:85): [True: 62.0k, False: 118k]
  ------------------
 3289|  72.6k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 8, False: 72.6k]
  ------------------
 3290|      8|                                 ctx.error = error_code::syntax_error;
 3291|      8|                                 return;
 3292|      8|                              }
 3293|  72.6k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  72.6k|                           }
 3295|   191k|                        }
 3296|   191k|                     }
 3297|   191k|                  }
 3298|   191k|                  break;
 3299|   416k|               }
 3300|   584k|            }
 3301|       |
 3302|   465k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 23.2k, False: 442k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   442k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 7.12k, False: 435k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   435k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 43.8k, False: 391k]
  ------------------
 3309|  43.8k|               it = line_start;
 3310|  43.8k|               return;
 3311|  43.8k|            }
 3312|       |
 3313|   391k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 16.2k, False: 375k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  16.2k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 6, False: 16.2k]
  ------------------
 3318|      6|                  ctx.error = error_code::syntax_error;
 3319|      6|                  return;
 3320|      6|               }
 3321|       |
 3322|  16.2k|               ++it;
 3323|  16.2k|               auto pending_name = parse_anchor_name(it, end);
 3324|  16.2k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 19, False: 16.1k]
  ------------------
 3325|     19|                  ctx.error = error_code::syntax_error;
 3326|     19|                  return;
 3327|     19|               }
 3328|  16.1k|               skip_inline_ws(it, end);
 3329|  16.1k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 16.1k, False: 89]
  |  Branch (3329:33): [True: 2.22k, False: 13.8k]
  ------------------
 3330|  2.22k|                  skip_comment(it, end);
 3331|  2.22k|               }
 3332|       |
 3333|  16.1k|               has_pending_item_anchor = true;
 3334|  16.1k|               pending_item_anchor_name = std::string(pending_name);
 3335|  16.1k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  16.1k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 98, False: 16.0k]
  |  Branch (3337:34): [True: 10.3k, False: 5.77k]
  |  Branch (3337:49): [True: 142, False: 10.1k]
  ------------------
 3338|    240|                  ctx.error = error_code::syntax_error;
 3339|    240|                  return;
 3340|    240|               }
 3341|       |
 3342|  15.9k|               skip_newline(it, end);
 3343|  15.9k|               continue;
 3344|  16.1k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   375k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 54.8k, False: 320k]
  ------------------
 3348|  54.8k|               it = line_start;
 3349|  54.8k|               return;
 3350|  54.8k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   320k|            dash_col = line_indent;
 3356|   320k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   320k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 320k, False: 8]
  ------------------
 3358|   320k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   320k|               }
 3360|   320k|            }
 3361|       |
 3362|   320k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   320k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 307k, False: 13.2k]
  |  Branch (3365:30): [True: 7.19k, False: 300k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  7.19k|               it = line_start;
 3368|  7.19k|               return;
 3369|  7.19k|            }
 3370|       |
 3371|   313k|            bool saw_tab_after_dash = false;
 3372|   533k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 517k, False: 16.2k]
  |  Branch (3372:34): [True: 158k, False: 359k]
  |  Branch (3372:48): [True: 62.6k, False: 297k]
  ------------------
 3373|   220k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.28k, False: 216k]
  |  Branch (3373:59): [True: 61.0k, False: 155k]
  ------------------
 3374|   220k|               ++it;
 3375|   220k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   313k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 61.0k, False: 252k]
  |  Branch (3377:39): [True: 60.0k, False: 989]
  |  Branch (3377:52): [True: 1.01k, False: 59.0k]
  ------------------
 3378|  1.01k|               const auto after_dash = it + 1;
 3379|  1.01k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 7, False: 1.01k]
  |  Branch (3379:41): [True: 6, False: 1.00k]
  ------------------
 3380|     13|                  ctx.error = error_code::syntax_error;
 3381|     13|                  return;
 3382|     13|               }
 3383|  1.01k|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   313k|            auto parse_element = [&](auto& element) {
 3387|   313k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   313k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   313k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   313k|                     return;
 3397|   313k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   313k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   313k|                  ctx.sequence_item_value_context = true;
 3400|   313k|                  ctx.sequence_dash_indent = dash_col;
 3401|   313k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   313k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   313k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   313k|                  ctx.pop_indent();
 3405|   313k|               }
 3406|   313k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   313k|                  skip_ws_and_comment(it, end);
 3409|   313k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   313k|                  auto nested_start = it;
 3413|   313k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   313k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   313k|                     return;
 3416|   313k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   313k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   313k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   313k|                     const int32_t element_indent =
 3428|   313k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   313k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   313k|                        return;
 3431|   313k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   313k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   313k|                     ctx.sequence_item_value_context = true;
 3434|   313k|                     ctx.sequence_dash_indent = dash_col;
 3435|   313k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   313k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   313k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   313k|                     ctx.pop_indent();
 3439|   313k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   313k|               }
 3442|       |
 3443|   313k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   313k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   313k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   313k|                                                                      pending_item_anchor_indent};
 3447|   313k|                  has_pending_item_anchor = false;
 3448|   313k|               }
 3449|   313k|            };
 3450|       |
 3451|   313k|            if constexpr (emplace_backable<V>) {
 3452|   313k|               auto& element = value.emplace_back();
 3453|   313k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   313k|            first_item = false;
 3472|       |
 3473|   313k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 2.21k, False: 311k]
  ------------------
 3474|  2.21k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   313k|         }
 3479|   192k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   313k|            auto parse_element = [&](auto& element) {
 3387|   313k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 297k, False: 16.2k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   313k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 297k, False: 16.2k]
  |  Branch (3390:33): [True: 150k, False: 146k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   150k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 150k]
  ------------------
 3396|      0|                     return;
 3397|   150k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   150k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   150k|                  ctx.sequence_item_value_context = true;
 3400|   150k|                  ctx.sequence_dash_indent = dash_col;
 3401|   150k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   150k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   150k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   150k|                  ctx.pop_indent();
 3405|   150k|               }
 3406|   162k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   162k|                  skip_ws_and_comment(it, end);
 3409|   162k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   162k|                  auto nested_start = it;
 3413|   162k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   162k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 12, False: 162k]
  ------------------
 3415|     12|                     return;
 3416|   162k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   162k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 13.6k, False: 149k]
  ------------------
 3422|   162k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 14.5k, False: 148k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  14.5k|                     const int32_t element_indent =
 3428|  14.5k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 14.5k]
  ------------------
 3429|  14.5k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 14.5k]
  ------------------
 3430|      0|                        return;
 3431|  14.5k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  14.5k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  14.5k|                     ctx.sequence_item_value_context = true;
 3434|  14.5k|                     ctx.sequence_dash_indent = dash_col;
 3435|  14.5k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  14.5k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  14.5k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  14.5k|                     ctx.pop_indent();
 3439|  14.5k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   162k|               }
 3442|       |
 3443|   313k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 6.65k, False: 306k]
  |  Branch (3443:47): [True: 6.20k, False: 456]
  ------------------
 3444|  6.20k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 5.23k, False: 970]
  ------------------
 3445|  6.20k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  6.20k|                                                                      pending_item_anchor_indent};
 3447|  6.20k|                  has_pending_item_anchor = false;
 3448|  6.20k|               }
 3449|   313k|            };
_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_:
 5530|  1.07M|   {
 5531|  1.07M|      if constexpr (yaml::check_flow_context(Opts)) {
 5532|       |         // In flow context, only treat plain content as an implicit "key: value"
 5533|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5534|  1.07M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|  1.07M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|  1.07M|            bool at_node_start = true;
 5542|  1.07M|            int depth = 0;
 5543|  1.07M|            while (pos != stop) {
 5544|  1.07M|               const char c = *pos;
 5545|  1.07M|               if (c == ' ' || c == '\t') {
 5546|  1.07M|                  ++pos;
 5547|  1.07M|                  continue;
 5548|  1.07M|               }
 5549|  1.07M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  1.07M|               if ((c == '"' || c == '\'') && node_start) {
 5552|  1.07M|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|  1.07M|                  continue;
 5554|  1.07M|               }
 5555|  1.07M|               if (c == '[' || c == '{') {
 5556|  1.07M|                  ++depth;
 5557|  1.07M|                  at_node_start = true;
 5558|  1.07M|                  ++pos;
 5559|  1.07M|                  continue;
 5560|  1.07M|               }
 5561|  1.07M|               if (c == ']' || c == '}') {
 5562|  1.07M|                  if (depth == 0) return false;
 5563|  1.07M|                  --depth;
 5564|  1.07M|                  ++pos;
 5565|  1.07M|                  continue;
 5566|  1.07M|               }
 5567|  1.07M|               if (c == ',' && depth == 0) return false;
 5568|  1.07M|               if (c == ':' && depth == 0) {
 5569|  1.07M|                  auto next = pos + 1;
 5570|  1.07M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|  1.07M|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  1.07M|               if (c == ',' || c == ':') {
 5574|  1.07M|                  at_node_start = true;
 5575|  1.07M|                  ++pos;
 5576|  1.07M|                  continue;
 5577|  1.07M|               }
 5578|  1.07M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|  1.07M|                  at_node_start = true;
 5580|  1.07M|                  continue;
 5581|  1.07M|               }
 5582|  1.07M|               ++pos;
 5583|  1.07M|            }
 5584|  1.07M|            return false;
 5585|  1.07M|         };
 5586|       |
 5587|  1.07M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5587:14): [True: 446k, False: 628k]
  |  Branch (5587:49): [True: 13.7k, False: 614k]
  ------------------
 5588|   460k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5588:17): [True: 393k, False: 66.9k]
  ------------------
 5589|   393k|               return;
 5590|   393k|            }
 5591|  66.9k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5591:17): [True: 12.8k, False: 54.1k]
  ------------------
 5592|  12.8k|               return;
 5593|  12.8k|            }
 5594|  66.9k|         }
 5595|       |
 5596|   669k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|   669k|         return;
 5598|  1.07M|      }
 5599|       |
 5600|  1.07M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 0, False: 1.07M]
  ------------------
 5601|      0|         return;
 5602|      0|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|  1.07M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 0, False: 1.07M]
  ------------------
 5605|      0|         return;
 5606|      0|      }
 5607|  1.07M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|  1.07M|   }
_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_:
 5534|  1.07M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|  1.07M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|  1.07M|            bool at_node_start = true;
 5542|  1.07M|            int depth = 0;
 5543|  18.6M|            while (pos != stop) {
  ------------------
  |  Branch (5543:20): [True: 18.5M, False: 127k]
  ------------------
 5544|  18.5M|               const char c = *pos;
 5545|  18.5M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5545:20): [True: 2.07M, False: 16.4M]
  |  Branch (5545:32): [True: 290k, False: 16.1M]
  ------------------
 5546|  2.36M|                  ++pos;
 5547|  2.36M|                  continue;
 5548|  2.36M|               }
 5549|  16.1M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  16.1M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5551:21): [True: 178k, False: 16.0M]
  |  Branch (5551:33): [True: 73.5k, False: 15.9M]
  |  Branch (5551:47): [True: 151k, False: 100k]
  ------------------
 5552|   151k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5552:23): [True: 17.4k, False: 133k]
  ------------------
 5553|   133k|                  continue;
 5554|   151k|               }
 5555|  16.0M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5555:20): [True: 904k, False: 15.1M]
  |  Branch (5555:32): [True: 166k, False: 14.9M]
  ------------------
 5556|  1.07M|                  ++depth;
 5557|  1.07M|                  at_node_start = true;
 5558|  1.07M|                  ++pos;
 5559|  1.07M|                  continue;
 5560|  1.07M|               }
 5561|  14.9M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5561:20): [True: 138k, False: 14.8M]
  |  Branch (5561:32): [True: 145k, False: 14.6M]
  ------------------
 5562|   284k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5562:23): [True: 111k, False: 172k]
  ------------------
 5563|   172k|                  --depth;
 5564|   172k|                  ++pos;
 5565|   172k|                  continue;
 5566|   284k|               }
 5567|  14.6M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5567:20): [True: 984k, False: 13.6M]
  |  Branch (5567:32): [True: 278k, False: 706k]
  ------------------
 5568|  14.3M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5568:20): [True: 900k, False: 13.4M]
  |  Branch (5568:32): [True: 540k, False: 360k]
  ------------------
 5569|   540k|                  auto next = pos + 1;
 5570|   540k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5570:26): [True: 6.21k, False: 534k]
  |  Branch (5570:41): [True: 320k, False: 214k]
  |  Branch (5570:57): [True: 32.9k, False: 181k]
  |  Branch (5570:74): [True: 28.9k, False: 152k]
  |  Branch (5570:91): [True: 58.3k, False: 93.9k]
  ------------------
 5571|   540k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  13.8M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5573:20): [True: 706k, False: 13.1M]
  |  Branch (5573:32): [True: 360k, False: 12.7M]
  ------------------
 5574|  1.06M|                  at_node_start = true;
 5575|  1.06M|                  ++pos;
 5576|  1.06M|                  continue;
 5577|  1.06M|               }
 5578|  12.7M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5578:20): [True: 2.16M, False: 10.6M]
  |  Branch (5578:34): [True: 172k, False: 1.98M]
  ------------------
 5579|   172k|                  at_node_start = true;
 5580|   172k|                  continue;
 5581|   172k|               }
 5582|  12.6M|               ++pos;
 5583|  12.6M|            }
 5584|   127k|            return false;
 5585|  1.07M|         };
_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_:
 5962|  90.2k|            auto is_word_boundary = [&](const auto ptr) {
 5963|  90.2k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 3.32k, False: 86.9k]
  ------------------
 5964|  3.32k|                  return true;
 5965|  3.32k|               }
 5966|  86.9k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 48.8k, False: 38.1k]
  ------------------
 5967|  48.8k|                  auto next = ptr + 1;
 5968|  48.8k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 2.65k, False: 46.1k]
  |  Branch (5968:43): [True: 11.4k, False: 34.7k]
  |  Branch (5968:59): [True: 20.0k, False: 14.7k]
  |  Branch (5968:76): [True: 4.18k, False: 10.5k]
  |  Branch (5968:93): [True: 7.61k, False: 2.94k]
  ------------------
 5969|  48.8k|               }
 5970|  38.1k|               return is_plain_scalar_boundary(*ptr);
 5971|  86.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_ENKUlcE_clEc:
 5888|  38.1k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  38.1k|               switch (ch) {
 5890|  2.43k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 2.43k, False: 35.6k]
  ------------------
 5891|  5.89k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 3.46k, False: 34.6k]
  ------------------
 5892|  8.66k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 2.76k, False: 35.3k]
  ------------------
 5893|  14.2k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 5.55k, False: 32.5k]
  ------------------
 5894|  21.9k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 7.69k, False: 30.4k]
  ------------------
 5895|  23.9k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 2.07k, False: 36.0k]
  ------------------
 5896|  26.4k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 2.51k, False: 35.6k]
  ------------------
 5897|  26.4k|                  return true;
 5898|  11.6k|               default:
  ------------------
  |  Branch (5898:16): [True: 11.6k, False: 26.4k]
  ------------------
 5899|  11.6k|                  return false;
 5900|  38.1k|               }
 5901|  38.1k|            };
_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_:
 5903|  75.7k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  75.7k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  75.7k|                  return false;
 5906|  75.7k|               }
 5907|  75.7k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 0, False: 75.7k]
  ------------------
 5908|      0|                  return false;
 5909|      0|               }
 5910|  75.7k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 75.7k, False: 0]
  |  Branch (5910:40): [True: 0, False: 0]
  |  Branch (5910:61): [True: 0, False: 0]
  ------------------
 5911|      0|                  return false;
 5912|      0|               }
 5913|       |
 5914|  75.7k|               auto look = word_end;
 5915|  75.7k|               yaml::skip_newline(look, end);
 5916|  75.7k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 0, False: 75.7k]
  ------------------
 5917|      0|                  int32_t line_indent = 0;
 5918|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 0, False: 0]
  |  Branch (5918:41): [True: 0, False: 0]
  ------------------
 5919|      0|                     ++line_indent;
 5920|      0|                     ++look;
 5921|      0|                  }
 5922|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 0, False: 0]
  |  Branch (5922:38): [True: 0, False: 0]
  ------------------
 5923|      0|                     return false;
 5924|      0|                  }
 5925|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 0, False: 0]
  |  Branch (5925:38): [True: 0, False: 0]
  |  Branch (5925:55): [True: 0, False: 0]
  ------------------
 5926|      0|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 0, False: 0]
  ------------------
 5927|      0|                        yaml::skip_newline(look, end);
 5928|      0|                        continue;
 5929|      0|                     }
 5930|      0|                     return false;
 5931|      0|                  }
 5932|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 0, False: 0]
  ------------------
 5933|      0|                     yaml::skip_comment(look, end);
 5934|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 0, False: 0]
  |  Branch (5934:42): [True: 0, False: 0]
  |  Branch (5934:59): [True: 0, False: 0]
  ------------------
 5935|      0|                        yaml::skip_newline(look, end);
 5936|      0|                        continue;
 5937|      0|                     }
 5938|      0|                     return false;
 5939|      0|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|      0|                  {
 5945|      0|                     auto scan = look;
 5946|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 0, False: 0]
  |  Branch (5946:44): [True: 0, False: 0]
  |  Branch (5946:61): [True: 0, False: 0]
  ------------------
 5947|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 0, False: 0]
  ------------------
 5948|      0|                           auto after_colon = scan + 1;
 5949|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 0, False: 0]
  |  Branch (5949:54): [True: 0, False: 0]
  |  Branch (5949:77): [True: 0, False: 0]
  ------------------
 5950|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 0, False: 0]
  |  Branch (5950:56): [True: 0, False: 0]
  ------------------
 5951|      0|                              return false;
 5952|      0|                           }
 5953|      0|                        }
 5954|      0|                        ++scan;
 5955|      0|                     }
 5956|      0|                  }
 5957|       |
 5958|      0|                  return line_indent > ctx.current_indent();
 5959|      0|               }
 5960|  75.7k|               return false;
 5961|  75.7k|            };
_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_:
 5484|  2.80M|   {
 5485|  2.80M|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|  2.80M|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|  2.80M|         const bool could_be_mapping = [&] {
 5493|  2.80M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  2.80M|               return line_could_be_flow_mapping(it, end);
 5495|  2.80M|            }
 5496|  2.80M|            else {
 5497|  2.80M|               return yaml::line_could_be_block_mapping(it, end);
 5498|  2.80M|            }
 5499|  2.80M|         }();
 5500|  2.80M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 2.36M, False: 443k]
  ------------------
 5501|  2.36M|            return false;
 5502|  2.36M|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   443k|         auto temp_ctx = ctx.make_speculative();
 5505|   443k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   443k|                                                                                               end);
 5507|   443k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   443k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   443k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 413k, False: 29.8k]
  ------------------
 5510|   413k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   413k|            return true;
 5512|   413k|         }
 5513|       |         // The line matched "key: value" pattern but parsing failed.
 5514|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5515|       |         // so propagate the error rather than silently falling back to string.
 5516|  29.8k|         ctx.error = temp_ctx.error;
 5517|  29.8k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  29.8k|         return false;
 5519|   443k|      }
 5520|  2.80M|   }
_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:
 5492|  2.80M|         const bool could_be_mapping = [&] {
 5493|  2.80M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  2.80M|               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|       |            else {
 5497|       |               return yaml::line_could_be_block_mapping(it, end);
 5498|       |            }
 5499|  2.80M|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|   161k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|       |                     val = {};
 4766|       |                     return true;
 4767|       |                  }
 4768|   161k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   161k|                     val = glz::generic{};
 4770|   161k|                     return true;
 4771|       |                  }
 4772|       |                  else {
 4773|       |                     static constexpr std::string_view null_value{"null"};
 4774|       |                     auto null_it = null_value.data();
 4775|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|       |                     return !bool(ctx.error);
 4778|       |                  }
 4779|   161k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   783k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   783k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 783k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   783k|         const int32_t parent_indent = ctx.current_indent();
 3722|   783k|         const bool discover_indent = (mapping_indent < 0);
 3723|   783k|         bool first_key = !discover_indent;
 3724|   783k|         bool discovered_first_key_mid_line = false;
 3725|   783k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.03M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.73M, False: 299k]
  ------------------
 3728|  1.73M|            auto line_start = it;
 3729|  1.73M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.73M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.12M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 2.10M, False: 24.0k]
  ------------------
 3733|  2.10M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 47.3k, False: 2.05M]
  ------------------
 3734|  47.3k|                  skip_comment(it, end);
 3735|  47.3k|                  skip_newline(it, end);
 3736|  47.3k|                  first_key = false;
 3737|  47.3k|                  line_indent = 0;
 3738|  47.3k|               }
 3739|  2.05M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 213k, False: 1.84M]
  |  Branch (3739:40): [True: 75.7k, False: 1.76M]
  ------------------
 3740|   289k|                  skip_newline(it, end);
 3741|   289k|                  first_key = false;
 3742|   289k|                  line_indent = 0;
 3743|   289k|               }
 3744|  1.76M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 661k, False: 1.10M]
  ------------------
 3745|   661k|                  line_start = it;
 3746|   661k|                  line_indent = 0;
 3747|  3.91M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 3.90M, False: 4.39k]
  |  Branch (3747:39): [True: 3.25M, False: 656k]
  ------------------
 3748|  3.25M|                     ++line_indent;
 3749|  3.25M|                     ++it;
 3750|  3.25M|                  }
 3751|       |
 3752|   661k|                  bool saw_tab = false;
 3753|   676k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 671k, False: 5.07k]
  |  Branch (3753:40): [True: 1.29k, False: 669k]
  |  Branch (3753:54): [True: 13.8k, False: 656k]
  ------------------
 3754|  15.1k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 10.2k, False: 4.85k]
  |  Branch (3754:43): [True: 4.85k, False: 0]
  ------------------
 3755|  15.1k|                     ++it;
 3756|  15.1k|                  }
 3757|       |
 3758|   661k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 5.07k, False: 656k]
  |  Branch (3758:36): [True: 12.8k, False: 643k]
  |  Branch (3758:51): [True: 8.21k, False: 635k]
  |  Branch (3758:66): [True: 19.4k, False: 615k]
  ------------------
 3759|  45.5k|                     first_key = false;
 3760|  45.5k|                     line_indent = 0;
 3761|  45.5k|                     continue; // Blank or comment line
 3762|  45.5k|                  }
 3763|       |
 3764|   615k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 137, False: 615k]
  ------------------
 3765|    137|                     ctx.error = error_code::syntax_error;
 3766|    137|                     return;
 3767|    137|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   615k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 612k, False: 2.74k]
  |  Branch (3770:46): [True: 504, False: 612k]
  ------------------
 3771|    504|                     it = line_start;
 3772|    504|                     return;
 3773|    504|                  }
 3774|       |
 3775|   614k|                  first_key = false;
 3776|   614k|                  break; // Found content
 3777|   615k|               }
 3778|  1.10M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 6.15k, False: 1.09M]
  ------------------
 3779|  6.15k|                  line_start = it;
 3780|  20.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 19.7k, False: 700]
  |  Branch (3780:40): [True: 3.66k, False: 16.0k]
  |  Branch (3780:54): [True: 10.5k, False: 5.45k]
  ------------------
 3781|  6.15k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 700, False: 5.45k]
  |  Branch (3781:36): [True: 1.68k, False: 3.77k]
  |  Branch (3781:51): [True: 2.15k, False: 1.61k]
  |  Branch (3781:66): [True: 1.32k, False: 288]
  ------------------
 3782|  5.86k|                     first_key = false;
 3783|  5.86k|                     line_indent = 0;
 3784|  5.86k|                     continue; // Blank or comment-only line with tab indentation
 3785|  5.86k|                  }
 3786|    288|                  ctx.error = error_code::syntax_error;
 3787|    288|                  return;
 3788|  6.15k|               }
 3789|  1.09M|               else {
 3790|  1.09M|                  line_start = it;
 3791|  1.09M|                  break; // Content at column 0
 3792|  1.09M|               }
 3793|  2.10M|            }
 3794|       |
 3795|  1.73M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 24.0k, False: 1.71M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.71M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 6.03k, False: 1.70M]
  |  Branch (3799:45): [True: 1.86k, False: 1.70M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.70M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.70M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.70M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.70M, False: 0]
  |  Branch (3806:39): [True: 923k, False: 781k]
  |  Branch (3806:62): [True: 486k, False: 437k]
  |  Branch (3806:84): [True: 353k, False: 132k]
  ------------------
 3807|   353k|                  it = line_start;
 3808|   353k|                  return;
 3809|   353k|               }
 3810|  1.35M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 569k, False: 781k]
  |  Branch (3810:43): [True: 380, False: 569k]
  ------------------
 3811|    380|                  it = line_start;
 3812|    380|                  return;
 3813|    380|               }
 3814|  1.35M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.35M|            bool established_mapping_indent_this_line = false;
 3818|  1.35M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 781k, False: 569k]
  ------------------
 3819|   781k|               mapping_indent = line_indent;
 3820|   781k|               established_mapping_indent_this_line = true;
 3821|   781k|               discovered_first_key_visual_indent = line_indent;
 3822|   781k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   781k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 781k, False: 0]
  |  Branch (3823:43): [True: 765k, False: 15.7k]
  ------------------
 3824|   765k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   765k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 571, False: 765k]
  ------------------
 3826|    571|                        ctx.error = error_code::syntax_error;
 3827|    571|                        return;
 3828|    571|                     }
 3829|       |
 3830|   765k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   765k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 762k, False: 2.74k]
  |  Branch (3831:49): [True: 689k, False: 72.9k]
  ------------------
 3832|   689k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   689k|                     }
 3834|   765k|                  }
 3835|   781k|               }
 3836|   781k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.35M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.35M, False: 571]
  |  Branch (3840:36): [True: 1.35M, False: 0]
  |  Branch (3840:59): [True: 569k, False: 780k]
  ------------------
 3841|   569k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 128k, False: 440k]
  ------------------
 3842|   128k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 127k, False: 1.54k]
  |  Branch (3842:43): [True: 61.0k, False: 66.2k]
  ------------------
 3843|  61.0k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 99, False: 60.9k]
  ------------------
 3844|     99|                     ctx.error = error_code::syntax_error;
 3845|     99|                     return;
 3846|     99|                  }
 3847|  60.9k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 3.74k, False: 57.1k]
  ------------------
 3848|  3.74k|                     it = line_start;
 3849|  3.74k|                     return;
 3850|  3.74k|                  }
 3851|  60.9k|               }
 3852|  67.8k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 4.05k, False: 63.7k]
  ------------------
 3853|  4.05k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 906, False: 3.14k]
  |  Branch (3853:47): [True: 6, False: 3.14k]
  ------------------
 3854|  3.14k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 3.14k, False: 0]
  |  Branch (3854:49): [True: 3.14k, False: 0]
  |  Branch (3854:72): [True: 42, False: 3.10k]
  ------------------
 3855|    954|                  ctx.error = error_code::syntax_error;
 3856|    954|                  return;
 3857|    954|               }
 3858|   128k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.34M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.34M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.34M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.34M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.34M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 571, False: 1.34M]
  |  Branch (3876:32): [True: 0, False: 1.34M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.34M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 358k, False: 988k]
  |  Branch (3885:53): [True: 95.3k, False: 262k]
  |  Branch (3885:94): [True: 28.9k, False: 66.3k]
  ------------------
 3886|  28.9k|               const auto after_colon = it + 1;
 3887|  28.9k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 21.5k, False: 7.35k]
  ------------------
 3888|  28.9k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 1.50k, False: 27.4k]
  |  Branch (3888:43): [True: 20.1k, False: 7.26k]
  ------------------
 3889|  21.6k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 3.28k, False: 18.3k]
  ------------------
 3890|  3.28k|                  it = line_start;
 3891|  3.28k|                  return;
 3892|  3.28k|               }
 3893|  28.9k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.34M|            int32_t effective_line_indent = line_indent;
 3897|  1.34M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.34M, False: 571]
  |  Branch (3897:36): [True: 780k, False: 561k]
  ------------------
 3898|   780k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 689k, False: 91.4k]
  ------------------
 3899|   689k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 535k, False: 154k]
  |  Branch (3899:52): [True: 67.4k, False: 467k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   621k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   621k|            }
 3912|       |
 3913|  1.34M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 89.1k, False: 1.25M]
  ------------------
 3914|  89.1k|               return;
 3915|  89.1k|            }
 3916|  1.25M|            first_key = false;
 3917|       |
 3918|  1.25M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.25M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|       |               auto flow_end = it;
 3925|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|       |               if (bool(ctx.error)) [[unlikely]]
 3927|       |                  return;
 3928|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3929|       |                  it = flow_end;
 3930|       |                  return;
 3931|       |               }
 3932|       |            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.25M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 1.01M, False: 236k]
  ------------------
 3938|  1.01M|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 478k, False: 538k]
  |  Branch (3938:34): [True: 9.01k, False: 529k]
  ------------------
 3939|   487k|                  auto peek = it;
 3940|   487k|                  skip_inline_ws(peek, end);
 3941|   487k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 485k, False: 1.75k]
  |  Branch (3941:38): [True: 474k, False: 11.0k]
  |  Branch (3941:55): [True: 459k, False: 14.9k]
  |  Branch (3941:72): [True: 454k, False: 5.31k]
  ------------------
 3942|   454k|                     continue; // At leading indent of new line
 3943|   454k|                  }
 3944|   487k|               }
 3945|   562k|               skip_inline_ws(it, end);
 3946|   562k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 561k, False: 1.75k]
  |  Branch (3946:33): [True: 28.7k, False: 532k]
  ------------------
 3947|  28.7k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  28.7k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 28.7k, False: 0]
  ------------------
 3949|  28.7k|                        const char prev = *(it - 1);
 3950|  28.7k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 13.0k, False: 15.6k]
  |  Branch (3950:44): [True: 10.0k, False: 3.02k]
  |  Branch (3950:60): [True: 6.98k, False: 3.06k]
  |  Branch (3950:76): [True: 20, False: 6.96k]
  ------------------
 3951|     20|                           ctx.error = error_code::syntax_error;
 3952|     20|                           return;
 3953|     20|                        }
 3954|  28.7k|                     }
 3955|  28.7k|                  }
 3956|  28.7k|               }
 3957|  28.7k|               skip_comment(it, end);
 3958|   562k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 560k, False: 2.78k]
  |  Branch (3958:34): [True: 228k, False: 331k]
  |  Branch (3958:49): [True: 163k, False: 167k]
  ------------------
 3959|   392k|                  skip_newline(it, end);
 3960|   392k|               }
 3961|   170k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 167k, False: 2.78k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   167k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   167k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 1.33k, False: 166k]
  ------------------
 3968|  1.33k|                        ctx.error = error_code::syntax_error;
 3969|  1.33k|                        return;
 3970|  1.33k|                     }
 3971|   167k|                  }
 3972|   167k|               }
 3973|   562k|            }
 3974|  1.25M|         }
 3975|   783k|      }
_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:
 4882|  1.34M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.34M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.34M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.34M|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|  1.34M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.34M|                           if (ctx.stream_begin) {
 4893|  1.34M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.34M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.34M|                              };
 4896|       |
 4897|  1.34M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.34M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.34M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.34M|                                 return line != end && *line == ':';
 4901|  1.34M|                              };
 4902|       |
 4903|  1.34M|                              if (!is_line_content_start(it) &&
 4904|  1.34M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.34M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.34M|                                 ctx.error = error_code::syntax_error;
 4907|  1.34M|                                 return false;
 4908|  1.34M|                              }
 4909|  1.34M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.34M|                           }
 4911|  1.34M|                        }
 4912|       |
 4913|  1.34M|                        if (*it == '-' &&
 4914|  1.34M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.34M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.34M|                           ctx.error = error_code::syntax_error;
 4918|  1.34M|                           return false;
 4919|  1.34M|                        }
 4920|       |
 4921|  1.34M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.34M|                           return false;
 4923|  1.34M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.34M|                        ctx.pop_indent();
 4925|  1.34M|                     }
 4926|  1.34M|                     else {
 4927|  1.34M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.34M|                        if (nested_indent >= 0) {
 4929|  1.34M|                           yaml::skip_to_content(it, end);
 4930|  1.34M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.34M|                              ctx.error = error_code::syntax_error;
 4932|  1.34M|                              return false;
 4933|  1.34M|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|  1.34M|                           const int32_t value_indent =
 4937|  1.34M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.34M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.34M|                              return false;
 4940|  1.34M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.34M|                           ctx.pop_indent();
 4942|  1.34M|                        }
 4943|  1.34M|                     }
 4944|  1.34M|                     return !bool(ctx.error);
 4945|  1.34M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.34M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 337k, False: 1.00M]
  |  Branch (4950:37): [True: 335k, False: 1.41k]
  |  Branch (4950:58): [True: 9, False: 335k]
  ------------------
 4951|      9|                     ctx.error = error_code::syntax_error;
 4952|      9|                     return false;
 4953|      9|                  }
 4954|  1.34M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 337k, False: 1.00M]
  |  Branch (4954:38): [True: 1.41k, False: 335k]
  |  Branch (4954:57): [True: 130k, False: 204k]
  |  Branch (4954:77): [True: 118k, False: 86.0k]
  |  Branch (4954:98): [True: 75.7k, False: 10.2k]
  ------------------
 4955|   326k|                     ++it; // skip '?'
 4956|   326k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   326k|                     const int32_t explicit_value_indicator_indent =
 4959|   326k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 110k, False: 216k]
  ------------------
 4960|       |
 4961|   326k|                     key_t key{};
 4962|   326k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   326k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   326k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   326k|                        };
 4966|       |
 4967|   326k|                        auto key_it = it;
 4968|   326k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   326k|                        auto content = key_it;
 4971|   326k|                        yaml::skip_to_content(content, end);
 4972|   326k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   326k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 317k, False: 9.13k]
  |  Branch (4977:47): [True: 59.2k, False: 258k]
  ------------------
 4978|  59.2k|                           auto anchor_probe = content + 1;
 4979|  59.2k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  59.2k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 59.2k, False: 60]
  ------------------
 4981|  59.2k|                              auto after_anchor = anchor_probe;
 4982|  59.2k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  59.2k|                              auto value_indicator = after_anchor;
 4985|  59.2k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 57.6k, False: 1.61k]
  |  Branch (4985:61): [True: 6.73k, False: 50.8k]
  ------------------
 4986|  6.73k|                                 key.clear();
 4987|  6.73k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  6.73k|                                 it = value_indicator;
 4989|  6.73k|                                 handled_anchor_only_empty_key = true;
 4990|  6.73k|                              }
 4991|  52.4k|                              else {
 4992|  52.4k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 50.8k, False: 1.61k]
  |  Branch (4992:64): [True: 2.79k, False: 48.0k]
  ------------------
 4993|  2.79k|                                    yaml::skip_comment(value_indicator, end);
 4994|  2.79k|                                 }
 4995|  52.4k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 50.0k, False: 2.45k]
  |  Branch (4995:65): [True: 8.76k, False: 41.2k]
  |  Branch (4995:93): [True: 9.98k, False: 31.2k]
  ------------------
 4996|  18.7k|                                    yaml::skip_newline(value_indicator, end);
 4997|  18.7k|                                    auto value_line = value_indicator;
 4998|  18.7k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  18.7k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 6, False: 18.7k]
  ------------------
 5000|      6|                                       return false;
 5001|  18.7k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 16.4k, False: 2.31k]
  |  Branch (5001:62): [True: 2.88k, False: 13.5k]
  ------------------
 5002|  2.88k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 2.85k, False: 30]
  ------------------
 5003|  2.85k|                                       key.clear();
 5004|  2.85k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  2.85k|                                       it = value_line;
 5006|  2.85k|                                       handled_anchor_only_empty_key = true;
 5007|  2.85k|                                    }
 5008|  15.8k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 13.5k, False: 2.31k]
  |  Branch (5008:67): [True: 30, False: 13.5k]
  ------------------
 5009|       |                                       // In explicit-key form ("? &a"), a following ':'
 5010|       |                                       // starts the outer value indicator only at the same
 5011|       |                                       // indentation. A deeper-indented ': value' is malformed.
 5012|     30|                                       ctx.error = error_code::syntax_error;
 5013|     30|                                       return false;
 5014|     30|                                    }
 5015|  18.7k|                                 }
 5016|  52.4k|                              }
 5017|  59.2k|                           }
 5018|  59.2k|                        }
 5019|       |
 5020|   326k|                        const bool key_content_spans_lines = [&] {
 5021|   326k|                           auto scan = key_it;
 5022|   326k|                           while (scan != content && scan != end) {
 5023|   326k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   326k|                              ++scan;
 5025|   326k|                           }
 5026|   326k|                           return false;
 5027|   326k|                        }();
 5028|       |
 5029|   326k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 9.59k, False: 317k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  9.59k|                        }
 5032|   317k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 9.13k, False: 308k]
  |  Branch (5032:53): [True: 13.6k, False: 294k]
  |  Branch (5032:72): [True: 10.7k, False: 2.89k]
  ------------------
 5033|  19.9k|                           key.clear();
 5034|  19.9k|                           it = content;
 5035|  19.9k|                        }
 5036|   297k|                        else {
 5037|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5038|       |                           // Parse the key node structurally (not via plain-key scanning)
 5039|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5040|       |                           // as complex keys, not split into implicit key/value pairs.
 5041|   297k|                           auto key_node_it = content;
 5042|   297k|                           auto key_node_end = end;
 5043|   297k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5044|       |                              // In explicit-key form, a following standalone ':'
 5045|       |                              // line (same or lower indentation) belongs to the
 5046|       |                              // outer mapping value, not the key node itself.
 5047|   297k|                              auto scan = content;
 5048|  49.5M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 49.3M, False: 168k]
  ------------------
 5049|   570M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 570M, False: 82.0k]
  |  Branch (5049:56): [True: 558M, False: 12.4M]
  |  Branch (5049:73): [True: 521M, False: 36.8M]
  ------------------
 5050|   521M|                                    ++scan;
 5051|   521M|                                 }
 5052|  49.3M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 82.0k, False: 49.2M]
  ------------------
 5053|  82.0k|                                    break;
 5054|  82.0k|                                 }
 5055|       |
 5056|  49.2M|                                 yaml::skip_newline(scan, end);
 5057|  49.2M|                                 auto line_start = scan;
 5058|       |
 5059|  49.2M|                                 int32_t indicator_indent = 0;
 5060|  55.6M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 55.4M, False: 168k]
  |  Branch (5060:56): [True: 6.30M, False: 49.1M]
  ------------------
 5061|  6.30M|                                    ++indicator_indent;
 5062|  6.30M|                                    ++scan;
 5063|  6.30M|                                 }
 5064|       |
 5065|  49.2M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 49.1M, False: 168k]
  |  Branch (5065:53): [True: 608k, False: 48.5M]
  ------------------
 5066|   608k|                                    const auto after_colon = scan + 1;
 5067|   608k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 952, False: 607k]
  ------------------
 5068|   607k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 425k, False: 182k]
  ------------------
 5069|   426k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 47.1k, False: 379k]
  ------------------
 5070|  47.1k|                                       key_node_end = line_start;
 5071|  47.1k|                                       break;
 5072|  47.1k|                                    }
 5073|   608k|                                 }
 5074|  49.2M|                              }
 5075|   297k|                           }
 5076|       |
 5077|   297k|                           glz::generic key_node{};
 5078|   297k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   297k|                           ctx.explicit_mapping_key_context = true;
 5080|   297k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   297k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   297k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 18.4k, False: 278k]
  ------------------
 5083|  18.4k|                              return false;
 5084|   278k|                           it = key_node_it;
 5085|   278k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 86, False: 278k]
  ------------------
 5086|     86|                              return false;
 5087|   278k|                        }
 5088|       |                     }
 5089|       |                     else {
 5090|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|       |                           if (bool(ctx.error)) [[unlikely]]
 5093|       |                              return false;
 5094|       |                        }
 5095|       |                     }
 5096|       |
 5097|   308k|                     yaml::skip_inline_ws(it, end);
 5098|   326k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   326k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 225k, False: 101k]
  |  Branch (5101:40): [True: 58.1k, False: 167k]
  |  Branch (5101:55): [True: 69.0k, False: 98.2k]
  ------------------
 5102|   127k|                        auto probe = it;
 5103|   127k|                        bool found_value_indicator = false;
 5104|       |
 5105|   209k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 166k, False: 42.6k]
  |  Branch (5105:49): [True: 68.5k, False: 98.2k]
  |  Branch (5105:67): [True: 98.2k, False: 65]
  ------------------
 5106|   166k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   166k|                           auto value_line = probe;
 5109|   166k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   166k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 8, False: 166k]
  ------------------
 5111|      8|                              return false;
 5112|       |
 5113|   166k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 42.2k, False: 124k]
  |  Branch (5113:53): [True: 4.90k, False: 119k]
  |  Branch (5113:76): [True: 25.4k, False: 94.2k]
  ------------------
 5114|  72.5k|                              probe = value_line;
 5115|  72.5k|                              continue; // blank line
 5116|  72.5k|                           }
 5117|  94.2k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 9.65k, False: 84.6k]
  ------------------
 5118|  9.65k|                              yaml::skip_comment(value_line, end);
 5119|  9.65k|                              probe = value_line;
 5120|  9.65k|                              continue; // comment-only line
 5121|  9.65k|                           }
 5122|  84.6k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 17.1k, False: 67.4k]
  |  Branch (5122:54): [True: 5.86k, False: 11.2k]
  ------------------
 5123|  5.86k|                              it = value_line;
 5124|  5.86k|                              found_value_indicator = true;
 5125|  5.86k|                           }
 5126|  84.6k|                           break;
 5127|  94.2k|                        }
 5128|       |
 5129|   127k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 5.86k, False: 121k]
  ------------------
 5130|  5.86k|                           yaml::skip_inline_ws(it, end);
 5131|  5.86k|                        }
 5132|   127k|                     }
 5133|       |
 5134|   326k|                     val_t val{};
 5135|   326k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 225k, False: 101k]
  |  Branch (5135:39): [True: 80.1k, False: 145k]
  ------------------
 5136|  80.1k|                        ++it;
 5137|  80.1k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 79.3k, False: 743]
  |  Branch (5137:42): [True: 15, False: 79.3k]
  ------------------
 5138|     15|                           ctx.error = error_code::syntax_error;
 5139|     15|                           return false;
 5140|     15|                        }
 5141|  80.0k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 79.3k, False: 743]
  |  Branch (5141:43): [True: 6.63k, False: 72.7k]
  |  Branch (5141:58): [True: 8.12k, False: 64.5k]
  ------------------
 5142|  14.7k|                           auto probe = it;
 5143|  14.7k|                           yaml::skip_newline(probe, end);
 5144|   178k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 174k, False: 4.52k]
  |  Branch (5144:51): [True: 163k, False: 10.2k]
  ------------------
 5145|  14.7k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 10.2k, False: 4.52k]
  |  Branch (5145:48): [True: 1.70k, False: 8.53k]
  |  Branch (5145:65): [True: 1.41k, False: 295]
  |  Branch (5145:89): [True: 4, False: 1.40k]
  ------------------
 5146|      4|                              ctx.error = error_code::syntax_error;
 5147|      4|                              return false;
 5148|      4|                           }
 5149|  14.7k|                        }
 5150|  80.0k|                        yaml::skip_inline_ws(it, end);
 5151|  80.0k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 1.49k, False: 78.6k]
  ------------------
 5152|  1.49k|                           return false;
 5153|  80.0k|                     }
 5154|       |
 5155|   325k|                     value.emplace(std::move(key), std::move(val));
 5156|   325k|                     return true;
 5157|   326k|                  }
 5158|       |
 5159|  1.01M|                  key_t key{};
 5160|  1.01M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|  1.01M|                     auto key_probe = it;
 5162|  1.01M|                     yaml::skip_inline_ws(key_probe, end);
 5163|  1.01M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 1.01M, False: 0]
  |  Branch (5163:74): [True: 4.47k, False: 1.01M]
  |  Branch (5163:95): [True: 1.95k, False: 1.00M]
  ------------------
 5164|  1.01M|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 6.42k, False: 1.00M]
  ------------------
 5165|  6.42k|                        glz::generic key_node{};
 5166|  6.42k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  6.42k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 1.54k, False: 4.88k]
  ------------------
 5168|  1.54k|                           return false;
 5169|  4.88k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 4, False: 4.87k]
  ------------------
 5170|      4|                           return false;
 5171|  4.88k|                     }
 5172|  1.00M|                     else {
 5173|  1.00M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 8.46k, False: 1.00M]
  ------------------
 5174|  8.46k|                           return false;
 5175|  8.46k|                        }
 5176|  1.00M|                     }
 5177|       |                  }
 5178|       |                  else {
 5179|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|       |                     if (bool(ctx.error)) [[unlikely]]
 5181|       |                        return false;
 5182|       |                  }
 5183|       |
 5184|  1.00M|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|  1.01M|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 10.8k, False: 1.00M]
  |  Branch (5186:36): [True: 2.60k, False: 1.00M]
  ------------------
 5187|  3.41k|                     ctx.error = error_code::syntax_error;
 5188|  3.41k|                     return false;
 5189|  3.41k|                  }
 5190|  1.01M|                  ++it;
 5191|  1.01M|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|  1.01M|                  val_t val{};
 5194|  1.01M|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 55.5k, False: 956k]
  ------------------
 5195|  55.5k|                     return false;
 5196|       |
 5197|   956k|                  value.emplace(std::move(key), std::move(val));
 5198|   956k|                  return true;
 5199|  1.01M|               });
_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:
 5020|   326k|                        const bool key_content_spans_lines = [&] {
 5021|   326k|                           auto scan = key_it;
 5022|   345k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 219k, False: 126k]
  |  Branch (5022:54): [True: 219k, False: 0]
  ------------------
 5023|   219k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 120k, False: 99.0k]
  |  Branch (5023:52): [True: 79.9k, False: 19.1k]
  ------------------
 5024|  19.1k|                              ++scan;
 5025|  19.1k|                           }
 5026|   126k|                           return false;
 5027|   326k|                        }();
_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_:
 4963|   278k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   278k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   278k|                        };
_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_:
 4883|  1.08M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.08M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 1.05M, False: 26.4k]
  |  Branch (4884:39): [True: 775k, False: 280k]
  ------------------
 4885|   775k|                        bool line_starts_with_explicit_value_indicator = false;
 4886|       |
 4887|       |                        // Inline mapping values in block context cannot start with a
 4888|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4889|       |                        // Such constructs are malformed unless wrapped in flow
 4890|       |                        // delimiters ({...} / [...]) or quoted.
 4891|   775k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   775k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 775k, False: 0]
  ------------------
 4893|   775k|                              auto is_line_content_start = [&](auto pos) {
 4894|   775k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   775k|                              };
 4896|       |
 4897|   775k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   775k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   775k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   775k|                                 return line != end && *line == ':';
 4901|   775k|                              };
 4902|       |
 4903|   775k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 775k, False: 0]
  ------------------
 4904|   775k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 112k, False: 662k]
  ------------------
 4905|   112k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 724, False: 111k]
  ------------------
 4906|    724|                                 ctx.error = error_code::syntax_error;
 4907|    724|                                 return false;
 4908|    724|                              }
 4909|   774k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   774k|                           }
 4911|   775k|                        }
 4912|       |
 4913|   775k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 10.8k, False: 764k]
  ------------------
 4914|  10.8k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 808, False: 10.0k]
  |  Branch (4914:49): [True: 2.06k, False: 8.00k]
  ------------------
 4915|  2.87k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 27, False: 2.84k]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     27|                           ctx.error = error_code::syntax_error;
 4918|     27|                           return false;
 4919|     27|                        }
 4920|       |
 4921|   775k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 775k]
  ------------------
 4922|      0|                           return false;
 4923|   775k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   775k|                        ctx.pop_indent();
 4925|   775k|                     }
 4926|   306k|                     else {
 4927|   306k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   306k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 126k, False: 179k]
  ------------------
 4929|   126k|                           yaml::skip_to_content(it, end);
 4930|   126k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 126k, False: 0]
  |  Branch (4930:45): [True: 0, False: 126k]
  |  Branch (4930:59): [True: 0, False: 0]
  |  Branch (4930:78): [True: 0, False: 0]
  ------------------
 4931|      0|                              ctx.error = error_code::syntax_error;
 4932|      0|                              return false;
 4933|      0|                           }
 4934|       |                           // A struct value reads the pushed indent as its own key column;
 4935|       |                           // every other value type reads it as the enclosing baseline.
 4936|   126k|                           const int32_t value_indent =
 4937|   126k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 126k]
  ------------------
 4938|   126k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 126k]
  ------------------
 4939|      0|                              return false;
 4940|   126k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   126k|                           ctx.pop_indent();
 4942|   126k|                        }
 4943|   306k|                     }
 4944|  1.08M|                     return !bool(ctx.error);
 4945|  1.08M|                  };
_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_:
 4893|   775k|                              auto is_line_content_start = [&](auto pos) {
 4894|   775k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   775k|                              };
_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_:
 4897|   887k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   887k|                                 const char* line = ctx.line_begin_of(pos);
 4899|  2.98M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 2.98M, False: 0]
  |  Branch (4899:57): [True: 2.09M, False: 888k]
  |  Branch (4899:73): [True: 1.71k, False: 887k]
  ------------------
 4900|   887k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 887k, False: 0]
  |  Branch (4900:56): [True: 623k, False: 264k]
  ------------------
 4901|   887k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|   859k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   859k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 859k]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|   859k|            }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE10redispatchITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 6717|   255k|      {
 6718|   255k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|   255k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 9, False: 255k]
  ------------------
 6720|      9|            return;
 6721|   255k|         op<Opts>(value, ctx, it, end);
 6722|   255k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|   268k|      {
  301|   268k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 268k]
  |  Branch (301:27): [True: 0, False: 268k]
  ------------------
  302|       |
  303|   268k|         ++it; // skip '*'
  304|   268k|         auto name = parse_anchor_name(it, end);
  305|   268k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 530, False: 267k]
  ------------------
  306|    530|            ctx.error = error_code::syntax_error;
  307|    530|            return true;
  308|    530|         }
  309|       |
  310|   267k|         auto anchor_it = ctx.anchors.find(name);
  311|   267k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.47k, False: 265k]
  ------------------
  312|  2.47k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.47k|            return true;
  314|  2.47k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   265k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   265k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 5.27k, False: 260k]
  ------------------
  322|  5.27k|            return true;
  323|  5.27k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   260k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 141, False: 260k]
  ------------------
  329|    141|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    141|            return true;
  331|    141|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|   260k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   260k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 260k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   260k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 24, False: 260k]
  ------------------
  342|     24|            ctx.error = error_code::exceeded_max_expansion;
  343|     24|            ctx.custom_error_message = "alias expansion";
  344|     24|            return true;
  345|     24|         }
  346|       |
  347|   260k|         auto replay_it = span.begin;
  348|   260k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   260k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   260k|         ctx.indent_stack.clear();
  353|   260k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 158k, False: 101k]
  ------------------
  354|   158k|            ctx.push_indent(span.base_indent - 1);
  355|   158k|         }
  356|       |
  357|   260k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   260k|         using V = std::remove_cvref_t<T>;
  360|   260k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   260k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   260k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   260k|         return true;
  367|   260k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   375k|      {
 5311|   375k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   375k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   375k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   375k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   375k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 375k, False: 0]
  ------------------
 5321|   375k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   375k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1960|   387k|      {
 1961|   387k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 26.5k, False: 361k]
  ------------------
 1962|  26.5k|            return;
 1963|       |
 1964|   361k|         yaml::node_preamble_state preamble{};
 1965|   361k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 13.6k, False: 347k]
  ------------------
 1966|   361k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  13.6k|            return;
 1968|       |
 1969|   347k|         std::string str;
 1970|   347k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   347k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 347k, False: 0]
  ------------------
 1973|  2.43k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 2.43k, False: 345k]
  ------------------
 1974|  2.43k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  2.43k|            break;
 1976|  2.22k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 2.22k, False: 345k]
  ------------------
 1977|  2.22k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  2.22k|            break;
 1979|  1.14k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 1.14k, False: 346k]
  ------------------
 1980|  4.81k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 3.66k, False: 343k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  4.81k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  4.81k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 1.84k, False: 2.97k]
  ------------------
 1986|  4.81k|            break;
 1987|   338k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 338k, False: 9.47k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   338k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   338k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 285k, False: 52.6k]
  ------------------
 1992|   285k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|   285k|               }
 1994|  52.6k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|  52.6k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|  52.6k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   338k|            break;
 2003|   347k|         }
 2004|       |
 2005|   347k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 334k, False: 13.2k]
  ------------------
 2006|   334k|            value = std::move(str);
 2007|   334k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   334k|         }
 2009|   347k|      }
_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|   361k|      {
  466|   361k|         skip_inline_ws(it, end);
  467|       |
  468|   361k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 21, False: 361k]
  ------------------
  469|     21|            if constexpr (!AllowEmptyInput) {
  470|     21|               ctx.error = error_code::unexpected_end;
  471|     21|            }
  472|     21|            return true;
  473|     21|         }
  474|       |
  475|   361k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   361k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 30, False: 361k]
  ------------------
  477|     30|            ctx.error = error_code::syntax_error;
  478|     30|            return true;
  479|     30|         }
  480|   361k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 12, False: 361k]
  ------------------
  481|     12|            ctx.error = error_code::syntax_error;
  482|     12|            return true;
  483|     12|         }
  484|       |
  485|   361k|         skip_inline_ws(it, end);
  486|       |
  487|   361k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 38, False: 360k]
  ------------------
  488|     38|            if constexpr (!AllowEmptyInput) {
  489|     38|               ctx.error = error_code::unexpected_end;
  490|     38|            }
  491|     38|            return true;
  492|     38|         }
  493|       |
  494|   360k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.5k, False: 347k]
  ------------------
  495|  13.5k|            return true;
  496|  13.5k|         }
  497|       |
  498|   347k|         return false;
  499|   360k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1966|   361k|                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|   360k|      {
  409|   360k|         state.has_anchor = false;
  410|   360k|         state.anchor_name.clear();
  411|   360k|         state.anchor_start = nullptr;
  412|   360k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   360k|         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|   360k|            else {
  421|   360k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 13.3k, False: 347k]
  ------------------
  422|   360k|            }
  423|   360k|         }
  424|       |
  425|   360k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 347k, False: 13.3k]
  |  Branch (425:27): [True: 18.0k, False: 329k]
  ------------------
  426|  18.0k|            ++it;
  427|  18.0k|            auto name = parse_anchor_name(it, end);
  428|  18.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 57, False: 17.9k]
  ------------------
  429|     57|               ctx.error = error_code::syntax_error;
  430|     57|               return true;
  431|     57|            }
  432|  17.9k|            skip_inline_ws(it, end);
  433|  17.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 116, False: 17.8k]
  ------------------
  434|    116|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    116|                  ctx.error = error_code::unexpected_end;
  436|    116|               }
  437|    116|               return true;
  438|    116|            }
  439|  17.8k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  17.8k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 17.8k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  17.8k|            }
  445|  17.8k|            state.has_anchor = true;
  446|  17.8k|            state.anchor_name = std::string(name);
  447|  17.8k|            state.anchor_start = &*it;
  448|  17.8k|         }
  449|       |
  450|   360k|         return false;
  451|   360k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   360k|      {
  301|   360k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 360k]
  |  Branch (301:27): [True: 347k, False: 13.3k]
  ------------------
  302|       |
  303|  13.3k|         ++it; // skip '*'
  304|  13.3k|         auto name = parse_anchor_name(it, end);
  305|  13.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 37, False: 13.2k]
  ------------------
  306|     37|            ctx.error = error_code::syntax_error;
  307|     37|            return true;
  308|     37|         }
  309|       |
  310|  13.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  13.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 115, False: 13.1k]
  ------------------
  312|    115|            ctx.error = error_code::syntax_error; // undefined alias
  313|    115|            return true;
  314|    115|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  13.1k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  13.1k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.21k, False: 11.9k]
  ------------------
  322|  1.21k|            return true;
  323|  1.21k|         }
  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|  11.9k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 49, False: 11.9k]
  ------------------
  329|     49|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     49|            return true;
  331|     49|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  11.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  11.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 11.9k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  11.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 11.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|  11.9k|         auto replay_it = span.begin;
  348|  11.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  11.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  11.9k|         ctx.indent_stack.clear();
  353|  11.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 10.1k, False: 1.72k]
  ------------------
  354|  10.1k|            ctx.push_indent(span.base_indent - 1);
  355|  10.1k|         }
  356|       |
  357|  11.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  11.9k|         using V = std::remove_cvref_t<T>;
  360|  11.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  11.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  11.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  11.9k|         return true;
  367|  11.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_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|  99.1k|      {
 5311|  99.1k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  99.1k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  99.1k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  99.1k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  99.1k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 99.1k, False: 0]
  ------------------
 5321|  99.1k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  99.1k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2115|   103k|      {
 2116|   103k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 103k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   103k|         yaml::node_preamble_state preamble{};
 2120|   103k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 14.6k, False: 88.9k]
  ------------------
 2121|   103k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   103k|                   return yaml::tag_valid_for_float(tag);
 2123|   103k|                }
 2124|   103k|                else {
 2125|   103k|                   return yaml::tag_valid_for_int(tag);
 2126|   103k|                }
 2127|   103k|             }))
 2128|  14.6k|            return;
 2129|       |
 2130|  88.9k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  88.9k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  88.9k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  88.9k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 25.7k, False: 63.1k]
  ------------------
 2138|  25.7k|               ++it;
 2139|  25.7k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 24.5k, False: 1.21k]
  |  Branch (2139:38): [True: 3.80k, False: 20.7k]
  |  Branch (2139:74): [True: 788, False: 19.9k]
  ------------------
 2140|  19.9k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 870, False: 19.1k]
  ------------------
 2141|  5.46k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  5.46k|                  it += 3;
 2143|  5.46k|                  finalize();
 2144|  5.46k|                  return;
 2145|  5.46k|               }
 2146|  20.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 19.1k, False: 1.21k]
  |  Branch (2146:38): [True: 4.72k, False: 14.3k]
  |  Branch (2146:74): [True: 654, False: 13.7k]
  ------------------
 2147|  13.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 777, False: 12.9k]
  ------------------
 2148|  6.15k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  6.15k|                  it += 3;
 2150|  6.15k|                  finalize();
 2151|  6.15k|                  return;
 2152|  6.15k|               }
 2153|  14.1k|               it = start;
 2154|  14.1k|            }
 2155|       |
 2156|  77.3k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 6.09k, False: 71.2k]
  |  Branch (2156:31): [True: 8.88k, False: 62.3k]
  ------------------
 2157|  14.9k|               const char sign = *it;
 2158|  14.9k|               ++it;
 2159|  14.9k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 14.2k, False: 708]
  |  Branch (2159:33): [True: 5.43k, False: 8.84k]
  ------------------
 2160|  5.43k|                  ++it;
 2161|  5.43k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 4.32k, False: 1.10k]
  |  Branch (2161:41): [True: 990, False: 3.33k]
  |  Branch (2161:77): [True: 1.16k, False: 2.17k]
  ------------------
 2162|  2.53k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 387, False: 1.78k]
  ------------------
 2163|  2.53k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 1.30k, False: 1.23k]
  ------------------
 2164|  1.30k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  1.30k|                     }
 2166|  1.23k|                     else {
 2167|  1.23k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  1.23k|                     }
 2169|  2.53k|                     it += 3;
 2170|  2.53k|                     finalize();
 2171|  2.53k|                     return;
 2172|  2.53k|                  }
 2173|  5.43k|               }
 2174|  12.4k|               it = start;
 2175|  12.4k|            }
 2176|  77.3k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  74.8k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  66.2M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 66.2M, False: 27.6k]
  ------------------
 2183|  66.2M|            const char c = *it;
 2184|  66.2M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 22.0k, False: 66.2M]
  |  Branch (2184:29): [True: 3.21k, False: 66.2M]
  |  Branch (2184:42): [True: 6.40k, False: 66.2M]
  |  Branch (2184:55): [True: 5.24k, False: 66.2M]
  |  Branch (2184:68): [True: 4.54k, False: 66.2M]
  |  Branch (2184:80): [True: 2.39k, False: 66.2M]
  |  Branch (2184:92): [True: 1.68k, False: 66.2M]
  |  Branch (2184:104): [True: 6.33k, False: 66.2M]
  ------------------
 2185|  51.9k|               break;
 2186|  51.9k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  66.2M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 27.9k, False: 66.1M]
  ------------------
 2189|  27.9k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 988, False: 26.9k]
  |  Branch (2189:39): [True: 5.27k, False: 21.6k]
  |  Branch (2189:59): [True: 440, False: 21.2k]
  |  Branch (2189:80): [True: 1.72k, False: 19.4k]
  |  Branch (2189:101): [True: 942, False: 18.5k]
  ------------------
 2190|  9.36k|                  break;
 2191|  9.36k|               }
 2192|  27.9k|            }
 2193|  66.2M|            ++it;
 2194|  66.2M|         }
 2195|       |
 2196|  88.9k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  88.9k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 4.94k, False: 84.0k]
  ------------------
 2199|  4.94k|            ctx.error = error_code::parse_number_failure;
 2200|  4.94k|            return;
 2201|  4.94k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  84.0k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  84.0k|            bool negative = false;
 2254|  84.0k|            std::string_view digits = num_str;
 2255|       |
 2256|  84.0k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 69.8k, False: 14.1k]
  |  Branch (2256:37): [True: 7.64k, False: 62.2k]
  |  Branch (2256:62): [True: 4.79k, False: 57.4k]
  ------------------
 2257|  12.4k|               negative = (digits.front() == '-');
 2258|  12.4k|               digits.remove_prefix(1);
 2259|  12.4k|            }
 2260|       |
 2261|  84.0k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 50.0k, False: 33.9k]
  |  Branch (2261:38): [True: 21.7k, False: 28.3k]
  ------------------
 2262|  21.7k|               int base = 10;
 2263|  21.7k|               size_t offset = 0;
 2264|       |
 2265|  21.7k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 14.4k, False: 7.28k]
  |  Branch (2265:40): [True: 942, False: 6.33k]
  ------------------
 2266|  15.4k|                  base = 16;
 2267|  15.4k|                  offset = 2;
 2268|  15.4k|               }
 2269|  6.33k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 923, False: 5.41k]
  |  Branch (2269:45): [True: 998, False: 4.41k]
  ------------------
 2270|  1.92k|                  base = 8;
 2271|  1.92k|                  offset = 2;
 2272|  1.92k|               }
 2273|  4.41k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 836, False: 3.58k]
  |  Branch (2273:45): [True: 288, False: 3.29k]
  ------------------
 2274|  1.12k|                  base = 2;
 2275|  1.12k|                  offset = 2;
 2276|  1.12k|               }
 2277|       |
 2278|  21.7k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 18.4k, False: 3.29k]
  ------------------
 2279|  18.4k|                  auto raw_digits = digits.substr(offset);
 2280|  18.4k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  18.4k|                  std::string clean_storage;
 2283|  18.4k|                  std::string_view clean_view;
 2284|  18.4k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 9.56k, False: 8.91k]
  ------------------
 2285|  9.56k|                     clean_storage.reserve(raw_digits.size());
 2286|  7.08M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 7.08M, False: 9.56k]
  ------------------
 2287|  7.08M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 7.07M, False: 15.5k]
  ------------------
 2288|  7.07M|                           clean_storage.push_back(c);
 2289|  7.07M|                        }
 2290|  7.08M|                     }
 2291|  9.56k|                     clean_view = clean_storage;
 2292|  9.56k|                  }
 2293|  8.91k|                  else {
 2294|  8.91k|                     clean_view = raw_digits;
 2295|  8.91k|                  }
 2296|       |
 2297|  18.4k|                  uint64_t parsed_int{};
 2298|  18.4k|                  auto [ptr, ec] =
 2299|  18.4k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  18.4k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 4.82k, False: 13.6k]
  |  Branch (2300:44): [True: 11.8k, False: 1.79k]
  ------------------
 2301|  16.6k|                     ctx.error = error_code::parse_number_failure;
 2302|  16.6k|                     finalize();
 2303|  16.6k|                     return;
 2304|  16.6k|                  }
 2305|       |
 2306|  1.79k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  1.79k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 822, False: 972]
  ------------------
 2308|  1.79k|                  finalize();
 2309|  1.79k|                  return;
 2310|  18.4k|               }
 2311|  21.7k|            }
 2312|  84.0k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  65.5k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  84.0k|         std::string clean_storage;
 2318|  84.0k|         std::string_view clean_view;
 2319|       |
 2320|  84.0k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 3.48k, False: 80.5k]
  ------------------
 2321|  3.48k|            clean_storage.reserve(num_str.size());
 2322|  26.6M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 26.6M, False: 3.48k]
  ------------------
 2323|  26.6M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 26.6M, False: 14.2k]
  ------------------
 2324|  26.6M|                  clean_storage.push_back(c);
 2325|  26.6M|               }
 2326|  26.6M|            }
 2327|  3.48k|            clean_view = clean_storage;
 2328|  3.48k|         }
 2329|  80.5k|         else {
 2330|  80.5k|            clean_view = num_str;
 2331|  80.5k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  84.0k|         auto parse_view = clean_view;
 2336|  84.0k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 51.0k, False: 32.9k]
  |  Branch (2336:37): [True: 7.64k, False: 43.3k]
  ------------------
 2337|  7.64k|            parse_view.remove_prefix(1);
 2338|  7.64k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 2.39k, False: 5.25k]
  ------------------
 2339|  2.39k|               ctx.error = error_code::parse_number_failure;
 2340|  2.39k|               return;
 2341|  2.39k|            }
 2342|  7.64k|         }
 2343|       |
 2344|  81.6k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  81.6k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  81.6k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 59.8k, False: 21.7k]
  |  Branch (2347:45): [True: 13.0k, False: 8.69k]
  ------------------
 2348|  40.3k|               ctx.error = error_code::parse_number_failure;
 2349|  40.3k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  81.6k|         finalize();
 2360|  81.6k|      }
_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|   103k|      {
  466|   103k|         skip_inline_ws(it, end);
  467|       |
  468|   103k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 563, False: 103k]
  ------------------
  469|    563|            if constexpr (!AllowEmptyInput) {
  470|    563|               ctx.error = error_code::unexpected_end;
  471|    563|            }
  472|    563|            return true;
  473|    563|         }
  474|       |
  475|   103k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   103k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1.02k, False: 102k]
  ------------------
  477|  1.02k|            ctx.error = error_code::syntax_error;
  478|  1.02k|            return true;
  479|  1.02k|         }
  480|   102k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 648, False: 101k]
  ------------------
  481|    648|            ctx.error = error_code::syntax_error;
  482|    648|            return true;
  483|    648|         }
  484|       |
  485|   101k|         skip_inline_ws(it, end);
  486|       |
  487|   101k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 568, False: 100k]
  ------------------
  488|    568|            if constexpr (!AllowEmptyInput) {
  489|    568|               ctx.error = error_code::unexpected_end;
  490|    568|            }
  491|    568|            return true;
  492|    568|         }
  493|       |
  494|   100k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.8k, False: 88.9k]
  ------------------
  495|  11.8k|            return true;
  496|  11.8k|         }
  497|       |
  498|  88.9k|         return false;
  499|   100k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2120|   102k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   102k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   102k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   102k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   100k|      {
  409|   100k|         state.has_anchor = false;
  410|   100k|         state.anchor_name.clear();
  411|   100k|         state.anchor_start = nullptr;
  412|   100k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   100k|         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|   100k|            else {
  421|   100k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.4k, False: 90.3k]
  ------------------
  422|   100k|            }
  423|   100k|         }
  424|       |
  425|   100k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 90.3k, False: 10.4k]
  |  Branch (425:27): [True: 8.98k, False: 81.4k]
  ------------------
  426|  8.98k|            ++it;
  427|  8.98k|            auto name = parse_anchor_name(it, end);
  428|  8.98k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 733, False: 8.25k]
  ------------------
  429|    733|               ctx.error = error_code::syntax_error;
  430|    733|               return true;
  431|    733|            }
  432|  8.25k|            skip_inline_ws(it, end);
  433|  8.25k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 689, False: 7.56k]
  ------------------
  434|    689|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    689|                  ctx.error = error_code::unexpected_end;
  436|    689|               }
  437|    689|               return true;
  438|    689|            }
  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.56k|            state.has_anchor = true;
  446|  7.56k|            state.anchor_name = std::string(name);
  447|  7.56k|            state.anchor_start = &*it;
  448|  7.56k|         }
  449|       |
  450|  99.4k|         return false;
  451|   100k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   100k|      {
  301|   100k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 100k]
  |  Branch (301:27): [True: 90.3k, False: 10.4k]
  ------------------
  302|       |
  303|  10.4k|         ++it; // skip '*'
  304|  10.4k|         auto name = parse_anchor_name(it, end);
  305|  10.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 1.18k, False: 9.27k]
  ------------------
  306|  1.18k|            ctx.error = error_code::syntax_error;
  307|  1.18k|            return true;
  308|  1.18k|         }
  309|       |
  310|  9.27k|         auto anchor_it = ctx.anchors.find(name);
  311|  9.27k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 3.17k, False: 6.09k]
  ------------------
  312|  3.17k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  3.17k|            return true;
  314|  3.17k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  6.09k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  6.09k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.19k, False: 4.90k]
  ------------------
  322|  1.19k|            return true;
  323|  1.19k|         }
  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.90k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 397, False: 4.50k]
  ------------------
  329|    397|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    397|            return true;
  331|    397|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  4.50k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.50k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 4.50k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  4.50k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.50k]
  ------------------
  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.50k|         auto replay_it = span.begin;
  348|  4.50k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.50k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.50k|         ctx.indent_stack.clear();
  353|  4.50k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.31k, False: 3.18k]
  ------------------
  354|  1.31k|            ctx.push_indent(span.base_indent - 1);
  355|  1.31k|         }
  356|       |
  357|  4.50k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.50k|         using V = std::remove_cvref_t<T>;
  360|  4.50k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.50k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.50k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.50k|         return true;
  367|  4.50k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  81.6k|         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_:
 5310|  65.3k|      {
 5311|  65.3k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|  65.3k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  65.3k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  65.3k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  65.3k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 65.3k, False: 0]
  ------------------
 5321|  65.3k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|  65.3k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2080|  79.0k|      {
 2081|  79.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 79.0k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  79.0k|         yaml::node_preamble_state preamble{};
 2085|  79.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 16.7k, False: 62.2k]
  ------------------
 2086|  79.0k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  16.7k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  62.2k|         std::string str;
 2091|  62.2k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  62.2k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 23.9k, False: 38.3k]
  |  Branch (2093:31): [True: 5.86k, False: 32.4k]
  |  Branch (2093:48): [True: 2.00k, False: 30.4k]
  |  Branch (2093:65): [True: 672, False: 29.7k]
  |  Branch (2093:81): [True: 1.10k, False: 28.6k]
  |  Branch (2093:97): [True: 1.14k, False: 27.5k]
  ------------------
 2094|  36.8k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 795, False: 26.7k]
  |  Branch (2094:29): [True: 393, False: 26.3k]
  |  Branch (2094:44): [True: 935, False: 25.4k]
  ------------------
 2095|  36.8k|            value = true;
 2096|  36.8k|         }
 2097|  25.4k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 3.88k, False: 21.5k]
  |  Branch (2097:37): [True: 11.8k, False: 9.69k]
  |  Branch (2097:55): [True: 2.18k, False: 7.51k]
  |  Branch (2097:73): [True: 960, False: 6.55k]
  |  Branch (2097:88): [True: 3.04k, False: 3.50k]
  |  Branch (2097:103): [True: 797, False: 2.70k]
  ------------------
 2098|  24.8k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 729, False: 1.98k]
  |  Branch (2098:35): [True: 642, False: 1.33k]
  |  Branch (2098:51): [True: 768, False: 570]
  ------------------
 2099|  24.8k|            value = false;
 2100|  24.8k|         }
 2101|    570|         else {
 2102|    570|            ctx.error = error_code::expected_true_or_false;
 2103|    570|         }
 2104|       |
 2105|  62.2k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  62.2k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  79.0k|      {
  466|  79.0k|         skip_inline_ws(it, end);
  467|       |
  468|  79.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 79.0k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|  79.0k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  79.0k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 79.0k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  79.0k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 79.0k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  79.0k|         skip_inline_ws(it, end);
  486|       |
  487|  79.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 9, False: 78.9k]
  ------------------
  488|      9|            if constexpr (!AllowEmptyInput) {
  489|      9|               ctx.error = error_code::unexpected_end;
  490|      9|            }
  491|      9|            return true;
  492|      9|         }
  493|       |
  494|  78.9k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.6k, False: 62.2k]
  ------------------
  495|  16.6k|            return true;
  496|  16.6k|         }
  497|       |
  498|  62.2k|         return false;
  499|  78.9k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2086|  79.0k|                                             [](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|  78.9k|      {
  409|  78.9k|         state.has_anchor = false;
  410|  78.9k|         state.anchor_name.clear();
  411|  78.9k|         state.anchor_start = nullptr;
  412|  78.9k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  78.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|  78.9k|            else {
  421|  78.9k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 16.6k, False: 62.3k]
  ------------------
  422|  78.9k|            }
  423|  78.9k|         }
  424|       |
  425|  78.9k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 62.3k, False: 16.6k]
  |  Branch (425:27): [True: 4.28k, False: 58.0k]
  ------------------
  426|  4.28k|            ++it;
  427|  4.28k|            auto name = parse_anchor_name(it, end);
  428|  4.28k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 15, False: 4.26k]
  ------------------
  429|     15|               ctx.error = error_code::syntax_error;
  430|     15|               return true;
  431|     15|            }
  432|  4.26k|            skip_inline_ws(it, end);
  433|  4.26k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 50, False: 4.21k]
  ------------------
  434|     50|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     50|                  ctx.error = error_code::unexpected_end;
  436|     50|               }
  437|     50|               return true;
  438|     50|            }
  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.21k|            state.has_anchor = true;
  446|  4.21k|            state.anchor_name = std::string(name);
  447|  4.21k|            state.anchor_start = &*it;
  448|  4.21k|         }
  449|       |
  450|  78.9k|         return false;
  451|  78.9k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  78.9k|      {
  301|  78.9k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 78.9k]
  |  Branch (301:27): [True: 62.3k, False: 16.6k]
  ------------------
  302|       |
  303|  16.6k|         ++it; // skip '*'
  304|  16.6k|         auto name = parse_anchor_name(it, end);
  305|  16.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 43, False: 16.5k]
  ------------------
  306|     43|            ctx.error = error_code::syntax_error;
  307|     43|            return true;
  308|     43|         }
  309|       |
  310|  16.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  16.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 124, False: 16.4k]
  ------------------
  312|    124|            ctx.error = error_code::syntax_error; // undefined alias
  313|    124|            return true;
  314|    124|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  16.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  16.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.79k, False: 13.6k]
  ------------------
  322|  2.79k|            return true;
  323|  2.79k|         }
  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.6k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 9, False: 13.6k]
  ------------------
  329|      9|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      9|            return true;
  331|      9|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  13.6k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  13.6k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 13.6k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  13.6k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 13.6k]
  ------------------
  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.6k|         auto replay_it = span.begin;
  348|  13.6k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  13.6k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  13.6k|         ctx.indent_stack.clear();
  353|  13.6k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.74k, False: 8.92k]
  ------------------
  354|  4.74k|            ctx.push_indent(span.base_indent - 1);
  355|  4.74k|         }
  356|       |
  357|  13.6k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  13.6k|         using V = std::remove_cvref_t<T>;
  360|  13.6k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  13.6k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  13.6k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  13.6k|         return true;
  367|  13.6k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2466|  33.7k|      {
 2467|  33.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 33.7k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  33.7k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  33.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 19, False: 33.7k]
  ------------------
 2473|     19|            ctx.error = error_code::unexpected_end;
 2474|     19|            return;
 2475|     19|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  33.7k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 4.12k, False: 29.6k]
  ------------------
 2479|  4.12k|            ++it;
 2480|  4.12k|            return;
 2481|  4.12k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  29.6k|         auto start = it;
 2485|   145k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 144k, False: 1.28k]
  |  Branch (2485:30): [True: 115k, False: 28.3k]
  ------------------
 2486|   115k|            ++it;
 2487|   115k|         }
 2488|       |
 2489|  29.6k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  29.6k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 72, False: 29.5k]
  ------------------
 2491|     72|            ctx.error = error_code::syntax_error;
 2492|     72|         }
 2493|  29.6k|      }
_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_:
 5310|   218k|      {
 5311|   218k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5312|       |
 5313|       |         if constexpr (category_count == 0) {
 5314|       |            ctx.error = error_code::no_matching_variant_type;
 5315|       |         }
 5316|   218k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   218k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   218k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   218k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 218k, False: 0]
  ------------------
 5321|   218k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5322|       |         }
 5323|       |         else {
 5324|       |            // Multiple types in this category, try each one
 5325|       |            constexpr auto N = std::variant_size_v<Variant>;
 5326|       |            bool found_match{};
 5327|       |            size_t match_idx = 0;
 5328|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5329|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5330|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5331|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5332|       |            // (one that materializes no key text can still parse under a latched budget) is
 5333|       |            // unaffected.
 5334|       |            error_code expansion_error{};
 5335|       |            std::string_view expansion_message{};
 5336|       |
 5337|       |            for_each<N>([&]<size_t I>() {
 5338|       |               if (found_match) {
 5339|       |                  return;
 5340|       |               }
 5341|       |               using V = std::variant_alternative_t<I, Variant>;
 5342|       |               if constexpr (Trait<V>::value) {
 5343|       |                  auto copy_it = it;
 5344|       |                  if (!std::holds_alternative<V>(value)) {
 5345|       |                     value = V{};
 5346|       |                  }
 5347|       |
 5348|       |                  auto temp_ctx = ctx.make_speculative();
 5349|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5350|       |
 5351|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5352|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5353|       |                  // attempt that can be repeated for free.
 5354|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5355|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5356|       |
 5357|       |                  if (!bool(temp_ctx.error)) {
 5358|       |                     found_match = true;
 5359|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5360|       |                  }
 5361|       |                  else {
 5362|       |                     it = copy_it;
 5363|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5364|       |                        expansion_error = temp_ctx.error;
 5365|       |                        expansion_message = temp_ctx.custom_error_message;
 5366|       |                     }
 5367|       |                     if (match_idx + 1 < category_count) {
 5368|       |                        // Not the last type, continue trying
 5369|       |                     }
 5370|       |                     else {
 5371|       |                        // Last type failed, propagate error
 5372|       |                        ctx.error = temp_ctx.error;
 5373|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5374|       |                     }
 5375|       |                  }
 5376|       |                  ++match_idx;
 5377|       |               }
 5378|       |            });
 5379|       |
 5380|       |            if (!found_match && !bool(ctx.error)) {
 5381|       |               if (expansion_error != error_code::none) {
 5382|       |                  ctx.error = expansion_error;
 5383|       |                  ctx.custom_error_message = expansion_message;
 5384|       |               }
 5385|       |               else {
 5386|       |                  ctx.error = error_code::no_matching_variant_type;
 5387|       |               }
 5388|       |            }
 5389|       |         }
 5390|   218k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4182|   226k|      {
 4183|   226k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 226k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   226k|         auto peek = it;
 4188|   226k|         yaml::node_preamble_state preamble{};
 4189|   226k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 11.2k, False: 215k]
  ------------------
 4190|   226k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  11.2k|            it = peek;
 4192|  11.2k|            return;
 4193|  11.2k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   215k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   215k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 9, False: 215k]
  ------------------
 4198|      9|            return;
 4199|       |
 4200|   215k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 89.4k, False: 126k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  89.4k|            it = peek;
 4203|  89.4k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  89.4k|         }
 4205|   126k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 125k, False: 361]
  ------------------
 4206|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4207|       |            // But if there was a tag, we need to advance past it
 4208|   125k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 915, False: 124k]
  |  Branch (4208:57): [True: 2.36k, False: 122k]
  ------------------
 4209|  3.27k|               it = peek;
 4210|  3.27k|            }
 4211|   125k|            int32_t seq_indent = ctx.current_indent();
 4212|   125k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 125k, False: 778]
  |  Branch (4212:31): [True: 90.0k, False: 35.0k]
  ------------------
 4213|  90.0k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 35.3k, False: 54.6k]
  |  Branch (4213:62): [True: 19.5k, False: 15.8k]
  ------------------
 4214|  90.0k|                                                          : (ctx.current_indent() + 1);
 4215|  90.0k|            }
 4216|   125k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   125k|         }
 4218|    361|         else {
 4219|    361|            ctx.error = error_code::syntax_error;
 4220|    361|         }
 4221|       |
 4222|   215k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   215k|      }
_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|   226k|      {
  466|   226k|         skip_inline_ws(it, end);
  467|       |
  468|   226k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 226k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|   226k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   226k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 226k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|   226k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 9, False: 226k]
  ------------------
  481|      9|            ctx.error = error_code::syntax_error;
  482|      9|            return true;
  483|      9|         }
  484|       |
  485|   226k|         skip_inline_ws(it, end);
  486|       |
  487|   226k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 17, False: 226k]
  ------------------
  488|     17|            if constexpr (!AllowEmptyInput) {
  489|     17|               ctx.error = error_code::unexpected_end;
  490|     17|            }
  491|     17|            return true;
  492|     17|         }
  493|       |
  494|   226k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.1k, False: 215k]
  ------------------
  495|  11.1k|            return true;
  496|  11.1k|         }
  497|       |
  498|   215k|         return false;
  499|   226k|      }
_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_:
 4190|   226k|                                             [](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|   226k|      {
  409|   226k|         state.has_anchor = false;
  410|   226k|         state.anchor_name.clear();
  411|   226k|         state.anchor_start = nullptr;
  412|   226k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   226k|         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|   226k|            else {
  421|   226k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 11.0k, False: 215k]
  ------------------
  422|   226k|            }
  423|   226k|         }
  424|       |
  425|   226k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 215k, False: 11.0k]
  |  Branch (425:27): [True: 3.46k, False: 212k]
  ------------------
  426|  3.46k|            ++it;
  427|  3.46k|            auto name = parse_anchor_name(it, end);
  428|  3.46k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 32, False: 3.43k]
  ------------------
  429|     32|               ctx.error = error_code::syntax_error;
  430|     32|               return true;
  431|     32|            }
  432|  3.43k|            skip_inline_ws(it, end);
  433|  3.43k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 62, False: 3.37k]
  ------------------
  434|     62|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     62|                  ctx.error = error_code::unexpected_end;
  436|     62|               }
  437|     62|               return true;
  438|     62|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.37k|            state.has_anchor = true;
  446|  3.37k|            state.anchor_name = std::string(name);
  447|  3.37k|            state.anchor_start = &*it;
  448|  3.37k|         }
  449|       |
  450|   226k|         return false;
  451|   226k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   226k|      {
  301|   226k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 226k]
  |  Branch (301:27): [True: 215k, False: 11.0k]
  ------------------
  302|       |
  303|  11.0k|         ++it; // skip '*'
  304|  11.0k|         auto name = parse_anchor_name(it, end);
  305|  11.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 32, False: 11.0k]
  ------------------
  306|     32|            ctx.error = error_code::syntax_error;
  307|     32|            return true;
  308|     32|         }
  309|       |
  310|  11.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 96, False: 10.9k]
  ------------------
  312|     96|            ctx.error = error_code::syntax_error; // undefined alias
  313|     96|            return true;
  314|     96|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  10.9k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  10.9k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.80k, False: 8.13k]
  ------------------
  322|  2.80k|            return true;
  323|  2.80k|         }
  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.13k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 46, False: 8.09k]
  ------------------
  329|     46|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     46|            return true;
  331|     46|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader without opening a collection, so the
  334|       |         // sequence and mapping readers' depth accounting never sees a chain of aliases. The
  335|       |         // cycle check above stops the unbounded case; this bounds a legitimate but deeply
  336|       |         // chained one.
  337|  8.09k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.09k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 8.08k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  8.08k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 8.08k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  8.08k|         auto replay_it = span.begin;
  348|  8.08k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.08k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.08k|         ctx.indent_stack.clear();
  353|  8.08k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.10k, False: 3.98k]
  ------------------
  354|  4.10k|            ctx.push_indent(span.base_indent - 1);
  355|  4.10k|         }
  356|       |
  357|  8.08k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.08k|         using V = std::remove_cvref_t<T>;
  360|  8.08k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.08k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.08k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.08k|         return true;
  367|  8.08k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  89.4k|      {
 2665|  89.4k|         using V = std::remove_cvref_t<T>;
 2666|  89.4k|         using value_type = typename V::value_type;
 2667|       |
 2668|  89.4k|         struct sequence_container_adapter
 2669|  89.4k|         {
 2670|  89.4k|            size_t index = 0;
 2671|       |
 2672|  89.4k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  89.4k|            {
 2674|  89.4k|               if constexpr (!resizable<V>) {
 2675|  89.4k|                  return index >= container.size();
 2676|  89.4k|               }
 2677|  89.4k|               else {
 2678|  89.4k|                  (void)container;
 2679|  89.4k|                  return false;
 2680|  89.4k|               }
 2681|  89.4k|            }
 2682|       |
 2683|  89.4k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  89.4k|            inline void append(V& container, value_type&& element) noexcept
 2686|  89.4k|            {
 2687|  89.4k|               if constexpr (emplace_backable<V>) {
 2688|  89.4k|                  container.emplace_back(std::move(element));
 2689|  89.4k|               }
 2690|  89.4k|               else if constexpr (emplaceable<V>) {
 2691|  89.4k|                  container.emplace(std::move(element));
 2692|  89.4k|               }
 2693|  89.4k|            }
 2694|  89.4k|         };
 2695|       |
 2696|  89.4k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 89.4k]
  |  Branch (2696:27): [True: 0, False: 89.4k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  89.4k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  89.4k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  89.4k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  89.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 85, False: 89.3k]
  ------------------
 2709|     85|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  89.3k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 87.6k, False: 1.67k]
  |  Branch (2712:27): [True: 10.6k, False: 77.0k]
  ------------------
 2713|  10.6k|            ++it;
 2714|  10.6k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  10.6k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 50, False: 10.6k]
  ------------------
 2716|     50|               return;
 2717|  10.6k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  10.6k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 1.22k, False: 9.40k]
  ------------------
 2719|  1.22k|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|  1.22k|               }
 2721|  10.6k|            }
 2722|  10.6k|            return;
 2723|  10.6k|         }
 2724|       |
 2725|  78.6k|         bool just_saw_comma = false;
 2726|  78.6k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  78.6k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  1.81M|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 1.80M, False: 3.05k]
  ------------------
 2731|  1.80M|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  1.80M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 1.80M]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  1.80M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 1.80M]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  1.80M|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 10.7k, False: 1.79M]
  ------------------
 2741|  10.7k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 10.7k, False: 0]
  ------------------
 2742|  10.7k|                     ++it;
 2743|  10.7k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  10.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 30, False: 10.7k]
  ------------------
 2745|     30|                        return;
 2746|  10.7k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  10.7k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 1.61k, False: 9.11k]
  ------------------
 2748|  1.61k|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|  1.61k|                        }
 2750|  10.7k|                     }
 2751|  10.7k|                     return;
 2752|  10.7k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  10.7k|               }
 2756|       |
 2757|  1.79M|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 209, False: 1.79M]
  |  Branch (2757:34): [True: 62, False: 1.79M]
  ------------------
 2758|    271|                  ctx.error = error_code::syntax_error;
 2759|    271|                  return;
 2760|    271|               }
 2761|  1.79M|               just_saw_comma = false;
 2762|       |
 2763|  1.79M|               value_type element{};
 2764|  1.79M|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  1.79M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 44.0k, False: 1.75M]
  ------------------
 2767|  44.0k|                  return;
 2768|       |
 2769|  1.75M|               bool saw_line_break_before_separator = false;
 2770|  1.75M|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  1.75M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 35, False: 1.75M]
  ------------------
 2772|     35|                  return;
 2773|       |
 2774|  1.75M|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 1.75M, False: 2.82k]
  |  Branch (2774:33): [True: 9.46k, False: 1.74M]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  9.46k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 159, False: 9.30k]
  ------------------
 2777|    159|                     ctx.error = error_code::syntax_error;
 2778|    159|                     return;
 2779|    159|                  }
 2780|  9.30k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  9.30k|                     glz::generic key_node = std::move(element);
 2782|  9.30k|                     ++it;
 2783|  9.30k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  9.30k|                     glz::generic mapped{};
 2786|  9.30k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  9.30k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 1.22k, False: 8.07k]
  ------------------
 2788|  1.22k|                        return;
 2789|       |
 2790|  8.07k|                     std::string key;
 2791|  8.07k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 5, False: 8.07k]
  ------------------
 2792|      5|                        return;
 2793|       |
 2794|  8.07k|                     glz::generic pair{};
 2795|  8.07k|                     pair[key] = std::move(mapped);
 2796|  8.07k|                     element = std::move(pair);
 2797|       |
 2798|  8.07k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  8.07k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 4, False: 8.07k]
  ------------------
 2800|      4|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  9.30k|               }
 2807|       |
 2808|  1.75M|               adapter.append(value, std::move(element));
 2809|       |
 2810|  1.75M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 2.95k, False: 1.74M]
  ------------------
 2811|  2.95k|                  ctx.error = error_code::unexpected_end;
 2812|  2.95k|                  return;
 2813|  2.95k|               }
 2814|       |
 2815|  1.74M|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 11.8k, False: 1.73M]
  ------------------
 2816|  11.8k|                  ++it;
 2817|  11.8k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  11.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 240, False: 11.5k]
  ------------------
 2819|    240|                     return;
 2820|  11.5k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  11.5k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 1.81k, False: 9.74k]
  ------------------
 2822|  1.81k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|  1.81k|                     }
 2824|  11.5k|                  }
 2825|  11.5k|                  return;
 2826|  11.8k|               }
 2827|  1.73M|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 1.73M, False: 5.53k]
  ------------------
 2828|  1.73M|                  ++it;
 2829|  1.73M|                  just_saw_comma = true;
 2830|  1.73M|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  1.73M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 16, False: 1.73M]
  ------------------
 2832|     16|                     return;
 2833|  1.73M|               }
 2834|  5.53k|               else {
 2835|  5.53k|                  ctx.error = error_code::syntax_error;
 2836|  5.53k|                  return;
 2837|  5.53k|               }
 2838|  1.74M|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  78.6k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   215k|      {
 2649|   215k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   215k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   215k|               value.clear();
 2653|   215k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   215k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  1.75M|            {
 2687|  1.75M|               if constexpr (emplace_backable<V>) {
 2688|  1.75M|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  1.75M|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   125k|      {
 3160|   125k|         using V = std::remove_cvref_t<T>;
 3161|   125k|         using value_type = typename V::value_type;
 3162|       |
 3163|   125k|         struct sequence_container_adapter
 3164|   125k|         {
 3165|   125k|            size_t index = 0;
 3166|       |
 3167|   125k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   125k|            {
 3169|   125k|               if constexpr (!resizable<V>) {
 3170|   125k|                  return index >= container.size();
 3171|   125k|               }
 3172|   125k|               else {
 3173|   125k|                  (void)container;
 3174|   125k|                  return false;
 3175|   125k|               }
 3176|   125k|            }
 3177|       |
 3178|   125k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   125k|            inline void append(V& container, value_type&& element) noexcept
 3181|   125k|            {
 3182|   125k|               if constexpr (emplace_backable<V>) {
 3183|   125k|                  container.emplace_back(std::move(element));
 3184|   125k|               }
 3185|   125k|               else if constexpr (emplaceable<V>) {
 3186|   125k|                  container.emplace(std::move(element));
 3187|   125k|               }
 3188|   125k|            }
 3189|   125k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   125k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   125k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   125k|         bool first_item = true;
 3200|   125k|         bool has_pending_item_anchor = false;
 3201|   125k|         std::string pending_item_anchor_name{};
 3202|   125k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   497k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 445k, False: 52.1k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   445k|            int32_t line_indent = 0;
 3215|   445k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   445k|            auto line_start = it;
 3217|       |
 3218|   846k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 818k, False: 27.3k]
  ------------------
 3219|   818k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 27.5k, False: 791k]
  ------------------
 3220|  27.5k|                  skip_comment(it, end);
 3221|  27.5k|                  skip_newline(it, end);
 3222|  27.5k|                  line_start = it;
 3223|  27.5k|                  line_indent = 0;
 3224|  27.5k|               }
 3225|   791k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 85.1k, False: 705k]
  |  Branch (3225:40): [True: 221k, False: 484k]
  ------------------
 3226|   306k|                  skip_newline(it, end);
 3227|   306k|                  line_start = it;
 3228|   306k|                  line_indent = 0;
 3229|   306k|               }
 3230|   484k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 80.7k, False: 403k]
  ------------------
 3231|  80.7k|                  line_start = it;
 3232|  80.7k|                  line_indent = 0;
 3233|   261k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 260k, False: 1.20k]
  |  Branch (3233:39): [True: 180k, False: 79.5k]
  ------------------
 3234|   180k|                     ++line_indent;
 3235|   180k|                     ++it;
 3236|   180k|                  }
 3237|       |
 3238|  80.7k|                  bool saw_tab = false;
 3239|  87.2k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 85.6k, False: 1.58k]
  |  Branch (3239:40): [True: 1.70k, False: 83.9k]
  |  Branch (3239:54): [True: 4.77k, False: 79.1k]
  ------------------
 3240|  6.48k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 4.61k, False: 1.86k]
  |  Branch (3240:43): [True: 1.86k, False: 0]
  ------------------
 3241|  6.48k|                     ++it;
 3242|  6.48k|                  }
 3243|       |
 3244|  80.7k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 1.58k, False: 79.1k]
  |  Branch (3244:36): [True: 3.55k, False: 75.5k]
  |  Branch (3244:51): [True: 44.4k, False: 31.1k]
  |  Branch (3244:66): [True: 12.4k, False: 18.7k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  61.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 60.3k, False: 1.58k]
  |  Branch (3246:39): [True: 12.4k, False: 47.9k]
  ------------------
 3247|  12.4k|                        skip_comment(it, end);
 3248|  12.4k|                     }
 3249|  61.9k|                     line_indent = 0;
 3250|  61.9k|                     continue;
 3251|  61.9k|                  }
 3252|       |
 3253|  18.7k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 48, False: 18.7k]
  ------------------
 3254|     48|                     ctx.error = error_code::syntax_error;
 3255|     48|                     return;
 3256|     48|                  }
 3257|  18.7k|                  break; // Found content
 3258|  18.7k|               }
 3259|   403k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 4.37k, False: 399k]
  ------------------
 3260|  4.37k|                  line_start = it;
 3261|  14.6k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 13.9k, False: 713]
  |  Branch (3261:40): [True: 1.78k, False: 12.1k]
  |  Branch (3261:54): [True: 8.45k, False: 3.65k]
  ------------------
 3262|  4.37k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 713, False: 3.65k]
  |  Branch (3262:36): [True: 971, False: 2.68k]
  |  Branch (3262:51): [True: 908, False: 1.78k]
  |  Branch (3262:66): [True: 1.68k, False: 98]
  ------------------
 3263|  4.27k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 3.56k, False: 713]
  |  Branch (3263:39): [True: 1.68k, False: 1.87k]
  ------------------
 3264|  1.68k|                        skip_comment(it, end);
 3265|  1.68k|                     }
 3266|  4.27k|                     line_indent = 0;
 3267|  4.27k|                     continue;
 3268|  4.27k|                  }
 3269|     98|                  ctx.error = error_code::syntax_error;
 3270|     98|                  return;
 3271|  4.37k|               }
 3272|   399k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   399k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 125k, False: 273k]
  |  Branch (3276:37): [True: 125k, False: 778]
  ------------------
 3277|   125k|                     line_indent = sequence_indent;
 3278|   125k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   125k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 125k, False: 0]
  |  Branch (3279:49): [True: 123k, False: 2.00k]
  ------------------
 3280|   123k|                           auto probe = it;
 3281|   123k|                           int32_t leading_ws = 0;
 3282|   123k|                           bool saw_tab = false;
 3283|   393k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 393k, False: 305]
  |  Branch (3283:64): [True: 266k, False: 127k]
  |  Branch (3283:87): [True: 4.42k, False: 122k]
  ------------------
 3284|   270k|                              --probe;
 3285|   270k|                              ++leading_ws;
 3286|   270k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 1.45k, False: 269k]
  |  Branch (3286:52): [True: 3.21k, False: 266k]
  ------------------
 3287|   270k|                           }
 3288|   123k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 305, False: 122k]
  |  Branch (3288:61): [True: 25.2k, False: 97.5k]
  |  Branch (3288:85): [True: 30.5k, False: 67.0k]
  ------------------
 3289|  56.0k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 49, False: 56.0k]
  ------------------
 3290|     49|                                 ctx.error = error_code::syntax_error;
 3291|     49|                                 return;
 3292|     49|                              }
 3293|  56.0k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  56.0k|                           }
 3295|   123k|                        }
 3296|   125k|                     }
 3297|   125k|                  }
 3298|   125k|                  break;
 3299|   399k|               }
 3300|   818k|            }
 3301|       |
 3302|   445k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 27.3k, False: 418k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   418k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 2.91k, False: 415k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   415k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 12.5k, False: 402k]
  ------------------
 3309|  12.5k|               it = line_start;
 3310|  12.5k|               return;
 3311|  12.5k|            }
 3312|       |
 3313|   402k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 13.4k, False: 389k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  13.4k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 15, False: 13.4k]
  ------------------
 3318|     15|                  ctx.error = error_code::syntax_error;
 3319|     15|                  return;
 3320|     15|               }
 3321|       |
 3322|  13.4k|               ++it;
 3323|  13.4k|               auto pending_name = parse_anchor_name(it, end);
 3324|  13.4k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 17, False: 13.3k]
  ------------------
 3325|     17|                  ctx.error = error_code::syntax_error;
 3326|     17|                  return;
 3327|     17|               }
 3328|  13.3k|               skip_inline_ws(it, end);
 3329|  13.3k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 13.2k, False: 158]
  |  Branch (3329:33): [True: 2.17k, False: 11.0k]
  ------------------
 3330|  2.17k|                  skip_comment(it, end);
 3331|  2.17k|               }
 3332|       |
 3333|  13.3k|               has_pending_item_anchor = true;
 3334|  13.3k|               pending_item_anchor_name = std::string(pending_name);
 3335|  13.3k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  13.3k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 170, False: 13.2k]
  |  Branch (3337:34): [True: 7.06k, False: 6.15k]
  |  Branch (3337:49): [True: 126, False: 6.94k]
  ------------------
 3338|    296|                  ctx.error = error_code::syntax_error;
 3339|    296|                  return;
 3340|    296|               }
 3341|       |
 3342|  13.0k|               skip_newline(it, end);
 3343|  13.0k|               continue;
 3344|  13.3k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   389k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 19.7k, False: 369k]
  ------------------
 3348|  19.7k|               it = line_start;
 3349|  19.7k|               return;
 3350|  19.7k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   369k|            dash_col = line_indent;
 3356|   369k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   369k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 369k, False: 49]
  ------------------
 3358|   369k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   369k|               }
 3360|   369k|            }
 3361|       |
 3362|   369k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   369k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 366k, False: 3.45k]
  |  Branch (3365:30): [True: 6.78k, False: 359k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  6.78k|               it = line_start;
 3368|  6.78k|               return;
 3369|  6.78k|            }
 3370|       |
 3371|   362k|            bool saw_tab_after_dash = false;
 3372|   585k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 579k, False: 5.08k]
  |  Branch (3372:34): [True: 188k, False: 391k]
  |  Branch (3372:48): [True: 33.3k, False: 357k]
  ------------------
 3373|   222k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.09k, False: 218k]
  |  Branch (3373:59): [True: 29.7k, False: 188k]
  ------------------
 3374|   222k|               ++it;
 3375|   222k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   362k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 29.7k, False: 333k]
  |  Branch (3377:39): [True: 28.9k, False: 775]
  |  Branch (3377:52): [True: 1.17k, False: 27.7k]
  ------------------
 3378|  1.17k|               const auto after_dash = it + 1;
 3379|  1.17k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 11, False: 1.16k]
  |  Branch (3379:41): [True: 12, False: 1.15k]
  ------------------
 3380|     23|                  ctx.error = error_code::syntax_error;
 3381|     23|                  return;
 3382|     23|               }
 3383|  1.17k|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   362k|            auto parse_element = [&](auto& element) {
 3387|   362k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   362k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   362k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   362k|                     return;
 3397|   362k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   362k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   362k|                  ctx.sequence_item_value_context = true;
 3400|   362k|                  ctx.sequence_dash_indent = dash_col;
 3401|   362k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   362k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   362k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   362k|                  ctx.pop_indent();
 3405|   362k|               }
 3406|   362k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   362k|                  skip_ws_and_comment(it, end);
 3409|   362k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   362k|                  auto nested_start = it;
 3413|   362k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   362k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   362k|                     return;
 3416|   362k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   362k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   362k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   362k|                     const int32_t element_indent =
 3428|   362k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   362k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   362k|                        return;
 3431|   362k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   362k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   362k|                     ctx.sequence_item_value_context = true;
 3434|   362k|                     ctx.sequence_dash_indent = dash_col;
 3435|   362k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   362k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   362k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   362k|                     ctx.pop_indent();
 3439|   362k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   362k|               }
 3442|       |
 3443|   362k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   362k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   362k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   362k|                                                                      pending_item_anchor_indent};
 3447|   362k|                  has_pending_item_anchor = false;
 3448|   362k|               }
 3449|   362k|            };
 3450|       |
 3451|   362k|            if constexpr (emplace_backable<V>) {
 3452|   362k|               auto& element = value.emplace_back();
 3453|   362k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   362k|            first_item = false;
 3472|       |
 3473|   362k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 3.97k, False: 358k]
  ------------------
 3474|  3.97k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   362k|         }
 3479|   125k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   362k|            auto parse_element = [&](auto& element) {
 3387|   362k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 357k, False: 5.03k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   362k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 357k, False: 5.03k]
  |  Branch (3390:33): [True: 145k, False: 212k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   145k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 145k]
  ------------------
 3396|      0|                     return;
 3397|   145k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   145k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   145k|                  ctx.sequence_item_value_context = true;
 3400|   145k|                  ctx.sequence_dash_indent = dash_col;
 3401|   145k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   145k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   145k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   145k|                  ctx.pop_indent();
 3405|   145k|               }
 3406|   217k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   217k|                  skip_ws_and_comment(it, end);
 3409|   217k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   217k|                  auto nested_start = it;
 3413|   217k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   217k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 12, False: 217k]
  ------------------
 3415|     12|                     return;
 3416|   217k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   217k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 3.72k, False: 213k]
  ------------------
 3422|   217k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 178k, False: 39.1k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   178k|                     const int32_t element_indent =
 3428|   178k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 178k]
  ------------------
 3429|   178k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 178k]
  ------------------
 3430|      0|                        return;
 3431|   178k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   178k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   178k|                     ctx.sequence_item_value_context = true;
 3434|   178k|                     ctx.sequence_dash_indent = dash_col;
 3435|   178k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   178k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   178k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   178k|                     ctx.pop_indent();
 3439|   178k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   217k|               }
 3442|       |
 3443|   362k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 4.66k, False: 358k]
  |  Branch (3443:47): [True: 4.35k, False: 311]
  ------------------
 3444|  4.35k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 2.69k, False: 1.65k]
  ------------------
 3445|  4.35k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  4.35k|                                                                      pending_item_anchor_indent};
 3447|  4.35k|                  has_pending_item_anchor = false;
 3448|  4.35k|               }
 3449|   362k|            };
_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_:
 5530|   622k|   {
 5531|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5532|       |         // In flow context, only treat plain content as an implicit "key: value"
 5533|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5534|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5535|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5536|       |            // once per entry per nesting level over the whole remaining flow collection.
 5537|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5538|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5539|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5540|       |            // flow-context plain scalar, so every one of them is an indicator.
 5541|       |            bool at_node_start = true;
 5542|       |            int depth = 0;
 5543|       |            while (pos != stop) {
 5544|       |               const char c = *pos;
 5545|       |               if (c == ' ' || c == '\t') {
 5546|       |                  ++pos;
 5547|       |                  continue;
 5548|       |               }
 5549|       |               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|       |               if ((c == '"' || c == '\'') && node_start) {
 5552|       |                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|       |                  continue;
 5554|       |               }
 5555|       |               if (c == '[' || c == '{') {
 5556|       |                  ++depth;
 5557|       |                  at_node_start = true;
 5558|       |                  ++pos;
 5559|       |                  continue;
 5560|       |               }
 5561|       |               if (c == ']' || c == '}') {
 5562|       |                  if (depth == 0) return false;
 5563|       |                  --depth;
 5564|       |                  ++pos;
 5565|       |                  continue;
 5566|       |               }
 5567|       |               if (c == ',' && depth == 0) return false;
 5568|       |               if (c == ':' && depth == 0) {
 5569|       |                  auto next = pos + 1;
 5570|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|       |               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|       |               if (c == ',' || c == ':') {
 5574|       |                  at_node_start = true;
 5575|       |                  ++pos;
 5576|       |                  continue;
 5577|       |               }
 5578|       |               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|       |                  at_node_start = true;
 5580|       |                  continue;
 5581|       |               }
 5582|       |               ++pos;
 5583|       |            }
 5584|       |            return false;
 5585|       |         };
 5586|       |
 5587|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5588|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5589|       |               return;
 5590|       |            }
 5591|       |            if (bool(ctx.error)) {
 5592|       |               return;
 5593|       |            }
 5594|       |         }
 5595|       |
 5596|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|       |         return;
 5598|       |      }
 5599|       |
 5600|   622k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 315k, False: 307k]
  ------------------
 5601|   315k|         return;
 5602|   315k|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|   307k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 24.6k, False: 282k]
  ------------------
 5605|  24.6k|         return;
 5606|  24.6k|      }
 5607|   282k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   282k|   }
_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_:
 5962|   103k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   103k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 6.94k, False: 96.1k]
  ------------------
 5964|  6.94k|                  return true;
 5965|  6.94k|               }
 5966|  96.1k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 24.9k, False: 71.2k]
  ------------------
 5967|  24.9k|                  auto next = ptr + 1;
 5968|  24.9k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 9.50k, False: 15.4k]
  |  Branch (5968:43): [True: 3.49k, False: 11.9k]
  |  Branch (5968:59): [True: 3.41k, False: 8.56k]
  |  Branch (5968:76): [True: 2.74k, False: 5.82k]
  |  Branch (5968:93): [True: 3.67k, False: 2.15k]
  ------------------
 5969|  24.9k|               }
 5970|  71.2k|               return is_plain_scalar_boundary(*ptr);
 5971|  96.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:
 5888|  71.2k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  71.2k|               switch (ch) {
 5890|  1.76k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 1.76k, False: 69.4k]
  ------------------
 5891|  3.65k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 1.88k, False: 69.3k]
  ------------------
 5892|  19.5k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 15.8k, False: 55.3k]
  ------------------
 5893|  59.0k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 39.5k, False: 31.6k]
  ------------------
 5894|  59.9k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 911, False: 70.3k]
  ------------------
 5895|  60.8k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 914, False: 70.2k]
  ------------------
 5896|  61.6k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 812, False: 70.4k]
  ------------------
 5897|  61.6k|                  return true;
 5898|  9.54k|               default:
  ------------------
  |  Branch (5898:16): [True: 9.54k, False: 61.6k]
  ------------------
 5899|  9.54k|                  return false;
 5900|  71.2k|               }
 5901|  71.2k|            };
_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_:
 5903|  91.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5905|       |                  return false;
 5906|       |               }
 5907|  91.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 11.1k, False: 80.3k]
  ------------------
 5908|  11.1k|                  return false;
 5909|  11.1k|               }
 5910|  80.3k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 4.76k, False: 75.5k]
  |  Branch (5910:40): [True: 59.7k, False: 15.8k]
  |  Branch (5910:61): [True: 20.4k, False: 39.2k]
  ------------------
 5911|  25.1k|                  return false;
 5912|  25.1k|               }
 5913|       |
 5914|  55.1k|               auto look = word_end;
 5915|  55.1k|               yaml::skip_newline(look, end);
 5916|   186k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 168k, False: 17.7k]
  ------------------
 5917|   168k|                  int32_t line_indent = 0;
 5918|   303k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 302k, False: 824]
  |  Branch (5918:41): [True: 135k, False: 167k]
  ------------------
 5919|   135k|                     ++line_indent;
 5920|   135k|                     ++look;
 5921|   135k|                  }
 5922|   168k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 167k, False: 824]
  |  Branch (5922:38): [True: 2.20k, False: 165k]
  ------------------
 5923|  2.20k|                     return false;
 5924|  2.20k|                  }
 5925|   166k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 824, False: 165k]
  |  Branch (5925:38): [True: 105k, False: 60.2k]
  |  Branch (5925:55): [True: 14.1k, False: 46.1k]
  ------------------
 5926|   119k|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 119k, False: 824]
  ------------------
 5927|   119k|                        yaml::skip_newline(look, end);
 5928|   119k|                        continue;
 5929|   119k|                     }
 5930|    824|                     return false;
 5931|   119k|                  }
 5932|  46.1k|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 12.6k, False: 33.4k]
  ------------------
 5933|  12.6k|                     yaml::skip_comment(look, end);
 5934|  12.6k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 11.8k, False: 836]
  |  Branch (5934:42): [True: 5.19k, False: 6.63k]
  |  Branch (5934:59): [True: 6.58k, False: 52]
  ------------------
 5935|  11.7k|                        yaml::skip_newline(look, end);
 5936|  11.7k|                        continue;
 5937|  11.7k|                     }
 5938|    888|                     return false;
 5939|  12.6k|                  }
 5940|       |
 5941|       |                  // If the next non-empty line is an implicit mapping entry,
 5942|       |                  // don't treat it as scalar continuation for auto-deduced
 5943|       |                  // booleans/nulls.
 5944|  33.4k|                  {
 5945|  33.4k|                     auto scan = look;
 5946|   263k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 262k, False: 1.13k]
  |  Branch (5946:44): [True: 247k, False: 15.6k]
  |  Branch (5946:61): [True: 243k, False: 3.41k]
  ------------------
 5947|   243k|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 23.4k, False: 220k]
  ------------------
 5948|  23.4k|                           auto after_colon = scan + 1;
 5949|  23.4k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 673, False: 22.7k]
  |  Branch (5949:54): [True: 8.32k, False: 14.4k]
  |  Branch (5949:77): [True: 1.12k, False: 13.3k]
  ------------------
 5950|  13.3k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 1.39k, False: 11.9k]
  |  Branch (5950:56): [True: 1.74k, False: 10.2k]
  ------------------
 5951|  13.2k|                              return false;
 5952|  13.2k|                           }
 5953|  23.4k|                        }
 5954|   230k|                        ++scan;
 5955|   230k|                     }
 5956|  33.4k|                  }
 5957|       |
 5958|  20.1k|                  return line_indent > ctx.current_indent();
 5959|  33.4k|               }
 5960|  17.7k|               return false;
 5961|  55.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_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5484|   705k|   {
 5485|   705k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   705k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   705k|         const bool could_be_mapping = [&] {
 5493|   705k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   705k|               return line_could_be_flow_mapping(it, end);
 5495|   705k|            }
 5496|   705k|            else {
 5497|   705k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   705k|            }
 5499|   705k|         }();
 5500|   705k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 313k, False: 391k]
  ------------------
 5501|   313k|            return false;
 5502|   313k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   391k|         auto temp_ctx = ctx.make_speculative();
 5505|   391k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   391k|                                                                                               end);
 5507|   391k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   391k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   391k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 339k, False: 51.5k]
  ------------------
 5510|   339k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   339k|            return true;
 5512|   339k|         }
 5513|       |         // The line matched "key: value" pattern but parsing failed.
 5514|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5515|       |         // so propagate the error rather than silently falling back to string.
 5516|  51.5k|         ctx.error = temp_ctx.error;
 5517|  51.5k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  51.5k|         return false;
 5519|   391k|      }
 5520|   705k|   }
_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:
 5492|   705k|         const bool could_be_mapping = [&] {
 5493|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5494|       |               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|   705k|            else {
 5497|   705k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   705k|            }
 5499|   705k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|  1.82k|               auto is_document_start = [&](auto pos) {
  146|  1.82k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 1.04k, False: 782]
  |  Branch (146:41): [True: 466, False: 575]
  |  Branch (146:58): [True: 391, False: 75]
  |  Branch (146:75): [True: 373, False: 18]
  ------------------
  147|    373|                     auto after = pos + 3;
  148|    373|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 11, False: 362]
  |  Branch (148:45): [True: 143, False: 219]
  |  Branch (148:62): [True: 144, False: 75]
  |  Branch (148:80): [True: 39, False: 36]
  |  Branch (148:98): [True: 24, False: 12]
  ------------------
  149|     12|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 0, False: 12]
  ------------------
  150|    373|                  }
  151|  1.45k|                  return false;
  152|  1.82k|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6732|  40.6k|   {
 6733|  40.6k|      if (buffer.size() == 0) {
  ------------------
  |  Branch (6733:11): [True: 0, False: 40.6k]
  ------------------
 6734|      0|         using V = std::remove_cvref_t<T>;
 6735|      0|         if constexpr (requires { value = nullptr; }) {
 6736|      0|            value = nullptr;
 6737|      0|            return {};
 6738|       |         }
 6739|       |         else if constexpr (nullable_like<V>) {
 6740|       |            value = {};
 6741|       |            return {};
 6742|       |         }
 6743|      0|      }
 6744|      0|      yaml::yaml_context ctx{};
 6745|  40.6k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6746|  40.6k|   }

