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

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

_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEED2Ev:
  569|  31.4M|      {
  570|  31.4M|         free_data();
  571|  31.4M|         free_index();
  572|  31.4M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9free_dataEv:
  266|  31.4M|      {
  267|  31.4M|         destroy_all();
  268|  31.4M|         ::operator delete(data_);
  269|  31.4M|         data_ = nullptr;
  270|  31.4M|         size_ = 0;
  271|  31.4M|         capacity_ = 0;
  272|  31.4M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11destroy_allEv:
  259|  40.5M|      {
  260|  60.9M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (260:31): [True: 20.3M, False: 40.5M]
  ------------------
  261|  20.3M|            std::destroy_at(data_ + i);
  262|  20.3M|         }
  263|  40.5M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10free_indexEv:
  308|  31.4M|      {
  309|  31.4M|         std::free(index_);
  310|  31.4M|         index_ = nullptr;
  311|  31.4M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2Ev:
  566|  18.1M|      ordered_small_map() = default;
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEaSEOS4_:
  628|  2.24k|      {
  629|  2.24k|         if (this != &other) {
  ------------------
  |  Branch (629:14): [True: 2.24k, False: 0]
  ------------------
  630|  2.24k|            free_data();
  631|  2.24k|            free_index();
  632|  2.24k|            data_ = other.data_;
  633|  2.24k|            size_ = other.size_;
  634|  2.24k|            capacity_ = other.capacity_;
  635|  2.24k|            index_ = other.index_;
  636|  2.24k|            other.data_ = nullptr;
  637|  2.24k|            other.size_ = 0;
  638|  2.24k|            other.capacity_ = 0;
  639|  2.24k|            other.index_ = nullptr;
  640|  2.24k|         }
  641|  2.24k|         return *this;
  642|  2.24k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2EOS4_:
  610|  13.2M|         : data_(other.data_), size_(other.size_), capacity_(other.capacity_), index_(other.index_)
  611|  13.2M|      {
  612|  13.2M|         other.data_ = nullptr;
  613|  13.2M|         other.size_ = 0;
  614|  13.2M|         other.capacity_ = 0;
  615|  13.2M|         other.index_ = nullptr;
  616|  13.2M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5emptyEv:
  662|  16.3M|      [[nodiscard]] bool empty() const noexcept { return size_ == 0; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5beginEv:
  645|  16.2M|      iterator begin() noexcept { return data_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE3endEv:
  649|  35.6M|      iterator end() noexcept { return data_ + size_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11linear_findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  421|  16.9M|      {
  422|  29.6M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (422:31): [True: 15.5M, False: 14.0M]
  ------------------
  423|  15.5M|            if (data_[i].first == key) return data_ + i;
  ------------------
  |  Branch (423:17): [True: 2.85M, False: 12.6M]
  ------------------
  424|  15.5M|         }
  425|  14.0M|         return data_ + size_;
  426|  16.9M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14grow_if_neededEv:
  217|  15.9M|      {
  218|  15.9M|         if (size_ == capacity_) {
  ------------------
  |  Branch (218:14): [True: 9.11M, False: 6.86M]
  ------------------
  219|  9.11M|            if (size_ == max_u32) {
  ------------------
  |  Branch (219:17): [True: 0, False: 9.11M]
  ------------------
  220|      0|               throw_capacity_overflow();
  221|      0|            }
  222|  9.11M|            const uint32_t new_cap = next_data_capacity(capacity_);
  223|  9.11M|            reallocate_data(new_cap);
  224|  9.11M|         }
  225|  15.9M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE18next_data_capacityEj:
  120|  9.11M|      {
  121|  9.11M|         if (current == 0) return 4;
  ------------------
  |  Branch (121:14): [True: 8.74M, False: 369k]
  ------------------
  122|   369k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (122:14): [True: 0, False: 369k]
  ------------------
  123|   369k|         return current * 2;
  124|   369k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15reallocate_dataEj:
  205|  9.11M|      {
  206|  9.11M|         if (new_cap < size_) {
  ------------------
  |  Branch (206:14): [True: 0, False: 9.11M]
  ------------------
  207|      0|            throw_capacity_overflow();
  208|      0|         }
  209|  9.11M|         auto* new_data = allocate_and_relocate(new_cap);
  210|  9.11M|         destroy_all();
  211|  9.11M|         ::operator delete(data_);
  212|  9.11M|         data_ = new_data;
  213|  9.11M|         capacity_ = new_cap;
  214|  9.11M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21allocate_and_relocateEj:
  159|  9.11M|      {
  160|  9.11M|         auto* new_data = static_cast<value_type*>(::operator new(checked_data_allocation_bytes(new_cap)));
  161|  9.11M|#if __cpp_exceptions
  162|  9.11M|         uint32_t constructed = 0;
  163|  9.11M|         try {
  164|  13.4M|            for (; constructed < size_; ++constructed) {
  ------------------
  |  Branch (164:20): [True: 4.36M, False: 9.11M]
  ------------------
  165|  4.36M|               std::construct_at(new_data + constructed, std::move_if_noexcept(data_[constructed]));
  166|  4.36M|            }
  167|  9.11M|         }
  168|  9.11M|         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|  9.11M|         return new_data;
  179|  9.11M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE29checked_data_allocation_bytesEj:
  134|  9.11M|      {
  135|  9.11M|         if (count > ((std::numeric_limits<size_t>::max)() / sizeof(value_type))) {
  ------------------
  |  Branch (135:14): [True: 0, False: 9.11M]
  ------------------
  136|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  137|      0|         }
  138|  9.11M|         return static_cast<size_t>(count) * sizeof(value_type);
  139|  9.11M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE8hash_keyENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
   97|  8.01M|      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.90M|      {
  286|  3.90M|         const uint32_t a = h & bloom_mask;
  287|  3.90M|         const uint32_t b = (h >> 10) & bloom_mask;
  288|  3.90M|         return (index_->bloom[a >> 3] & (uint8_t(1) << (a & 7))) && (index_->bloom[b >> 3] & (uint8_t(1) << (b & 7)));
  ------------------
  |  Branch (288:17): [True: 2.42M, False: 1.47M]
  |  Branch (288:70): [True: 2.23M, False: 182k]
  ------------------
  289|  3.90M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17index_find_or_posINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS4_17index_find_resultERKT_j:
  400|  2.38M|      {
  401|  2.38M|         ensure_index();
  402|       |
  403|  2.38M|         const auto* base = index_entries();
  404|  2.38M|         const auto* idx_end = base + index_->size;
  405|  2.38M|         const auto* p = branchless_lower_bound(base, index_->size, h);
  406|  2.38M|         const size_t pos = static_cast<size_t>(p - base);
  407|       |
  408|       |         // Scan adjacent entries with matching hash
  409|  2.46M|         for (auto* scan = p; scan != idx_end && scan->key_hash == h; ++scan) {
  ------------------
  |  Branch (409:31): [True: 2.45M, False: 4.40k]
  |  Branch (409:50): [True: 2.16M, False: 295k]
  ------------------
  410|  2.16M|            if (data_[scan->index].first == key) {
  ------------------
  |  Branch (410:17): [True: 2.08M, False: 76.1k]
  ------------------
  411|  2.08M|               return {data_ + scan->index, pos, h};
  412|  2.08M|            }
  413|  2.16M|         }
  414|       |
  415|   299k|         return {data_ + size_, pos, h};
  416|  2.38M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE12ensure_indexEv:
  360|  2.38M|      {
  361|  2.38M|         if (size_ <= linear_search_threshold) return;
  ------------------
  |  Branch (361:14): [True: 0, False: 2.38M]
  ------------------
  362|  2.38M|         const auto current = index_size();
  363|  2.38M|         if (current == size_) return; // fully current
  ------------------
  |  Branch (363:14): [True: 1.92M, False: 466k]
  ------------------
  364|       |
  365|   466k|         if (current == 0 || (size_ - current) > linear_search_threshold) {
  ------------------
  |  Branch (365:14): [True: 67.3k, False: 399k]
  |  Branch (365:30): [True: 52.3k, False: 347k]
  ------------------
  366|   119k|            rebuild_index(); // full rebuild
  367|   119k|            return;
  368|   119k|         }
  369|       |
  370|       |         // Incrementally insert-sort the few new entries
  371|  1.18M|         for (uint32_t i = current; i < size_; ++i) {
  ------------------
  |  Branch (371:37): [True: 835k, False: 347k]
  ------------------
  372|   835k|            const hash_index_entry entry{hash_key(data_[i].first), i};
  373|   835k|            const auto* base = index_entries();
  374|   835k|            const auto* p = branchless_lower_bound(base, index_->size, entry.key_hash);
  375|   835k|            auto pos = static_cast<size_t>(p - base);
  376|       |
  377|   835k|            const uint32_t m = index_->size;
  378|   835k|            ensure_index_capacity(static_cast<size_type>(m) + 1);
  379|   835k|            auto* entries = index_entries();
  380|   835k|            if (pos < m) {
  ------------------
  |  Branch (380:17): [True: 804k, False: 31.0k]
  ------------------
  381|   804k|               std::memmove(entries + pos + 1, entries + pos, (m - pos) * sizeof(hash_index_entry));
  382|   804k|            }
  383|   835k|            entries[pos] = entry;
  384|   835k|            index_->size = i + 1;
  385|   835k|         }
  386|   347k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEv:
  343|   119k|      {
  344|   119k|         ensure_index_capacity(static_cast<size_type>(size_));
  345|   119k|         bloom_clear();
  346|   119k|         auto* entries = index_entries();
  347|  3.24M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (347:31): [True: 3.12M, False: 119k]
  ------------------
  348|  3.12M|            const uint32_t h = hash_key(data_[i].first);
  349|  3.12M|            entries[i] = {h, i};
  350|  3.12M|            bloom_set(h);
  351|  3.12M|         }
  352|   119k|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
  353|   119k|         index_->size = size_;
  354|   119k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11bloom_clearEv:
  291|   119k|      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.6M|         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|  3.22M|      {
  441|  20.4M|         while (len > 1) {
  ------------------
  |  Branch (441:17): [True: 17.2M, False: 3.22M]
  ------------------
  442|  17.2M|            size_t half = len / 2;
  443|  17.2M|            p += (p[half - 1].key_hash < target) * half;
  444|  17.2M|            len -= half;
  445|  17.2M|         }
  446|       |         // Final element check: advance past it if it's less than target
  447|  3.22M|         p += (len == 1 && p->key_hash < target);
  ------------------
  |  Branch (447:16): [True: 3.22M, False: 0]
  |  Branch (447:28): [True: 35.4k, False: 3.18M]
  ------------------
  448|  3.22M|         return p;
  449|  3.22M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9bloom_setEj:
  277|  5.08M|      {
  278|  5.08M|         const uint32_t a = h & bloom_mask;
  279|  5.08M|         const uint32_t b = (h >> 10) & bloom_mask;
  280|  5.08M|         index_->bloom[a >> 3] |= uint8_t(1) << (a & 7);
  281|  5.08M|         index_->bloom[b >> 3] |= uint8_t(1) << (b & 7);
  282|  5.08M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10index_sizeEv:
  300|  2.68M|      uint32_t index_size() const noexcept { return index_ ? index_->size : 0; }
  ------------------
  |  Branch (300:53): [True: 2.61M, False: 67.3k]
  ------------------
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21ensure_index_capacityEm:
  314|  1.25M|      {
  315|  1.25M|         if (needed == 0) return;
  ------------------
  |  Branch (315:14): [True: 0, False: 1.25M]
  ------------------
  316|  1.25M|         if (needed > static_cast<size_type>(max_u32)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 1.25M]
  ------------------
  317|      0|            throw_index_overflow();
  318|      0|         }
  319|  1.25M|         const auto needed_u32 = static_cast<uint32_t>(needed);
  320|  1.25M|         if (index_ && index_->capacity >= needed_u32) return;
  ------------------
  |  Branch (320:14): [True: 1.18M, False: 67.3k]
  |  Branch (320:24): [True: 1.12M, False: 67.0k]
  ------------------
  321|   134k|         uint32_t cap = index_ ? index_->capacity : 0;
  ------------------
  |  Branch (321:25): [True: 67.0k, False: 67.3k]
  ------------------
  322|   275k|         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: 67.3k, False: 67.0k]
  ------------------
  332|  67.3k|            block->size = 0;
  333|  67.3k|            std::memset(block->bloom, 0, bloom_bytes);
  334|  67.3k|         }
  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: 67.3k, False: 73.4k]
  ------------------
  129|  73.4k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (129:14): [True: 0, False: 73.4k]
  ------------------
  130|  73.4k|         return current * 2;
  131|  73.4k|      }
_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|  4.47M|      {
  297|  4.47M|         return static_cast<hash_index_entry*>(static_cast<void*>(index_ + 1));
  298|  4.47M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  902|  73.3k|      {
  903|  73.3k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (903:14): [True: 73.3k, False: 0]
  ------------------
  904|  73.3k|            return linear_find(key);
  905|  73.3k|         }
  906|      0|         return index_find(key);
  907|  73.3k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE6insertEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  719|  73.3k|      {
  720|  73.3k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (720:14): [True: 73.3k, False: 0]
  ------------------
  721|  73.3k|            auto it = linear_find(value.first);
  722|  73.3k|            if (it != end()) return {it, false};
  ------------------
  |  Branch (722:17): [True: 0, False: 73.3k]
  ------------------
  723|  73.3k|            push_back_impl(std::move(value));
  724|  73.3k|            return {data_ + size_ - 1, true};
  725|  73.3k|         }
  726|      0|         const uint32_t h = hash_key(value.first);
  727|      0|         if (try_bloom_insert(h, [&] { push_back_impl(std::move(value)); })) {
  ------------------
  |  Branch (727:14): [True: 0, False: 0]
  ------------------
  728|      0|            return {data_ + size_ - 1, true};
  729|      0|         }
  730|       |         // try_bloom_insert returned false without calling the lambda, so value is still valid
  731|      0|         return indexed_insert(value.first, h, [&] { push_back_impl(std::move(value)); });
  732|      0|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14push_back_implEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  235|  73.3k|      {
  236|  73.3k|         grow_if_needed();
  237|  73.3k|         std::construct_at(data_ + size_, std::move(val));
  238|  73.3k|         ++size_;
  239|  73.3k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE7emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  746|  20.8M|      {
  747|  20.8M|         return try_emplace(std::forward<K>(key), std::forward<Args>(args)...);
  748|  20.8M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  752|  20.8M|      {
  753|  20.8M|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (753:14): [True: 16.8M, False: 4.04M]
  ------------------
  754|  16.8M|            auto it = linear_find(key);
  755|  16.8M|            if (it != end()) return {it, false};
  ------------------
  |  Branch (755:17): [True: 2.85M, False: 13.9M]
  ------------------
  756|  13.9M|            emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  757|  13.9M|            return {data_ + size_ - 1, true};
  758|  16.8M|         }
  759|  4.04M|         const uint32_t h = hash_key(key);
  760|  4.04M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
  ------------------
  |  Branch (760:14): [True: 1.66M, False: 2.38M]
  ------------------
  761|  1.66M|            return {data_ + size_ - 1, true};
  762|  1.66M|         }
  763|  2.38M|         auto [it, pos, _] = index_find_or_pos(key, h);
  764|  2.38M|         if (it != end()) return {it, false};
  ------------------
  |  Branch (764:14): [True: 2.08M, False: 299k]
  ------------------
  765|   299k|         emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  766|   299k|         bloom_set(h);
  767|   299k|         if (index_size() > 0) {
  ------------------
  |  Branch (767:14): [True: 299k, False: 0]
  ------------------
  768|   299k|            const uint32_t n = index_->size;
  769|   299k|            ensure_index_capacity(static_cast<size_type>(n) + 1);
  770|   299k|            auto* entries = index_entries();
  771|   299k|            if (pos < n) {
  ------------------
  |  Branch (771:17): [True: 295k, False: 4.39k]
  ------------------
  772|   295k|               std::memmove(entries + pos + 1, entries + pos, (n - pos) * sizeof(hash_index_entry));
  773|   295k|            }
  774|   299k|            entries[pos] = {h, static_cast<uint32_t>(size_ - 1)};
  775|   299k|            index_->size = size_;
  776|   299k|         }
  777|   299k|         return {data_ + size_ - 1, true};
  778|  2.38M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15emplace_back_kvINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEEvOT_DpOT0_:
  251|  15.9M|      {
  252|  15.9M|         grow_if_needed();
  253|  15.9M|         std::construct_at(data_ + size_, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(key)),
  254|  15.9M|                           std::forward_as_tuple(std::forward<Args>(args)...));
  255|  15.9M|         ++size_;
  256|  15.9M|      }
_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|  4.04M|      {
  530|  4.04M|         if (index_ && size_ <= bloom_threshold && !bloom_maybe_contains(h)) {
  ------------------
  |  Branch (530:14): [True: 3.98M, False: 67.3k]
  |  Branch (530:24): [True: 3.90M, False: 80.4k]
  |  Branch (530:52): [True: 1.66M, False: 2.23M]
  ------------------
  531|       |            // Definitely not present — skip the search
  532|  1.66M|            append_fn();
  533|  1.66M|            bloom_set(h);
  534|       |            // Index is now stale (index_->size < size_), will rebuild on next lookup or false positive
  535|  1.66M|            return true;
  536|  1.66M|         }
  537|  2.38M|         return false;
  538|  4.04M|      }
_ZZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_ENKUlvE_clEv:
  760|  1.66M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4sizeEv:
  663|  10.0k|      size_type size() const noexcept { return size_; }

_ZN3glz15resize_unfilledINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
   63|  5.22M|   {
   64|  5.22M|      if constexpr (requires { b.resize_and_overwrite(n, [](auto*, size_t written) { return written; }); }) {
   65|  5.22M|         b.resize_and_overwrite(n, [](auto*, size_t written) noexcept { return written; });
   66|       |      }
   67|       |      else {
   68|       |         b.resize(n);
   69|       |      }
   70|  5.22M|   }
_ZZN3glz15resize_unfilledINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_mENKUlPS8_mE_clIcEEDaSA_m:
   65|  5.22M|         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|  31.8M|   {
  266|  31.8M|      using Buffer = std::remove_cvref_t<B>;
  267|       |
  268|  31.8M|      if constexpr (vector_like<Buffer>) {
  269|  31.8M|         if (required > b.size()) [[unlikely]] {
  ------------------
  |  Branch (269:14): [True: 416k, False: 31.4M]
  ------------------
  270|   416k|            grow_buffer(b, required);
  271|   416k|         }
  272|  31.8M|         return true;
  273|       |      }
  274|       |      else if constexpr (has_bounded_capacity<Buffer>) {
  275|       |         if (required > buffer_traits<Buffer>::capacity(b)) [[unlikely]] {
  276|       |            ctx.error = error_code::buffer_overflow;
  277|       |            return false;
  278|       |         }
  279|       |         return true;
  280|       |      }
  281|       |      else {
  282|       |         return true; // Raw pointer or other - trust caller
  283|       |      }
  284|  31.8M|   }
_ZN3glz11grow_bufferINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
  143|   417k|   {
  144|   417k|      using traits = buffer_traits<std::remove_cvref_t<B>>;
  145|   417k|      if constexpr (requires { traits::grow(b, required); }) {
  146|   417k|         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|   417k|   }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE4growERS7_mQL_ZNS_13buffer_traits12is_resizableEE:
  118|   417k|      {
  119|   417k|         resize_unfilled(b, 2 * required);
  120|   417k|      }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE8finalizeERS7_m:
  124|  4.80M|      {
  125|  4.80M|         if constexpr (is_resizable) {
  126|  4.80M|            b.resize(written);
  127|  4.80M|         }
  128|       |         // For fixed buffers: no-op, count is returned in result
  129|  4.80M|      }

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

_ZNK3glz9error_ctxcvbEv:
  148|   164k|      operator bool() const noexcept { return ec != error_code::none; }
_ZN3glz10call_scopeINS_4yaml12yaml_contextEEC2ERS2_:
  272|   164k|      explicit call_scope(Ctx& c) noexcept : ctx(c), depth(c.depth)
  273|   164k|      {
  274|   164k|         ctx.error = error_code::none;
  275|   164k|         ctx.custom_error_message = {};
  276|   164k|      }
_ZN3glz11depth_guardINS_4yaml12yaml_contextEEC2ERS2_m:
  215|  18.3M|      depth_guard(Ctx& c, const size_t limit = max_recursive_depth_limit) noexcept : ctx(c)
  216|  18.3M|      {
  217|  18.3M|         if (ctx.depth >= limit) [[unlikely]] {
  ------------------
  |  Branch (217:14): [True: 6.55k, False: 18.3M]
  ------------------
  218|  6.55k|            ctx.error = error_code::exceeded_max_recursive_depth;
  219|  6.55k|            return;
  220|  6.55k|         }
  221|  18.3M|         ++ctx.depth;
  222|  18.3M|         entered = true;
  223|  18.3M|      }
_ZNK3glz11depth_guardINS_4yaml12yaml_contextEEcvbEv:
  228|  18.3M|      explicit operator bool() const noexcept { return entered; }
_ZN3glz10call_scopeINS_7contextEEC2ERS1_:
  272|  4.80M|      explicit call_scope(Ctx& c) noexcept : ctx(c), depth(c.depth)
  273|  4.80M|      {
  274|  4.80M|         ctx.error = error_code::none;
  275|  4.80M|         ctx.custom_error_message = {};
  276|  4.80M|      }
_ZN3glz10call_scopeINS_7contextEED2Ev:
  277|  4.80M|      ~call_scope() { ctx.depth = depth; }
_ZN3glz11depth_guardINS_4yaml12yaml_contextEED2Ev:
  225|  18.3M|      {
  226|  18.3M|         if (entered) --ctx.depth;
  ------------------
  |  Branch (226:14): [True: 18.3M, False: 6.55k]
  ------------------
  227|  18.3M|      }
_ZN3glz10call_scopeINS_4yaml12yaml_contextEED2Ev:
  277|   164k|      ~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|  41.1k|   {
  233|  41.1k|      format_context_t<Opts.format> ctx{};
  234|  41.1k|      return read<Opts>(value, buffer, ctx);
  235|  41.1k|   }
_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|  41.1k|   {
  153|  41.1k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  41.1k|      call_scope scope{ctx};
  156|       |
  157|  41.1k|      if constexpr (Opts.format != NDJSON) {
  158|  41.1k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 41.1k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  41.1k|      }
  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|  41.1k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  41.1k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  41.1k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  41.1k|      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|  41.1k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  41.1k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  41.1k|         ctx.speculation_budget =
  185|  41.1k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 299, False: 40.8k]
  ------------------
  186|  41.1k|      }
  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|  41.1k|      if constexpr (requires { ctx.stream_begin; }) {
  194|  41.1k|         ctx.stream_begin = nullptr;
  195|  41.1k|      }
  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|  41.1k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  41.1k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 32.5k, False: 8.61k]
  ------------------
  203|  32.5k|         goto finish;
  204|  32.5k|      }
  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|  41.1k|   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|  41.1k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  41.1k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  8.61k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEETkNS_10contiguousERKNSt3__16vectorIcNS2_9allocatorIcEEEEEEDaOT0_:
   40|  41.1k|   {
   41|  41.1k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  41.1k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  41.1k|      auto end = it + buffer.size();
   45|       |
   46|  41.1k|      return std::pair{it, end};
   47|  41.1k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT0_PKcS8_S8_:
  131|  41.1k|   {
  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|  41.1k|      finalize_read_context(ctx);
  147|  41.1k|   }
_ZN3glz21finalize_read_contextITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
  109|   164k|   {
  110|   164k|      settle_partial_read_complete(ctx);
  111|   164k|      settle_end_reached(ctx);
  112|   164k|   }
_ZN3glz28settle_partial_read_completeITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
  102|   164k|   {
  103|   164k|      if (ctx.error == error_code::partial_read_complete) {
  ------------------
  |  Branch (103:11): [True: 0, False: 164k]
  ------------------
  104|      0|         ctx.error = error_code::none;
  105|      0|      }
  106|   164k|   }
_ZN3glz18settle_end_reachedITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
   88|   164k|   {
   89|   164k|      if (ctx.error == error_code::end_reached) {
  ------------------
  |  Branch (89:11): [True: 0, False: 164k]
  ------------------
   90|      0|         ctx.error = (ctx.depth == 0) ? error_code::none : error_code::unexpected_end;
  ------------------
  |  Branch (90:22): [True: 0, False: 0]
  ------------------
   91|      0|      }
   92|   164k|   }
_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|  82.2k|   {
  153|  82.2k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  82.2k|      call_scope scope{ctx};
  156|       |
  157|  82.2k|      if constexpr (Opts.format != NDJSON) {
  158|  82.2k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 82.2k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  82.2k|      }
  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|  82.2k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  82.2k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  82.2k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  82.2k|      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|  82.2k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  82.2k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  82.2k|         ctx.speculation_budget =
  185|  82.2k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 600, False: 81.6k]
  ------------------
  186|  82.2k|      }
  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|  82.2k|      if constexpr (requires { ctx.stream_begin; }) {
  194|  82.2k|         ctx.stream_begin = nullptr;
  195|  82.2k|      }
  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|  82.2k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  82.2k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 72.7k, False: 9.52k]
  ------------------
  203|  72.7k|         goto finish;
  204|  72.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|  82.2k|   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|  82.2k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  82.2k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  9.52k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10contiguousERKNSt3__16vectorIcNS3_9allocatorIcEEEEEEDaOT0_:
   40|  82.2k|   {
   41|  82.2k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  82.2k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  82.2k|      auto end = it + buffer.size();
   45|       |
   46|  82.2k|      return std::pair{it, end};
   47|  82.2k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10is_contextERNS1_12yaml_contextEEEvOT0_PKcS8_S8_:
  131|   123k|   {
  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|   123k|      finalize_read_context(ctx);
  147|   123k|   }
_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|  41.1k|   {
  153|  41.1k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  41.1k|      call_scope scope{ctx};
  156|       |
  157|  41.1k|      if constexpr (Opts.format != NDJSON) {
  158|  41.1k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 41.1k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  41.1k|      }
  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|  41.1k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  41.1k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  41.1k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  41.1k|      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|  41.1k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  41.1k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  41.1k|         ctx.speculation_budget =
  185|  41.1k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 301, False: 40.8k]
  ------------------
  186|  41.1k|      }
  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|  41.1k|      if constexpr (requires { ctx.stream_begin; }) {
  194|  41.1k|         ctx.stream_begin = nullptr;
  195|  41.1k|      }
  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|  41.1k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  41.1k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 40.2k, False: 916]
  ------------------
  203|  40.2k|         goto finish;
  204|  40.2k|      }
  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|  41.1k|   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|  41.1k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  41.1k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|    916|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10contiguousERNSt3__16vectorIcNS3_9allocatorIcEEEEEEDaOT0_:
   40|  41.1k|   {
   41|  41.1k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  41.1k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  41.1k|      auto end = it + buffer.size();
   45|       |
   46|  41.1k|      return std::pair{it, end};
   47|  41.1k|   }

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

_ZN3glz11write_chars2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj128EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEETkNS_5num_tERdTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  206|  1.00M|      {
  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|  1.00M|         using V = std::decay_t<decltype(value)>;
  221|       |
  222|  1.00M|         if constexpr (std::floating_point<V>) {
  223|  1.00M|            using opts_type = std::decay_t<decltype(Opts)>;
  224|  1.00M|            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|  1.00M|            else {
  292|  1.00M|               constexpr auto max_precision = uint8_t(check_float_max_write_precision(Opts));
  293|  1.00M|               constexpr bool narrows = max_precision > 0 && max_precision < sizeof(V);
  ------------------
  |  Branch (293:41): [Folded, False: 1.00M]
  |  Branch (293:62): [True: 0, Folded]
  ------------------
  294|  1.00M|#if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
  295|  1.00M|               constexpr bool has_full_precision_writer = is_any_of<V, float, double> || is_float128<V>;
  ------------------
  |  Branch (295:59): [True: 1.00M, 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|  1.00M|               else if constexpr (is_any_of<V, float, double>) {
  325|  1.00M|                  const auto start = reinterpret_cast<char*>(&b[ix]);
  326|  1.00M|                  const auto end = glz::to_chars(start, value);
  327|  1.00M|                  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|  1.00M|            }
  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|  1.00M|      }

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

_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2Ev:
  379|  41.0M|      generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEED2Ev:
  131|  69.8M|      ~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.92M|      generic_json& operator=(generic_json&&) = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2EOS3_:
  382|  28.8M|      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|  73.3k|      {
  246|  73.3k|         if (holds<null_t>()) data = object_t{};
  ------------------
  |  Branch (246:14): [True: 73.3k, False: 0]
  ------------------
  247|  73.3k|         auto* object = std::get_if<object_t>(&data);
  248|  73.3k|         if (!object) [[unlikely]] {
  ------------------
  |  Branch (248:14): [True: 0, False: 73.3k]
  ------------------
  249|      0|            key_type_mismatch(key);
  250|      0|         }
  251|  73.3k|         auto iter = object->find(key);
  252|  73.3k|         if (iter == object->end()) {
  ------------------
  |  Branch (252:14): [True: 73.3k, False: 0]
  ------------------
  253|  73.3k|            iter = object->insert(std::make_pair(std::string(key), generic_json{})).first;
  254|  73.3k|         }
  255|  73.3k|         return iter->second;
  256|  73.3k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE5holdsIDnEEbv:
  224|  4.51M|      {
  225|  4.51M|         return std::holds_alternative<T>(data);
  226|  4.51M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE7is_nullEv:
  459|  4.44M|      [[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.76M|      {
  177|  5.76M|         return std::get_if<T>(&data);
  178|  5.76M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE4sizeEv:
  575|  19.0k|      {
  576|  19.0k|         if (auto* v = get_if<object_t>()) {
  ------------------
  |  Branch (576:20): [True: 10.0k, False: 9.02k]
  ------------------
  577|  10.0k|            return v->size();
  578|  10.0k|         }
  579|  9.02k|         else if (auto* v = get_if<array_t>()) {
  ------------------
  |  Branch (579:25): [True: 2.33k, False: 6.69k]
  ------------------
  580|  2.33k|            return v->size();
  581|  2.33k|         }
  582|  6.69k|         else if (auto* v = get_if<std::string>()) {
  ------------------
  |  Branch (582:25): [True: 3.35k, False: 3.33k]
  ------------------
  583|  3.35k|            return v->size();
  584|  3.35k|         }
  585|  3.33k|         else {
  586|  3.33k|            return 0;
  587|  3.33k|         }
  588|  19.0k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINS2_IS3_EEEEPKT_v:
  182|  19.0k|      {
  183|  19.0k|         return std::get_if<T>(&data);
  184|  19.0k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__16vectorIS3_NS5_9allocatorIS3_EEEEEEPKT_v:
  182|  9.02k|      {
  183|  9.02k|         return std::get_if<T>(&data);
  184|  9.02k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPKT_v:
  182|  6.69k|      {
  183|  6.69k|         return std::get_if<T>(&data);
  184|  6.69k|      }

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

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

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

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

_ZN3glz10fast_float10from_charsIdciEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_12chars_formatE:
 4237|  4.47M|           chars_format fmt /*= chars_format::general*/) noexcept {
 4238|  4.47M|  return from_chars_caller<T>::call(first, last, value,
 4239|  4.47M|                                    parse_options_t<UC>(fmt));
 4240|  4.47M|}
_ZN3glz10fast_float17from_chars_callerIdE4callIcEENS0_19from_chars_result_tIT_EEPKS5_S8_RdNS0_15parse_options_tIS5_EE:
 4195|  4.47M|       parse_options_t<UC> options) noexcept {
 4196|  4.47M|    return from_chars_advanced(first, last, value, options);
 4197|  4.47M|  }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4443|  4.47M|                    parse_options_t<UC> options) noexcept {
 4444|  4.47M|  return from_chars_advanced_caller<
 4445|  4.47M|      size_t(is_supported_float_type<T>::value) +
 4446|  4.47M|      2 * size_t(is_supported_integer_type<T>::value)>::call(first, last, value,
 4447|  4.47M|                                                             options);
 4448|  4.47M|}
_ZN3glz10fast_float26from_chars_advanced_callerILm1EE4callIdcEENS0_19from_chars_result_tIT0_EEPKS5_S8_RT_NS0_15parse_options_tIS5_EE:
 4426|  4.47M|       parse_options_t<UC> options) noexcept {
 4427|  4.47M|    return from_chars_float_advanced(first, last, value, options);
 4428|  4.47M|  }
_ZN3glz10fast_float25from_chars_float_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4338|  4.47M|                          parse_options_t<UC> options) noexcept {
 4339|       |
 4340|  4.47M|  static_assert(is_supported_float_type<T>::value,
 4341|  4.47M|                "only some floating-point types are supported");
 4342|  4.47M|  static_assert(is_supported_char_type<UC>::value,
 4343|  4.47M|                "only char, wchar_t, char16_t and char32_t are supported");
 4344|       |
 4345|  4.47M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 4346|       |
 4347|  4.47M|  from_chars_result_t<UC> answer;
 4348|  4.47M|  if (uint64_t(fmt & chars_format::skip_white_space)) {
  ------------------
  |  Branch (4348:7): [True: 0, False: 4.47M]
  ------------------
 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.47M|  if (first == last) {
  ------------------
  |  Branch (4353:7): [True: 1.30k, False: 4.46M]
  ------------------
 4354|  1.30k|    answer.ec = std::errc::invalid_argument;
 4355|  1.30k|    answer.ptr = first;
 4356|  1.30k|    return answer;
 4357|  1.30k|  }
 4358|  4.46M|  parsed_number_string_t<UC> pns =
 4359|  4.46M|      uint64_t(fmt & detail::basic_json_fmt)
  ------------------
  |  Branch (4359:7): [True: 0, False: 4.46M]
  ------------------
 4360|  4.46M|          ? parse_number_string<true, UC>(first, last, options)
 4361|  4.46M|          : parse_number_string<false, UC>(first, last, options);
 4362|  4.46M|  if (!pns.valid) {
  ------------------
  |  Branch (4362:7): [True: 277k, False: 4.19M]
  ------------------
 4363|   277k|    if (uint64_t(fmt & chars_format::no_infnan)) {
  ------------------
  |  Branch (4363:9): [True: 0, False: 277k]
  ------------------
 4364|      0|      answer.ec = std::errc::invalid_argument;
 4365|      0|      answer.ptr = first;
 4366|      0|      return answer;
 4367|   277k|    } else {
 4368|   277k|      return detail::parse_infnan(first, last, value, fmt);
 4369|   277k|    }
 4370|   277k|  }
 4371|       |
 4372|       |  // call overload that takes parsed_number_string_t directly.
 4373|  4.19M|  return from_chars_advanced(pns, value);
 4374|  4.46M|}
_ZN3glz10fast_float6detail25adjust_for_feature_macrosENS0_12chars_formatE:
 1375|  8.93M|constexpr chars_format adjust_for_feature_macros(chars_format fmt) {
 1376|  8.93M|  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.93M|      ;
 1384|  8.93M|}
_ZN3glz10fast_floatanENS0_12chars_formatES1_:
 1340|  30.4M|constexpr chars_format operator&(chars_format lhs, chars_format rhs) noexcept {
 1341|  30.4M|  using int_type = std::underlying_type<chars_format>::type;
 1342|  30.4M|  return static_cast<chars_format>(static_cast<int_type>(lhs) &
 1343|  30.4M|                                   static_cast<int_type>(rhs));
 1344|  30.4M|}
_ZN3glz10fast_float4spanIKcEC2Ev:
  438|  9.49M|  constexpr span() : ptr(nullptr), length(0) {}
_ZN3glz10fast_float18report_parse_errorIcEENS0_22parsed_number_string_tIT_EEPKS3_NS0_11parse_errorE:
 1727|   277k|report_parse_error(UC const *p, parse_error error) {
 1728|   277k|  parsed_number_string_t<UC> answer;
 1729|   277k|  answer.valid = false;
 1730|   277k|  answer.lastmatch = p;
 1731|   277k|  answer.error = error;
 1732|   277k|  return answer;
 1733|   277k|}
_ZN3glz10fast_float10is_integerIcEEbT_:
 1481|   647k|fastfloat_really_inline constexpr bool is_integer(UC c) noexcept {
 1482|   647k|  return !(c > UC('9') || c < UC('0'));
  ------------------
  |  Branch (1482:12): [True: 9.50k, False: 638k]
  |  Branch (1482:27): [True: 7.82k, False: 630k]
  ------------------
 1483|   647k|}
_ZN3glz10fast_float11digit_valueIcEEmT_:
 1489|  19.0M|fastfloat_really_inline constexpr uint64_t digit_value(UC c) noexcept {
 1490|  19.0M|  return uint64_t(uint8_t(c) - uint8_t('0'));
 1491|  19.0M|}
_ZN3glz10fast_float4spanIKcEC2EPS2_m:
  436|  4.72M|  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|   575k|  while ((std::distance(p, pend) >= 8) &&
  ------------------
  |  Branch (1681:10): [True: 346k, False: 228k]
  ------------------
 1682|   346k|         is_made_of_eight_digits_fast(read8_to_u64(p))) {
  ------------------
  |  Branch (1682:10): [True: 314k, False: 32.4k]
  ------------------
 1683|   314k|    i = i * 100000000 +
 1684|   314k|        parse_eight_digits_unrolled(read8_to_u64(
 1685|   314k|            p)); // in rare cases, this will overflow, but that's ok
 1686|   314k|    p += 8;
 1687|   314k|  }
 1688|   260k|}
_ZN3glz10fast_float28is_made_of_eight_digits_fastEm:
 1597|   346k|is_made_of_eight_digits_fast(uint64_t val) noexcept {
 1598|   346k|  return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) &
 1599|   346k|            0x8080808080808080));
 1600|   346k|}
_ZN3glz10fast_float12read8_to_u64IcEEmPKT_:
 1503|   915k|read8_to_u64(UC const *chars) {
 1504|   915k|  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|   915k|  uint64_t val;
 1513|   915k|  ::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|   915k|  return val;
 1519|   915k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledEm:
 1575|   568k|parse_eight_digits_unrolled(uint64_t val) {
 1576|   568k|  uint64_t const mask = 0x000000FF000000FF;
 1577|   568k|  uint64_t const mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
 1578|   568k|  uint64_t const mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
 1579|   568k|  val -= 0x3030303030303030;
 1580|   568k|  val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
 1581|   568k|  val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
 1582|   568k|  return uint32_t(val);
 1583|   568k|}
_ZNK3glz10fast_float4spanIKcE3lenEv:
  440|  92.4k|  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.46M|                    parse_options_t<UC> options) noexcept {
 1741|  4.46M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 1742|  4.46M|  UC const decimal_point = options.decimal_point;
 1743|       |
 1744|  4.46M|  parsed_number_string_t<UC> answer;
 1745|  4.46M|  answer.valid = false;
 1746|  4.46M|  answer.too_many_digits = false;
 1747|       |  // assume p < pend, so dereference without checks;
 1748|  4.46M|  answer.negative = (*p == UC('-'));
 1749|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 1750|  4.46M|  if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (1750:7): [True: 19.8k, False: 4.44M]
  |  Branch (1750:27): [True: 0, False: 4.44M]
  ------------------
 1751|  19.8k|                          !basic_json_fmt && *p == UC('+'))) {
  ------------------
  |  Branch (1751:27): [True: 0, Folded]
  |  Branch (1751:46): [True: 0, False: 0]
  ------------------
 1752|  19.8k|    ++p;
 1753|  19.8k|    if (p == pend) {
  ------------------
  |  Branch (1753:9): [True: 1.31k, False: 18.5k]
  ------------------
 1754|  1.31k|      return report_parse_error<UC>(
 1755|  1.31k|          p, parse_error::missing_integer_or_dot_after_sign);
 1756|  1.31k|    }
 1757|  18.5k|    GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  18.5k|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1758|  18.5k|      if (!is_integer(*p)) { // a sign must be followed by an integer
 1759|  18.5k|        return report_parse_error<UC>(p,
 1760|  18.5k|                                      parse_error::missing_integer_after_sign);
 1761|  18.5k|      }
 1762|  18.5k|    }
 1763|  18.5k|    else {
 1764|  18.5k|      if (!is_integer(*p) &&
  ------------------
  |  Branch (1764:11): [True: 6.03k, False: 12.4k]
  ------------------
 1765|  6.03k|          (*p !=
  ------------------
  |  Branch (1765:11): [True: 1.87k, False: 4.15k]
  ------------------
 1766|  6.03k|           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|  18.5k|    }
 1771|  18.5k|  }
 1772|  4.46M|  UC const *const start_digits = p;
 1773|       |
 1774|  4.46M|  uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad)
 1775|       |
 1776|  4.46M|  uint64_t digit;
 1777|  22.5M|  while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1777:10): [True: 18.8M, False: 3.74M]
  |  Branch (1777:25): [True: 18.1M, False: 719k]
  ------------------
 1778|       |    // a multiplication by 10 is cheaper than an arbitrary integer
 1779|       |    // multiplication
 1780|  18.1M|    i = 10 * i + digit; // might overflow, we will handle the overflow later
 1781|  18.1M|    ++p;
 1782|  18.1M|  }
 1783|  4.46M|  UC const *const end_of_integer_part = p;
 1784|  4.46M|  int64_t digit_count = int64_t(end_of_integer_part - start_digits);
 1785|  4.46M|  answer.integer = span<UC const>(start_digits, size_t(digit_count));
 1786|  4.46M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  4.46M|#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.46M|  int64_t exponent = 0;
 1798|  4.46M|  bool const has_decimal_point = (p != pend) && (*p == decimal_point);
  ------------------
  |  Branch (1798:34): [True: 719k, False: 3.74M]
  |  Branch (1798:49): [True: 260k, False: 458k]
  ------------------
 1799|  4.46M|  if (has_decimal_point) {
  ------------------
  |  Branch (1799:7): [True: 260k, False: 4.20M]
  ------------------
 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|   365k|    while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1806:12): [True: 228k, False: 137k]
  |  Branch (1806:27): [True: 105k, False: 123k]
  ------------------
 1807|   105k|      ++p;
 1808|   105k|      i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
 1809|   105k|    }
 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.46M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  4.46M|#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.46M|  else if (digit_count == 0) { // we must have encountered at least one integer!
  ------------------
  |  Branch (1821:12): [True: 273k, False: 4.19M]
  ------------------
 1822|   273k|    return report_parse_error<UC>(p, parse_error::no_digits_in_mantissa);
 1823|   273k|  }
 1824|  4.19M|  int64_t exp_number = 0; // explicit exponential part
 1825|  4.46M|  if ((uint64_t(fmt & chars_format::scientific) && (p != pend) &&
  ------------------
  |  Branch (1825:8): [True: 4.19M, False: 275k]
  |  Branch (1825:52): [True: 407k, False: 3.78M]
  ------------------
 1826|   407k|       ((UC('e') == *p) || (UC('E') == *p))) ||
  ------------------
  |  Branch (1826:9): [True: 7.13k, False: 400k]
  |  Branch (1826:28): [True: 73.5k, False: 327k]
  ------------------
 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|  80.7k|        (UC('D') == *p)))) {
  ------------------
  |  Branch (1829:9): [True: 0, False: 0]
  ------------------
 1830|  80.7k|    UC const *location_of_e = p;
 1831|  80.7k|    if ((UC('e') == *p) || (UC('E') == *p) || (UC('d') == *p) ||
  ------------------
  |  Branch (1831:9): [True: 7.13k, False: 73.5k]
  |  Branch (1831:28): [True: 73.5k, False: 0]
  |  Branch (1831:47): [True: 0, False: 0]
  ------------------
 1832|  80.7k|        (UC('D') == *p)) {
  ------------------
  |  Branch (1832:9): [True: 0, False: 0]
  ------------------
 1833|  80.7k|      ++p;
 1834|  80.7k|    }
 1835|  80.7k|    bool neg_exp = false;
 1836|  80.7k|    if ((p != pend) && (UC('-') == *p)) {
  ------------------
  |  Branch (1836:9): [True: 79.7k, False: 996]
  |  Branch (1836:24): [True: 6.24k, False: 73.4k]
  ------------------
 1837|  6.24k|      neg_exp = true;
 1838|  6.24k|      ++p;
 1839|  74.4k|    } else if ((p != pend) &&
  ------------------
  |  Branch (1839:16): [True: 73.4k, False: 996]
  ------------------
 1840|  73.4k|               (UC('+') ==
  ------------------
  |  Branch (1840:16): [True: 646, False: 72.8k]
  ------------------
 1841|  73.4k|                *p)) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
 1842|    646|      ++p;
 1843|    646|    }
 1844|  80.7k|    if ((p == pend) || !is_integer(*p)) {
  ------------------
  |  Branch (1844:9): [True: 1.51k, False: 79.2k]
  |  Branch (1844:24): [True: 2.70k, False: 76.4k]
  ------------------
 1845|  4.22k|      if (!uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 4.22k]
  ------------------
 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|  4.22k|      p = location_of_e;
 1853|  76.4k|    } else {
 1854|   617k|      while ((p != pend) && is_integer(*p)) {
  ------------------
  |  Branch (1854:14): [True: 550k, False: 67.9k]
  |  Branch (1854:29): [True: 541k, False: 8.59k]
  ------------------
 1855|   541k|        uint8_t exp_digit = uint8_t(*p - UC('0'));
 1856|   541k|        if (exp_number < 0x10000000) {
  ------------------
  |  Branch (1856:13): [True: 176k, False: 364k]
  ------------------
 1857|   176k|          exp_number = 10 * exp_number + exp_digit;
 1858|   176k|        }
 1859|   541k|        ++p;
 1860|   541k|      }
 1861|  76.4k|      if (neg_exp) {
  ------------------
  |  Branch (1861:11): [True: 5.96k, False: 70.5k]
  ------------------
 1862|  5.96k|        exp_number = -exp_number;
 1863|  5.96k|      }
 1864|  76.4k|      exponent += exp_number;
 1865|  76.4k|    }
 1866|  4.38M|  } else {
 1867|       |    // If it scientific and not fixed, we have to bail out.
 1868|  4.38M|    if (uint64_t(fmt & chars_format::scientific) &&
  ------------------
  |  Branch (1868:9): [True: 4.11M, False: 275k]
  ------------------
 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.38M|  }
 1873|  4.46M|  answer.lastmatch = p;
 1874|  4.46M|  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.46M|  if (digit_count > 19) { // this is uncommon
  ------------------
  |  Branch (1881:7): [True: 64.4k, False: 4.40M]
  ------------------
 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|  64.4k|    UC const *start = start_digits;
 1887|  11.5M|    while ((start != pend) && (*start == UC('0') || *start == decimal_point)) {
  ------------------
  |  Branch (1887:12): [True: 11.5M, False: 700]
  |  Branch (1887:32): [True: 11.4M, False: 93.1k]
  |  Branch (1887:53): [True: 29.4k, False: 63.7k]
  ------------------
 1888|  11.5M|      if (*start == UC('0')) {
  ------------------
  |  Branch (1888:11): [True: 11.4M, False: 29.4k]
  ------------------
 1889|  11.4M|        digit_count--;
 1890|  11.4M|      }
 1891|  11.5M|      start++;
 1892|  11.5M|    }
 1893|       |
 1894|  64.4k|    if (digit_count > 19) {
  ------------------
  |  Branch (1894:9): [True: 60.9k, False: 3.50k]
  ------------------
 1895|  60.9k|      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|  60.9k|      i = 0;
 1900|  60.9k|      p = answer.integer.ptr;
 1901|  60.9k|      UC const *int_end = p + answer.integer.len();
 1902|  60.9k|      uint64_t const minimal_nineteen_digit_integer{1000000000000000000};
 1903|  1.17M|      while ((i < minimal_nineteen_digit_integer) && (p != int_end)) {
  ------------------
  |  Branch (1903:14): [True: 1.12M, False: 50.4k]
  |  Branch (1903:54): [True: 1.11M, False: 10.4k]
  ------------------
 1904|  1.11M|        i = i * 10 + uint64_t(*p - UC('0'));
 1905|  1.11M|        ++p;
 1906|  1.11M|      }
 1907|  60.9k|      if (i >= minimal_nineteen_digit_integer) { // We have a big integers
  ------------------
  |  Branch (1907:11): [True: 50.4k, False: 10.4k]
  ------------------
 1908|  50.4k|        exponent = end_of_integer_part - p + exp_number;
 1909|  50.4k|      } else { // We have a value with a fractional component.
 1910|  10.4k|        p = answer.fraction.ptr;
 1911|  10.4k|        UC const *frac_end = p + answer.fraction.len();
 1912|   149k|        while ((i < minimal_nineteen_digit_integer) && (p != frac_end)) {
  ------------------
  |  Branch (1912:16): [True: 139k, False: 10.4k]
  |  Branch (1912:56): [True: 139k, False: 0]
  ------------------
 1913|   139k|          i = i * 10 + uint64_t(*p - UC('0'));
 1914|   139k|          ++p;
 1915|   139k|        }
 1916|  10.4k|        exponent = answer.fraction.ptr - p + exp_number;
 1917|  10.4k|      }
 1918|       |      // We have now corrected both exponent and i, to a truncated value
 1919|  60.9k|    }
 1920|  64.4k|  }
 1921|  4.46M|  answer.exponent = exponent;
 1922|  4.46M|  answer.mantissa = i;
 1923|  4.46M|  return answer;
 1924|  4.46M|}
_ZN3glz10fast_float6detail12parse_infnanIdcEENS0_19from_chars_result_tIT0_EEPKS4_S7_RT_NS0_12chars_formatE:
 4076|   277k|                                       T &value, chars_format fmt) noexcept {
 4077|   277k|  from_chars_result_t<UC> answer{};
 4078|   277k|  answer.ptr = first;
 4079|   277k|  answer.ec = std::errc(); // be optimistic
 4080|       |  // assume first < last, so dereference without checks;
 4081|   277k|  bool const minusSign = (*first == UC('-'));
 4082|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 4083|   277k|  if ((*first == UC('-')) ||
  ------------------
  |  Branch (4083:7): [True: 4.09k, False: 273k]
  ------------------
 4084|   273k|      (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (4084:8): [True: 0, False: 273k]
  ------------------
 4085|  4.09k|       (*first == UC('+')))) {
  ------------------
  |  Branch (4085:8): [True: 0, False: 0]
  ------------------
 4086|  4.09k|    ++first;
 4087|  4.09k|  }
 4088|   277k|  if (last - first >= 3) {
  ------------------
  |  Branch (4088:7): [True: 122k, False: 155k]
  ------------------
 4089|   122k|    if (fastfloat_strncasecmp(first, str_const_nan<UC>(), 3)) {
  ------------------
  |  Branch (4089:9): [True: 15.2k, False: 106k]
  ------------------
 4090|  15.2k|      answer.ptr = (first += 3);
 4091|  15.2k|      value = minusSign ? -std::numeric_limits<T>::quiet_NaN()
  ------------------
  |  Branch (4091:15): [True: 66, False: 15.2k]
  ------------------
 4092|  15.2k|                        : 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.2k|      if (first != last && *first == UC('(')) {
  ------------------
  |  Branch (4095:11): [True: 14.8k, False: 436]
  |  Branch (4095:28): [True: 14.3k, False: 472]
  ------------------
 4096|  66.1k|        for (UC const *ptr = first + 1; ptr != last; ++ptr) {
  ------------------
  |  Branch (4096:41): [True: 64.9k, False: 1.13k]
  ------------------
 4097|  64.9k|          if (*ptr == UC(')')) {
  ------------------
  |  Branch (4097:15): [True: 478, False: 64.5k]
  ------------------
 4098|    478|            answer.ptr = ptr + 1; // valid nan(n-char-seq-opt)
 4099|    478|            break;
 4100|  64.5k|          } else if (!((UC('a') <= *ptr && *ptr <= UC('z')) ||
  ------------------
  |  Branch (4100:25): [True: 872, False: 63.6k]
  |  Branch (4100:44): [True: 678, False: 194]
  ------------------
 4101|  63.8k|                       (UC('A') <= *ptr && *ptr <= UC('Z')) ||
  ------------------
  |  Branch (4101:25): [True: 51.0k, False: 12.8k]
  |  Branch (4101:44): [True: 50.8k, False: 208]
  ------------------
 4102|  13.0k|                       (UC('0') <= *ptr && *ptr <= UC('9')) || *ptr == UC('_')))
  ------------------
  |  Branch (4102:25): [True: 1.00k, False: 12.0k]
  |  Branch (4102:44): [True: 274, False: 728]
  |  Branch (4102:64): [True: 0, False: 12.7k]
  ------------------
 4103|  12.7k|            break; // forbidden char, not nan(n-char-seq-opt)
 4104|  64.9k|        }
 4105|  14.3k|      }
 4106|  15.2k|      return answer;
 4107|  15.2k|    }
 4108|   106k|    if (fastfloat_strncasecmp(first, str_const_inf<UC>(), 3)) {
  ------------------
  |  Branch (4108:9): [True: 20.7k, False: 86.0k]
  ------------------
 4109|  20.7k|      if ((last - first >= 8) &&
  ------------------
  |  Branch (4109:11): [True: 19.2k, False: 1.53k]
  ------------------
 4110|  19.2k|          fastfloat_strncasecmp(first + 3, str_const_inf<UC>() + 3, 5)) {
  ------------------
  |  Branch (4110:11): [True: 222, False: 19.0k]
  ------------------
 4111|    222|        answer.ptr = first + 8;
 4112|  20.5k|      } else {
 4113|  20.5k|        answer.ptr = first + 3;
 4114|  20.5k|      }
 4115|  20.7k|      value = minusSign ? -std::numeric_limits<T>::infinity()
  ------------------
  |  Branch (4115:15): [True: 996, False: 19.7k]
  ------------------
 4116|  20.7k|                        : std::numeric_limits<T>::infinity();
 4117|  20.7k|      return answer;
 4118|  20.7k|    }
 4119|   106k|  }
 4120|   241k|  answer.ec = std::errc::invalid_argument;
 4121|   241k|  return answer;
 4122|   277k|}
_ZN3glz10fast_float21fastfloat_strncasecmpIcEEbPKT_S4_m:
  417|   248k|                      size_t length) {
  418|   359k|  for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (418:22): [True: 323k, False: 36.2k]
  ------------------
  419|   323k|    UC const actual = actual_mixedcase[i];
  420|   323k|    if ((actual < 256 ? actual | 32 : actual) != expected_lowercase[i]) {
  ------------------
  |  Branch (420:9): [True: 212k, False: 111k]
  |  Branch (420:10): [True: 323k, False: 0]
  ------------------
  421|   212k|      return false;
  422|   212k|    }
  423|   323k|  }
  424|  36.2k|  return true;
  425|   248k|}
_ZN3glz10fast_float13str_const_nanIcEEPKT_v:
 1186|   122k|template <> constexpr char const *str_const_nan<char>() { return "nan"; }
_ZN3glz10fast_float13str_const_infIcEEPKT_v:
 1206|   126k|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.19M|from_chars_advanced(parsed_number_string_t<UC> &pns, T &value) noexcept {
 4250|       |
 4251|  4.19M|  static_assert(is_supported_float_type<T>::value,
 4252|  4.19M|                "only some floating-point types are supported");
 4253|  4.19M|  static_assert(is_supported_char_type<UC>::value,
 4254|  4.19M|                "only char, wchar_t, char16_t and char32_t are supported");
 4255|       |
 4256|  4.19M|  from_chars_result_t<UC> answer;
 4257|       |
 4258|  4.19M|  answer.ec = std::errc(); // be optimistic
 4259|  4.19M|  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.19M|  if (binary_format<T>::min_exponent_fast_path() <= pns.exponent &&
  ------------------
  |  Branch (4265:7): [True: 4.18M, False: 6.84k]
  ------------------
 4266|  4.18M|      pns.exponent <= binary_format<T>::max_exponent_fast_path() &&
  ------------------
  |  Branch (4266:7): [True: 4.11M, False: 69.3k]
  ------------------
 4267|  4.11M|      !pns.too_many_digits) {
  ------------------
  |  Branch (4267:7): [True: 4.06M, False: 54.4k]
  ------------------
 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.03M, False: 26.0k]
  ------------------
 4279|  4.03M|        value = T(pns.mantissa);
 4280|  4.03M|        if (pns.exponent < 0) {
  ------------------
  |  Branch (4280:13): [True: 38.4k, False: 3.99M]
  ------------------
 4281|  38.4k|          value = value / binary_format<T>::exact_power_of_ten(-pns.exponent);
 4282|  3.99M|        } else {
 4283|  3.99M|          value = value * binary_format<T>::exact_power_of_ten(pns.exponent);
 4284|  3.99M|        }
 4285|  4.03M|        if (pns.negative) {
  ------------------
  |  Branch (4285:13): [True: 13.1k, False: 4.02M]
  ------------------
 4286|  13.1k|          value = -value;
 4287|  13.1k|        }
 4288|  4.03M|        return answer;
 4289|  4.03M|      }
 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|   156k|  adjusted_mantissa am =
 4314|   156k|      compute_float<binary_format<T>>(pns.exponent, pns.mantissa);
 4315|   156k|  if (pns.too_many_digits && am.power2 >= 0) {
  ------------------
  |  Branch (4315:7): [True: 60.9k, False: 95.7k]
  |  Branch (4315:30): [True: 60.9k, False: 0]
  ------------------
 4316|  60.9k|    if (am != compute_float<binary_format<T>>(pns.exponent, pns.mantissa + 1)) {
  ------------------
  |  Branch (4316:9): [True: 12.8k, False: 48.1k]
  ------------------
 4317|  12.8k|      am = compute_error<binary_format<T>>(pns.exponent, pns.mantissa);
 4318|  12.8k|    }
 4319|  60.9k|  }
 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|   156k|  if (am.power2 < 0) {
  ------------------
  |  Branch (4323:7): [True: 12.8k, False: 143k]
  ------------------
 4324|  12.8k|    am = digit_comp<T>(pns, am);
 4325|  12.8k|  }
 4326|   156k|  to_float(pns.negative, am, value);
 4327|       |  // Test for over/underflow.
 4328|   156k|  if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) ||
  ------------------
  |  Branch (4328:8): [True: 155k, False: 1.51k]
  |  Branch (4328:29): [True: 6.80k, False: 148k]
  |  Branch (4328:49): [True: 2.09k, False: 4.71k]
  ------------------
 4329|   154k|      am.power2 == binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (4329:7): [True: 2.90k, False: 151k]
  ------------------
 4330|  5.00k|    answer.ec = std::errc::result_out_of_range;
 4331|  5.00k|  }
 4332|   156k|  return answer;
 4333|  4.19M|}
_ZN3glz10fast_float13binary_formatIdE22min_exponent_fast_pathEv:
  695|  4.19M|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.19M|  return -22;
  700|  4.19M|#endif
  701|  4.19M|}
_ZN3glz10fast_float13binary_formatIdE22max_exponent_fast_pathEv:
  767|  4.18M|inline constexpr int binary_format<double>::max_exponent_fast_path() {
  768|  4.18M|  return 22;
  769|  4.18M|}
_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.94M|inline constexpr int binary_format<double>::mantissa_explicit_bits() {
  714|  4.94M|  return 52;
  715|  4.94M|}
_ZN3glz10fast_float13binary_formatIdE18exact_power_of_tenEl:
 1057|  4.03M|binary_format<double>::exact_power_of_ten(int64_t power) {
 1058|       |  // Work around clang bug https://godbolt.org/z/zedh7rrhc
 1059|  4.03M|  return (void)powers_of_ten[0], powers_of_ten[power];
 1060|  4.03M|}
_ZN3glz10fast_float13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2852|   217k|compute_float(int64_t q, uint64_t w) noexcept {
 2853|   217k|  adjusted_mantissa answer;
 2854|   217k|  if ((w == 0) || (q < binary::smallest_power_of_ten())) {
  ------------------
  |  Branch (2854:7): [True: 1.51k, False: 216k]
  |  Branch (2854:19): [True: 3.10k, False: 213k]
  ------------------
 2855|  4.62k|    answer.power2 = 0;
 2856|  4.62k|    answer.mantissa = 0;
 2857|       |    // result should be zero
 2858|  4.62k|    return answer;
 2859|  4.62k|  }
 2860|   213k|  if (q > binary::largest_power_of_ten()) {
  ------------------
  |  Branch (2860:7): [True: 3.49k, False: 209k]
  ------------------
 2861|       |    // we want to get infinity:
 2862|  3.49k|    answer.power2 = binary::infinite_power();
 2863|  3.49k|    answer.mantissa = 0;
 2864|  3.49k|    return answer;
 2865|  3.49k|  }
 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|   209k|  int lz = leading_zeroes(w);
 2871|   209k|  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|   209k|  value128 product =
 2880|   209k|      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|   209k|  int upperbit = int(product.high >> 63);
 2891|   209k|  int shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
 2892|       |
 2893|   209k|  answer.mantissa = product.high >> shift;
 2894|       |
 2895|   209k|  answer.power2 = int32_t(detail::power(int32_t(q)) + upperbit - lz -
 2896|   209k|                          binary::minimum_exponent());
 2897|   209k|  if (answer.power2 <= 0) { // we have a subnormal?
  ------------------
  |  Branch (2897:7): [True: 4.57k, False: 204k]
  ------------------
 2898|       |    // Here have that answer.power2 <= 0 so -answer.power2 >= 0
 2899|  4.57k|    if (-answer.power2 + 1 >=
  ------------------
  |  Branch (2899:9): [True: 286, False: 4.28k]
  ------------------
 2900|  4.57k|        64) { // if we have more than 64 bits below the minimum exponent, you
 2901|       |              // have a zero for sure.
 2902|    286|      answer.power2 = 0;
 2903|    286|      answer.mantissa = 0;
 2904|       |      // result should be zero
 2905|    286|      return answer;
 2906|    286|    }
 2907|       |    // next line is safe because -answer.power2 + 1 < 64
 2908|  4.28k|    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.28k|    answer.mantissa += (answer.mantissa & 1); // round up
 2913|  4.28k|    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.28k|    answer.power2 =
 2922|  4.28k|        (answer.mantissa < (uint64_t(1) << binary::mantissa_explicit_bits()))
  ------------------
  |  Branch (2922:9): [True: 4.28k, False: 4]
  ------------------
 2923|  4.28k|            ? 0
 2924|  4.28k|            : 1;
 2925|  4.28k|    return answer;
 2926|  4.57k|  }
 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|   204k|  if ((product.low <= 1) && (q >= binary::min_exponent_round_to_even()) &&
  ------------------
  |  Branch (2931:7): [True: 167k, False: 37.1k]
  |  Branch (2931:29): [True: 166k, False: 802]
  ------------------
 2932|   166k|      (q <= binary::max_exponent_round_to_even()) &&
  ------------------
  |  Branch (2932:7): [True: 164k, False: 2.84k]
  ------------------
 2933|   164k|      ((answer.mantissa & 3) == 1)) { // we may fall between two floats!
  ------------------
  |  Branch (2933:7): [True: 61.0k, False: 103k]
  ------------------
 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|  61.0k|    if ((answer.mantissa << shift) == product.high) {
  ------------------
  |  Branch (2939:9): [True: 57.3k, False: 3.75k]
  ------------------
 2940|  57.3k|      answer.mantissa &= ~uint64_t(1); // flip it so that we do not round up
 2941|  57.3k|    }
 2942|  61.0k|  }
 2943|       |
 2944|   204k|  answer.mantissa += (answer.mantissa & 1); // round up
 2945|   204k|  answer.mantissa >>= 1;
 2946|   204k|  if (answer.mantissa >= (uint64_t(2) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (2946:7): [True: 1.76k, False: 203k]
  ------------------
 2947|  1.76k|    answer.mantissa = (uint64_t(1) << binary::mantissa_explicit_bits());
 2948|  1.76k|    answer.power2++; // undo previous addition
 2949|  1.76k|  }
 2950|       |
 2951|   204k|  answer.mantissa &= ~(uint64_t(1) << binary::mantissa_explicit_bits());
 2952|   204k|  if (answer.power2 >= binary::infinite_power()) { // infinity
  ------------------
  |  Branch (2952:7): [True: 474, False: 204k]
  ------------------
 2953|    474|    answer.power2 = binary::infinite_power();
 2954|    474|    answer.mantissa = 0;
 2955|    474|  }
 2956|   204k|  return answer;
 2957|   209k|}
_ZN3glz10fast_float17adjusted_mantissaC2Ev:
  568|   243k|  adjusted_mantissa() = default;
_ZN3glz10fast_float13binary_formatIdE21smallest_power_of_tenEv:
 1077|   216k|inline constexpr int binary_format<double>::smallest_power_of_ten() {
 1078|   216k|  return -342;
 1079|   216k|}
_ZN3glz10fast_float13binary_formatIdE20largest_power_of_tenEv:
 1068|   213k|template <> inline constexpr int binary_format<double>::largest_power_of_ten() {
 1069|   213k|  return 308;
 1070|   213k|}
_ZN3glz10fast_float14leading_zeroesEm:
  488|   232k|leading_zeroes(uint64_t input_num) {
  489|   232k|  assert(input_num > 0);
  ------------------
  |  Branch (489:3): [True: 232k, False: 0]
  ------------------
  490|   232k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (490:7): [Folded, False: 232k]
  ------------------
  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|   232k|  return __builtin_clzll(input_num);
  505|   232k|#endif
  506|   232k|}
_ZN3glz10fast_float29compute_product_approximationILi55EEENS0_8value128Elm:
 2771|   222k|compute_product_approximation(int64_t q, uint64_t w) {
 2772|   222k|  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|   222k|  value128 firstproduct =
 2777|   222k|      full_multiplication(w, powers::power_of_five_128[index]);
 2778|   222k|  static_assert((bit_precision >= 0) && (bit_precision <= 64),
 2779|   222k|                " precision should  be in (0,64]");
 2780|   222k|  constexpr uint64_t precision_mask =
 2781|   222k|      (bit_precision < 64) ? (uint64_t(0xFFFFFFFFFFFFFFFF) >> bit_precision)
  ------------------
  |  Branch (2781:7): [True: 0, Folded]
  ------------------
 2782|   222k|                           : uint64_t(0xFFFFFFFFFFFFFFFF);
 2783|   222k|  if ((firstproduct.high & precision_mask) ==
  ------------------
  |  Branch (2783:7): [True: 15.5k, False: 206k]
  ------------------
 2784|   222k|      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.5k|    value128 secondproduct =
 2789|  15.5k|        full_multiplication(w, powers::power_of_five_128[index + 1]);
 2790|  15.5k|    firstproduct.low += secondproduct.high;
 2791|  15.5k|    if (secondproduct.high > firstproduct.low) {
  ------------------
  |  Branch (2791:9): [True: 4.99k, False: 10.5k]
  ------------------
 2792|  4.99k|      firstproduct.high++;
 2793|  4.99k|    }
 2794|  15.5k|  }
 2795|   222k|  return firstproduct;
 2796|   222k|}
_ZN3glz10fast_float19full_multiplicationEmm:
  540|   237k|full_multiplication(uint64_t a, uint64_t b) {
  541|   237k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (541:7): [Folded, False: 237k]
  ------------------
  542|      0|    value128 answer;
  543|      0|    answer.low = umul128_generic(a, b, &answer.high);
  544|      0|    return answer;
  545|      0|  }
  546|   237k|  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|   237k|  answer.low = uint64_t(r);
  558|   237k|  answer.high = uint64_t(r >> 64);
  559|       |#else
  560|       |  answer.low = umul128_generic(a, b, &answer.high);
  561|       |#endif
  562|   237k|  return answer;
  563|   237k|}
_ZN3glz10fast_float8value128C2Ev:
  454|   237k|  constexpr value128() : low(0), high(0) {}
_ZN3glz10fast_float6detail5powerEi:
 2814|   222k|constexpr fastfloat_really_inline int32_t power(int32_t q) noexcept {
 2815|   222k|  return (((152170 + 65536) * q) >> 16) + 63;
 2816|   222k|}
_ZN3glz10fast_float13binary_formatIdE16minimum_exponentEv:
  742|   235k|template <> inline constexpr int binary_format<double>::minimum_exponent() {
  743|   235k|  return -1023;
  744|   235k|}
_ZN3glz10fast_float13binary_formatIdE26min_exponent_round_to_evenEv:
  733|   167k|inline constexpr int binary_format<double>::min_exponent_round_to_even() {
  734|   167k|  return -4;
  735|   167k|}
_ZN3glz10fast_float13binary_formatIdE26max_exponent_round_to_evenEv:
  723|   166k|inline constexpr int binary_format<double>::max_exponent_round_to_even() {
  724|   166k|  return 23;
  725|   166k|}
_ZNK3glz10fast_float17adjusted_mantissaneERKS1_:
  574|  60.9k|  constexpr bool operator!=(adjusted_mantissa const &o) const {
  575|  60.9k|    return mantissa != o.mantissa || power2 != o.power2;
  ------------------
  |  Branch (575:12): [True: 12.8k, False: 48.1k]
  |  Branch (575:38): [True: 0, False: 48.1k]
  ------------------
  576|  60.9k|  }
_ZN3glz10fast_float13compute_errorINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2837|  12.8k|compute_error(int64_t q, uint64_t w) noexcept {
 2838|  12.8k|  int lz = leading_zeroes(w);
 2839|  12.8k|  w <<= lz;
 2840|  12.8k|  value128 product =
 2841|  12.8k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2842|  12.8k|  return compute_error_scaled<binary>(q, product.high, lz);
 2843|  12.8k|}
_ZN3glz10fast_float20compute_error_scaledINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElmi:
 2823|  12.8k|compute_error_scaled(int64_t q, uint64_t w, int lz) noexcept {
 2824|  12.8k|  int hilz = int(w >> 63) ^ 1;
 2825|  12.8k|  adjusted_mantissa answer;
 2826|  12.8k|  answer.mantissa = w << hilz;
 2827|  12.8k|  int bias = binary::mantissa_explicit_bits() - binary::minimum_exponent();
 2828|  12.8k|  answer.power2 = int32_t(detail::power(int32_t(q)) + bias - hilz - lz - 62 +
 2829|  12.8k|                          invalid_am_bias);
 2830|  12.8k|  return answer;
 2831|  12.8k|}
_ZN3glz10fast_float10digit_compIdcEENS0_17adjusted_mantissaERNS0_22parsed_number_string_tIT0_EES2_:
 4034|  12.8k|digit_comp(parsed_number_string_t<UC> &num, adjusted_mantissa am) noexcept {
 4035|       |  // remove the invalid exponent bias
 4036|  12.8k|  am.power2 -= invalid_am_bias;
 4037|       |
 4038|  12.8k|  int32_t sci_exp = scientific_exponent(num);
 4039|  12.8k|  size_t max_digits = binary_format<T>::max_digits();
 4040|  12.8k|  size_t digits = 0;
 4041|  12.8k|  bigint bigmant;
 4042|  12.8k|  parse_mantissa(bigmant, num, max_digits, digits);
 4043|       |  // can't underflow, since digits is at most max_digits.
 4044|  12.8k|  int32_t exponent = sci_exp + 1 - int32_t(digits);
 4045|  12.8k|  if (exponent >= 0) {
  ------------------
  |  Branch (4045:7): [True: 5.17k, False: 7.66k]
  ------------------
 4046|  5.17k|    return positive_digit_comp<T>(bigmant, exponent);
 4047|  7.66k|  } else {
 4048|  7.66k|    return negative_digit_comp<T>(bigmant, am, exponent);
 4049|  7.66k|  }
 4050|  12.8k|}
_ZN3glz10fast_float19scientific_exponentIcEEiRNS0_22parsed_number_string_tIT_EE:
 3640|  12.8k|scientific_exponent(parsed_number_string_t<UC> &num) noexcept {
 3641|  12.8k|  uint64_t mantissa = num.mantissa;
 3642|  12.8k|  int32_t exponent = int32_t(num.exponent);
 3643|  64.1k|  while (mantissa >= 10000) {
  ------------------
  |  Branch (3643:10): [True: 51.3k, False: 12.8k]
  ------------------
 3644|  51.3k|    mantissa /= 10000;
 3645|  51.3k|    exponent += 4;
 3646|  51.3k|  }
 3647|  25.6k|  while (mantissa >= 100) {
  ------------------
  |  Branch (3647:10): [True: 12.8k, False: 12.8k]
  ------------------
 3648|  12.8k|    mantissa /= 100;
 3649|  12.8k|    exponent += 2;
 3650|  12.8k|  }
 3651|  12.8k|  while (mantissa >= 10) {
  ------------------
  |  Branch (3651:10): [True: 0, False: 12.8k]
  ------------------
 3652|      0|    mantissa /= 10;
 3653|      0|    exponent += 1;
 3654|      0|  }
 3655|  12.8k|  return exponent;
 3656|  12.8k|}
_ZN3glz10fast_float13binary_formatIdE10max_digitsEv:
 1085|  12.8k|template <> inline constexpr size_t binary_format<double>::max_digits() {
 1086|  12.8k|  return 769;
 1087|  12.8k|}
_ZN3glz10fast_float6bigintC2Ev:
 3399|  12.8k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint() : vec() {}
_ZN3glz10fast_float8stackvecILt62EEC2Ev:
 3006|  83.0k|  stackvec() = default;
_ZN3glz10fast_float14parse_mantissaIcEEvRNS0_6bigintERNS0_22parsed_number_string_tIT_EEmRm:
 3859|  12.8k|               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.8k|  size_t counter = 0;
 3864|  12.8k|  digits = 0;
 3865|  12.8k|  limb value = 0;
 3866|  12.8k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3867|  12.8k|  size_t step = 19;
 3868|       |#else
 3869|       |  size_t step = 9;
 3870|       |#endif
 3871|       |
 3872|       |  // process all integer digits.
 3873|  12.8k|  UC const *p = num.integer.ptr;
 3874|  12.8k|  UC const *pend = p + num.integer.len();
 3875|  12.8k|  skip_zeros(p, pend);
 3876|       |  // process all digits, in increments of step per loop
 3877|  32.1k|  while (p != pend) {
  ------------------
  |  Branch (3877:10): [True: 19.3k, False: 12.8k]
  ------------------
 3878|  39.6k|    while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3878:12): [True: 24.0k, False: 15.6k]
  |  Branch (3878:45): [True: 20.3k, False: 3.65k]
  ------------------
 3879|  20.3k|           (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3879:12): [True: 20.3k, False: 0]
  ------------------
 3880|  20.3k|      parse_eight_digits(p, value, counter, digits);
 3881|  20.3k|    }
 3882|  64.0k|    while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3882:12): [True: 56.5k, False: 7.49k]
  |  Branch (3882:30): [True: 44.7k, False: 11.8k]
  |  Branch (3882:43): [True: 44.7k, False: 0]
  ------------------
 3883|  44.7k|      parse_one_digit(p, value, counter, digits);
 3884|  44.7k|    }
 3885|  19.3k|    if (digits == max_digits) {
  ------------------
  |  Branch (3885:9): [True: 0, False: 19.3k]
  ------------------
 3886|       |      // add the temporary value, then check if we've truncated any digits
 3887|      0|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3888|      0|      bool truncated = is_truncated(p, pend);
 3889|      0|      if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3889:11): [True: 0, False: 0]
  ------------------
 3890|      0|        truncated |= is_truncated(num.fraction);
 3891|      0|      }
 3892|      0|      if (truncated) {
  ------------------
  |  Branch (3892:11): [True: 0, False: 0]
  ------------------
 3893|      0|        round_up_bigint(result, digits);
 3894|      0|      }
 3895|      0|      return;
 3896|  19.3k|    } else {
 3897|  19.3k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3898|  19.3k|      counter = 0;
 3899|  19.3k|      value = 0;
 3900|  19.3k|    }
 3901|  19.3k|  }
 3902|       |
 3903|       |  // add our fraction digits, if they're available.
 3904|  12.8k|  if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3904:7): [True: 8.19k, False: 4.64k]
  ------------------
 3905|  8.19k|    p = num.fraction.ptr;
 3906|  8.19k|    pend = p + num.fraction.len();
 3907|  8.19k|    if (digits == 0) {
  ------------------
  |  Branch (3907:9): [True: 992, False: 7.20k]
  ------------------
 3908|    992|      skip_zeros(p, pend);
 3909|    992|    }
 3910|       |    // process all digits, in increments of step per loop
 3911|   127k|    while (p != pend) {
  ------------------
  |  Branch (3911:12): [True: 121k, False: 5.58k]
  ------------------
 3912|   355k|      while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3912:14): [True: 347k, False: 7.55k]
  |  Branch (3912:47): [True: 235k, False: 112k]
  ------------------
 3913|   235k|             (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3913:14): [True: 233k, False: 1.44k]
  ------------------
 3914|   233k|        parse_eight_digits(p, value, counter, digits);
 3915|   233k|      }
 3916|   480k|      while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3916:14): [True: 366k, False: 114k]
  |  Branch (3916:32): [True: 361k, False: 4.92k]
  |  Branch (3916:45): [True: 358k, False: 2.40k]
  ------------------
 3917|   358k|        parse_one_digit(p, value, counter, digits);
 3918|   358k|      }
 3919|   121k|      if (digits == max_digits) {
  ------------------
  |  Branch (3919:11): [True: 2.61k, False: 119k]
  ------------------
 3920|       |        // add the temporary value, then check if we've truncated any digits
 3921|  2.61k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3922|  2.61k|        bool truncated = is_truncated(p, pend);
 3923|  2.61k|        if (truncated) {
  ------------------
  |  Branch (3923:13): [True: 1.83k, False: 778]
  ------------------
 3924|  1.83k|          round_up_bigint(result, digits);
 3925|  1.83k|        }
 3926|  2.61k|        return;
 3927|   119k|      } else {
 3928|   119k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3929|   119k|        counter = 0;
 3930|   119k|        value = 0;
 3931|   119k|      }
 3932|   121k|    }
 3933|  8.19k|  }
 3934|       |
 3935|  10.2k|  if (counter != 0) {
  ------------------
  |  Branch (3935:7): [True: 0, False: 10.2k]
  ------------------
 3936|      0|    add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3937|      0|  }
 3938|  10.2k|}
_ZN3glz10fast_float10skip_zerosIcEEvRPKT_S4_:
 3773|  13.8k|skip_zeros(UC const *&first, UC const *last) noexcept {
 3774|  13.8k|  uint64_t val;
 3775|  17.8k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3775:10): [True: 17.8k, Folded]
  ------------------
 3776|  17.8k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3776:10): [True: 13.2k, False: 4.52k]
  ------------------
 3777|  13.2k|    ::memcpy(&val, first, sizeof(uint64_t));
 3778|  13.2k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3778:9): [True: 9.30k, False: 3.98k]
  ------------------
 3779|  9.30k|      break;
 3780|  9.30k|    }
 3781|  3.98k|    first += int_cmp_len<UC>();
 3782|  3.98k|  }
 3783|  23.3k|  while (first != last) {
  ------------------
  |  Branch (3783:10): [True: 22.3k, False: 992]
  ------------------
 3784|  22.3k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3784:9): [True: 12.8k, False: 9.51k]
  ------------------
 3785|  12.8k|      break;
 3786|  12.8k|    }
 3787|  9.51k|    first++;
 3788|  9.51k|  }
 3789|  13.8k|}
_ZN3glz10fast_float11int_cmp_lenIcEEiv:
 1180|  31.6k|template <typename UC> constexpr int int_cmp_len() {
 1181|  31.6k|  return sizeof(uint64_t) / sizeof(UC);
 1182|  31.6k|}
_ZN3glz10fast_float13int_cmp_zerosIcEEmv:
 1170|  17.8k|template <typename UC> constexpr uint64_t int_cmp_zeros() {
 1171|  17.8k|  static_assert((sizeof(UC) == 1) || (sizeof(UC) == 2) || (sizeof(UC) == 4),
 1172|  17.8k|                "Unsupported character size");
 1173|  17.8k|  return (sizeof(UC) == 1) ? 0x3030303030303030
  ------------------
  |  Branch (1173:10): [True: 17.8k, Folded]
  ------------------
 1174|  17.8k|         : (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.8k|}
_ZN3glz10fast_float18parse_eight_digitsIcEEvRPKT_RmS6_S6_:
 3824|   254k|                   size_t &count) noexcept {
 3825|   254k|  value = value * 100000000 + parse_eight_digits_unrolled(p);
 3826|   254k|  p += 8;
 3827|   254k|  counter += 8;
 3828|   254k|  count += 8;
 3829|   254k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledIcEEjPKT_:
 1588|   254k|parse_eight_digits_unrolled(UC const *chars) noexcept {
 1589|   254k|  if (cpp20_and_in_constexpr() || !has_simd_opt<UC>()) {
  ------------------
  |  Branch (1589:7): [Folded, False: 0]
  |  Branch (1589:35): [True: 0, Folded]
  ------------------
 1590|   254k|    return parse_eight_digits_unrolled(read8_to_u64(chars)); // truncation okay
 1591|   254k|  }
 1592|      0|  return parse_eight_digits_unrolled(simd_read8_to_u64(chars));
 1593|   254k|}
_ZN3glz10fast_float15parse_one_digitIcEEvRPKT_RmS6_S6_:
 3834|   403k|                size_t &count) noexcept {
 3835|   403k|  value = value * 10 + limb(*p - UC('0'));
 3836|   403k|  p++;
 3837|   403k|  counter++;
 3838|   403k|  count++;
 3839|   403k|}
_ZN3glz10fast_float10add_nativeERNS0_6bigintEmm:
 3842|   142k|add_native(bigint &big, limb power, limb value) noexcept {
 3843|   142k|  big.mul(power);
 3844|   142k|  big.add(value);
 3845|   142k|}
_ZN3glz10fast_float6bigint3mulEm:
 3552|   142k|  GLZ_FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
_ZN3glz10fast_float9small_mulILt62EEEbRNS0_8stackvecIXT_EEEm:
 3249|   242k|                                            limb y) noexcept {
 3250|   242k|  limb carry = 0;
 3251|  3.65M|  for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3251:26): [True: 3.41M, False: 242k]
  ------------------
 3252|  3.41M|    vec[index] = scalar_mul(vec[index], y, carry);
 3253|  3.41M|  }
 3254|   242k|  if (carry != 0) {
  ------------------
  |  Branch (3254:7): [True: 213k, False: 29.2k]
  ------------------
 3255|   213k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|   213k|  {                                                                            \
  |  |  355|   213k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 213k]
  |  |  ------------------
  |  |  356|   213k|      return false;                                                            \
  |  |  357|   213k|  }
  ------------------
 3256|   213k|  }
 3257|   242k|  return true;
 3258|   242k|}
_ZNK3glz10fast_float8stackvecILt62EE3lenEv:
 3039|  4.73M|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float10scalar_mulEmmRm:
 3196|  3.41M|scalar_mul(limb x, limb y, limb &carry) noexcept {
 3197|  3.41M|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3198|  3.41M|#if defined(__SIZEOF_INT128__)
 3199|       |  // GCC and clang both define it as an extension.
 3200|  3.41M|  __uint128_t z = __uint128_t(x) * __uint128_t(y) + __uint128_t(carry);
 3201|  3.41M|  carry = limb(z >> limb_bits);
 3202|  3.41M|  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.41M|}
_ZN3glz10fast_float8stackvecILt62EEixEm:
 3017|  8.53M|  GLZ_FASTFLOAT_CONSTEXPR14 limb &operator[](size_t index) noexcept {
 3018|  8.53M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  8.53M|  { ((void)(x)); }
  ------------------
 3019|  8.53M|    return data[index];
 3020|  8.53M|  }
_ZN3glz10fast_float8stackvecILt62EE8try_pushEm:
 3052|   229k|  GLZ_FASTFLOAT_CONSTEXPR14 bool try_push(limb value) noexcept {
 3053|   229k|    if (len() < capacity()) {
  ------------------
  |  Branch (3053:9): [True: 229k, False: 0]
  ------------------
 3054|   229k|      push_unchecked(value);
 3055|   229k|      return true;
 3056|   229k|    } else {
 3057|      0|      return false;
 3058|      0|    }
 3059|   229k|  }
_ZNK3glz10fast_float8stackvecILt62EE8capacityEv:
 3043|   374k|  constexpr size_t capacity() const noexcept { return size; }
_ZN3glz10fast_float8stackvecILt62EE14push_uncheckedEm:
 3046|   236k|  GLZ_FASTFLOAT_CONSTEXPR14 void push_unchecked(limb value) noexcept {
 3047|   236k|    data[length] = value;
 3048|   236k|    length++;
 3049|   236k|  }
_ZN3glz10fast_float6bigint3addEm:
 3554|   142k|  GLZ_FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
_ZN3glz10fast_float9small_addILt62EEEbRNS0_8stackvecIXT_EEEm:
 3242|   142k|small_add(stackvec<size> &vec, limb y) noexcept {
 3243|   142k|  return small_add_from(vec, y, 0);
 3244|   142k|}
_ZN3glz10fast_float14small_add_fromILt62EEEbRNS0_8stackvecIXT_EEEmm:
 3224|   142k|                                                 size_t start) noexcept {
 3225|   142k|  size_t index = start;
 3226|   142k|  limb carry = y;
 3227|   142k|  bool overflow;
 3228|   217k|  while (carry != 0 && index < vec.len()) {
  ------------------
  |  Branch (3228:10): [True: 87.4k, False: 129k]
  |  Branch (3228:24): [True: 74.2k, False: 13.1k]
  ------------------
 3229|  74.2k|    vec[index] = scalar_add(vec[index], carry, overflow);
 3230|  74.2k|    carry = limb(overflow);
 3231|  74.2k|    index += 1;
 3232|  74.2k|  }
 3233|   142k|  if (carry != 0) {
  ------------------
  |  Branch (3233:7): [True: 13.1k, False: 129k]
  ------------------
 3234|  13.1k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  13.1k|  {                                                                            \
  |  |  355|  13.1k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 13.1k]
  |  |  ------------------
  |  |  356|  13.1k|      return false;                                                            \
  |  |  357|  13.1k|  }
  ------------------
 3235|  13.1k|  }
 3236|   142k|  return true;
 3237|   142k|}
_ZN3glz10fast_float10scalar_addEmmRb:
 3176|  1.04M|scalar_add(limb x, limb y, bool &overflow) noexcept {
 3177|  1.04M|  limb z;
 3178|       |// gcc and clang
 3179|  1.04M|#if defined(__has_builtin)
 3180|  1.04M|#if __has_builtin(__builtin_add_overflow)
 3181|  1.04M|  if (!cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (3181:7): [True: 1.04M, Folded]
  ------------------
 3182|  1.04M|    overflow = __builtin_add_overflow(x, y, &z);
 3183|  1.04M|    return z;
 3184|  1.04M|  }
 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.04M|}
_ZN3glz10fast_float12is_truncatedIcEEbPKT_S4_:
 3795|  2.61k|is_truncated(UC const *first, UC const *last) noexcept {
 3796|       |  // do 8-bit optimizations, can just compare to 8 literal 0s.
 3797|  2.61k|  uint64_t val;
 3798|  6.24k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3798:10): [True: 6.24k, Folded]
  ------------------
 3799|  6.24k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3799:10): [True: 4.59k, False: 1.64k]
  ------------------
 3800|  4.59k|    ::memcpy(&val, first, sizeof(uint64_t));
 3801|  4.59k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3801:9): [True: 962, False: 3.63k]
  ------------------
 3802|    962|      return true;
 3803|    962|    }
 3804|  3.63k|    first += int_cmp_len<UC>();
 3805|  3.63k|  }
 3806|  4.32k|  while (first != last) {
  ------------------
  |  Branch (3806:10): [True: 3.54k, False: 778]
  ------------------
 3807|  3.54k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3807:9): [True: 870, False: 2.67k]
  ------------------
 3808|    870|      return true;
 3809|    870|    }
 3810|  2.67k|    ++first;
 3811|  2.67k|  }
 3812|    778|  return false;
 3813|  1.64k|}
_ZN3glz10fast_float15round_up_bigintERNS0_6bigintERm:
 3848|  1.83k|round_up_bigint(bigint &big, size_t &count) noexcept {
 3849|       |  // need to round-up the digits, but need to avoid rounding
 3850|       |  // ....9999 to ...10000, which could cause a false halfway point.
 3851|  1.83k|  add_native(big, 10, 1);
 3852|  1.83k|  count++;
 3853|  1.83k|}
_ZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEi:
 3942|  5.17k|positive_digit_comp(bigint &bigmant, int32_t exponent) noexcept {
 3943|  5.17k|  GLZ_FASTFLOAT_ASSERT(bigmant.pow10(uint32_t(exponent)));
  ------------------
  |  |  344|  5.17k|  { ((void)(x)); }
  ------------------
 3944|  5.17k|  adjusted_mantissa answer;
 3945|  5.17k|  bool truncated;
 3946|  5.17k|  answer.mantissa = bigmant.hi64(truncated);
 3947|  5.17k|  int bias = binary_format<T>::mantissa_explicit_bits() -
 3948|  5.17k|             binary_format<T>::minimum_exponent();
 3949|  5.17k|  answer.power2 = bigmant.bit_length() - 64 + bias;
 3950|       |
 3951|  5.17k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  5.17k|    round_nearest_tie_even(
 3953|  5.17k|        a, shift,
 3954|  5.17k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  5.17k|          return is_above || (is_halfway && truncated) ||
 3956|  5.17k|                 (is_odd && is_halfway);
 3957|  5.17k|        });
 3958|  5.17k|  });
 3959|       |
 3960|  5.17k|  return answer;
 3961|  5.17k|}
_ZN3glz10fast_float6bigint5pow10Ej:
 3591|  5.17k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow10(uint32_t exp) noexcept {
 3592|  5.17k|    GLZ_FASTFLOAT_TRY(pow5(exp));
  ------------------
  |  |  354|  5.17k|  {                                                                            \
  |  |  355|  5.17k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 5.17k]
  |  |  ------------------
  |  |  356|  5.17k|      return false;                                                            \
  |  |  357|  5.17k|  }
  ------------------
 3593|  5.17k|    return pow2(exp);
 3594|  5.17k|  }
_ZN3glz10fast_float6bigint4pow5Ej:
 3560|  12.8k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow5(uint32_t exp) noexcept {
 3561|       |    // multiply by a power of 5
 3562|  12.8k|    size_t large_length = sizeof(large_power_of_5) / sizeof(limb);
 3563|  12.8k|    limb_span large = limb_span(large_power_of_5, large_length);
 3564|  28.4k|    while (exp >= large_step) {
  ------------------
  |  Branch (3564:12): [True: 15.6k, False: 12.8k]
  ------------------
 3565|  15.6k|      GLZ_FASTFLOAT_TRY(large_mul(vec, large));
  ------------------
  |  |  354|  15.6k|  {                                                                            \
  |  |  355|  15.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  356|  15.6k|      return false;                                                            \
  |  |  357|  15.6k|  }
  ------------------
 3566|  15.6k|      exp -= large_step;
 3567|  15.6k|    }
 3568|  12.8k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3569|  12.8k|    uint32_t small_step = 27;
 3570|  12.8k|    limb max_native = 7450580596923828125UL;
 3571|       |#else
 3572|       |    uint32_t small_step = 13;
 3573|       |    limb max_native = 1220703125U;
 3574|       |#endif
 3575|  26.2k|    while (exp >= small_step) {
  ------------------
  |  Branch (3575:12): [True: 13.4k, False: 12.8k]
  ------------------
 3576|  13.4k|      GLZ_FASTFLOAT_TRY(small_mul(vec, max_native));
  ------------------
  |  |  354|  13.4k|  {                                                                            \
  |  |  355|  13.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 13.4k]
  |  |  ------------------
  |  |  356|  13.4k|      return false;                                                            \
  |  |  357|  13.4k|  }
  ------------------
 3577|  13.4k|      exp -= small_step;
 3578|  13.4k|    }
 3579|  12.8k|    if (exp != 0) {
  ------------------
  |  Branch (3579:9): [True: 8.67k, False: 4.15k]
  ------------------
 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.67k|      GLZ_FASTFLOAT_TRY(small_mul(
  ------------------
  |  |  354|  8.67k|  {                                                                            \
  |  |  355|  8.67k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 8.67k]
  |  |  ------------------
  |  |  356|  8.67k|      return false;                                                            \
  |  |  357|  8.67k|  }
  ------------------
 3584|  8.67k|          vec, limb(((void)small_power_of_5[0], small_power_of_5[exp]))));
 3585|  8.67k|    }
 3586|       |
 3587|  12.8k|    return true;
 3588|  12.8k|  }
_ZN3glz10fast_float4spanImEC2EPKmm:
  436|   106k|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float9large_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3329|  15.6k|GLZ_FASTFLOAT_CONSTEXPR20 bool large_mul(stackvec<size> &x, limb_span y) noexcept {
 3330|  15.6k|  if (y.len() == 1) {
  ------------------
  |  Branch (3330:7): [True: 0, False: 15.6k]
  ------------------
 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|  15.6k|  } else {
 3333|  15.6k|    GLZ_FASTFLOAT_TRY(long_mul(x, y));
  ------------------
  |  |  354|  15.6k|  {                                                                            \
  |  |  355|  15.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  356|  15.6k|      return false;                                                            \
  |  |  357|  15.6k|  }
  ------------------
 3334|  15.6k|  }
 3335|  15.6k|  return true;
 3336|  15.6k|}
_ZNK3glz10fast_float4spanImE3lenEv:
  440|  1.21M|  constexpr size_t len() const noexcept { return length; }
_ZNK3glz10fast_float4spanImEixEm:
  442|   761k|  GLZ_FASTFLOAT_CONSTEXPR14 const T &operator[](size_t index) const noexcept {
  443|   761k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|   761k|  { ((void)(x)); }
  ------------------
  444|   761k|    return ptr[index];
  445|   761k|  }
_ZN3glz10fast_float8long_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3301|  15.6k|GLZ_FASTFLOAT_CONSTEXPR20 bool long_mul(stackvec<size> &x, limb_span y) noexcept {
 3302|  15.6k|  limb_span xs = limb_span(x.data, x.len());
 3303|  15.6k|  stackvec<size> z(xs);
 3304|  15.6k|  limb_span zs = limb_span(z.data, z.len());
 3305|       |
 3306|  15.6k|  if (y.len() != 0) {
  ------------------
  |  Branch (3306:7): [True: 15.6k, False: 0]
  ------------------
 3307|  15.6k|    limb y0 = y[0];
 3308|  15.6k|    GLZ_FASTFLOAT_TRY(small_mul(x, y0));
  ------------------
  |  |  354|  15.6k|  {                                                                            \
  |  |  355|  15.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  356|  15.6k|      return false;                                                            \
  |  |  357|  15.6k|  }
  ------------------
 3309|  78.1k|    for (size_t index = 1; index < y.len(); index++) {
  ------------------
  |  Branch (3309:28): [True: 62.5k, False: 15.6k]
  ------------------
 3310|  62.5k|      limb yi = y[index];
 3311|  62.5k|      stackvec<size> zi;
 3312|  62.5k|      if (yi != 0) {
  ------------------
  |  Branch (3312:11): [True: 62.5k, False: 0]
  ------------------
 3313|       |        // re-use the same buffer throughout
 3314|  62.5k|        zi.set_len(0);
 3315|  62.5k|        GLZ_FASTFLOAT_TRY(zi.try_extend(zs));
  ------------------
  |  |  354|  62.5k|  {                                                                            \
  |  |  355|  62.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 62.5k]
  |  |  ------------------
  |  |  356|  62.5k|      return false;                                                            \
  |  |  357|  62.5k|  }
  ------------------
 3316|  62.5k|        GLZ_FASTFLOAT_TRY(small_mul(zi, yi));
  ------------------
  |  |  354|  62.5k|  {                                                                            \
  |  |  355|  62.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 62.5k]
  |  |  ------------------
  |  |  356|  62.5k|      return false;                                                            \
  |  |  357|  62.5k|  }
  ------------------
 3317|  62.5k|        limb_span zis = limb_span(zi.data, zi.len());
 3318|  62.5k|        GLZ_FASTFLOAT_TRY(large_add_from(x, zis, index));
  ------------------
  |  |  354|  62.5k|  {                                                                            \
  |  |  355|  62.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 62.5k]
  |  |  ------------------
  |  |  356|  62.5k|      return false;                                                            \
  |  |  357|  62.5k|  }
  ------------------
 3319|  62.5k|      }
 3320|  62.5k|    }
 3321|  15.6k|  }
 3322|       |
 3323|  15.6k|  x.normalize();
 3324|  15.6k|  return true;
 3325|  15.6k|}
_ZN3glz10fast_float8stackvecILt62EEC2ENS0_4spanImEE:
 3013|  15.6k|  GLZ_FASTFLOAT_CONSTEXPR20 stackvec(limb_span s) {
 3014|  15.6k|    GLZ_FASTFLOAT_ASSERT(try_extend(s));
  ------------------
  |  |  344|  15.6k|  { ((void)(x)); }
  ------------------
 3015|  15.6k|  }
_ZN3glz10fast_float8stackvecILt62EE7set_lenEm:
 3035|   207k|  GLZ_FASTFLOAT_CONSTEXPR14 void set_len(size_t len) noexcept {
 3036|   207k|    length = uint16_t(len);
 3037|   207k|  }
_ZN3glz10fast_float8stackvecILt62EE10try_extendENS0_4spanImEE:
 3069|  78.1k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_extend(limb_span s) noexcept {
 3070|  78.1k|    if (len() + s.len() <= capacity()) {
  ------------------
  |  Branch (3070:9): [True: 78.1k, False: 0]
  ------------------
 3071|  78.1k|      extend_unchecked(s);
 3072|  78.1k|      return true;
 3073|  78.1k|    } else {
 3074|      0|      return false;
 3075|      0|    }
 3076|  78.1k|  }
_ZN3glz10fast_float8stackvecILt62EE16extend_uncheckedENS0_4spanImEE:
 3062|  78.1k|  GLZ_FASTFLOAT_CONSTEXPR20 void extend_unchecked(limb_span s) noexcept {
 3063|  78.1k|    limb *ptr = data + length;
 3064|  78.1k|    std::copy_n(s.ptr, s.len(), ptr);
 3065|  78.1k|    set_len(len() + s.len());
 3066|  78.1k|  }
_ZN3glz10fast_float14large_add_fromILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEEm:
 3264|  62.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|  62.5k|  if (x.len() < start || y.len() > x.len() - start) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 62.5k]
  |  Branch (3267:26): [True: 61.9k, False: 554]
  ------------------
 3268|  61.9k|    GLZ_FASTFLOAT_TRY(x.try_resize(y.len() + start, 0));
  ------------------
  |  |  354|  61.9k|  {                                                                            \
  |  |  355|  61.9k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 61.9k]
  |  |  ------------------
  |  |  356|  61.9k|      return false;                                                            \
  |  |  357|  61.9k|  }
  ------------------
 3269|  61.9k|  }
 3270|       |
 3271|  62.5k|  bool carry = false;
 3272|   745k|  for (size_t index = 0; index < y.len(); index++) {
  ------------------
  |  Branch (3272:26): [True: 683k, False: 62.5k]
  ------------------
 3273|   683k|    limb xi = x[index + start];
 3274|   683k|    limb yi = y[index];
 3275|   683k|    bool c1 = false;
 3276|   683k|    bool c2 = false;
 3277|   683k|    xi = scalar_add(xi, yi, c1);
 3278|   683k|    if (carry) {
  ------------------
  |  Branch (3278:9): [True: 287k, False: 395k]
  ------------------
 3279|   287k|      xi = scalar_add(xi, 1, c2);
 3280|   287k|    }
 3281|   683k|    x[index + start] = xi;
 3282|   683k|    carry = c1 | c2;
 3283|   683k|  }
 3284|       |
 3285|       |  // handle overflow
 3286|  62.5k|  if (carry) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 62.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|  62.5k|  return true;
 3290|  62.5k|}
_ZN3glz10fast_float8stackvecILt62EE10try_resizeEmm:
 3095|  61.9k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_resize(size_t new_len, limb value) noexcept {
 3096|  61.9k|    if (new_len > capacity()) {
  ------------------
  |  Branch (3096:9): [True: 0, False: 61.9k]
  ------------------
 3097|      0|      return false;
 3098|  61.9k|    } else {
 3099|  61.9k|      resize_unchecked(new_len, value);
 3100|  61.9k|      return true;
 3101|  61.9k|    }
 3102|  61.9k|  }
_ZN3glz10fast_float8stackvecILt62EE16resize_uncheckedEmm:
 3082|  61.9k|  void resize_unchecked(size_t new_len, limb value) noexcept {
 3083|  61.9k|    if (new_len > len()) {
  ------------------
  |  Branch (3083:9): [True: 61.9k, False: 0]
  ------------------
 3084|  61.9k|      size_t count = new_len - len();
 3085|  61.9k|      limb *first = data + len();
 3086|  61.9k|      limb *last = first + count;
 3087|  61.9k|      ::std::fill(first, last, value);
 3088|  61.9k|      set_len(new_len);
 3089|  61.9k|    } else {
 3090|      0|      set_len(new_len);
 3091|      0|    }
 3092|  61.9k|  }
_ZN3glz10fast_float8stackvecILt62EE9normalizeEv:
 3118|  23.2k|  GLZ_FASTFLOAT_CONSTEXPR14 void normalize() noexcept {
 3119|  23.2k|    while (len() > 0 && rindex(0) == 0) {
  ------------------
  |  Branch (3119:12): [True: 23.2k, False: 0]
  |  Branch (3119:25): [True: 0, False: 23.2k]
  ------------------
 3120|      0|      length--;
 3121|      0|    }
 3122|  23.2k|  }
_ZNK3glz10fast_float8stackvecILt62EE6rindexEm:
 3028|  38.4k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &rindex(size_t index) const noexcept {
 3029|  38.4k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  38.4k|  { ((void)(x)); }
  ------------------
 3030|  38.4k|    size_t rindex = length - index - 1;
 3031|  38.4k|    return data[rindex];
 3032|  38.4k|  }
_ZN3glz10fast_float6bigint4pow2Ej:
 3557|  12.6k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow2(uint32_t exp) noexcept { return shl(exp); }
_ZN3glz10fast_float6bigint3shlEm:
 3519|  12.6k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {
 3520|  12.6k|    size_t rem = n % limb_bits;
 3521|  12.6k|    size_t div = n / limb_bits;
 3522|  12.6k|    if (rem != 0) {
  ------------------
  |  Branch (3522:9): [True: 8.02k, False: 4.59k]
  ------------------
 3523|  8.02k|      GLZ_FASTFLOAT_TRY(shl_bits(rem));
  ------------------
  |  |  354|  8.02k|  {                                                                            \
  |  |  355|  8.02k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 8.02k]
  |  |  ------------------
  |  |  356|  8.02k|      return false;                                                            \
  |  |  357|  8.02k|  }
  ------------------
 3524|  8.02k|    }
 3525|  12.6k|    if (div != 0) {
  ------------------
  |  Branch (3525:9): [True: 4.84k, False: 7.76k]
  ------------------
 3526|  4.84k|      GLZ_FASTFLOAT_TRY(shl_limbs(div));
  ------------------
  |  |  354|  4.84k|  {                                                                            \
  |  |  355|  4.84k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 4.84k]
  |  |  ------------------
  |  |  356|  4.84k|      return false;                                                            \
  |  |  357|  4.84k|  }
  ------------------
 3527|  4.84k|    }
 3528|  12.6k|    return true;
 3529|  12.6k|  }
_ZN3glz10fast_float6bigint8shl_bitsEm:
 3472|  8.02k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_bits(size_t n) noexcept {
 3473|       |    // Internally, for each item, we shift left by n, and add the previous
 3474|       |    // right shifted limb-bits.
 3475|       |    // For example, we transform (for u8) shifted left 2, to:
 3476|       |    //      b10100100 b01000010
 3477|       |    //      b10 b10010001 b00001000
 3478|  8.02k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  8.02k|  { ((void)(x)); }
  ------------------
 3479|  8.02k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n < sizeof(limb) * 8);
  ------------------
  |  |  349|  8.02k|  { ((void)(x)); }
  ------------------
 3480|       |
 3481|  8.02k|    size_t shl = n;
 3482|  8.02k|    size_t shr = limb_bits - shl;
 3483|  8.02k|    limb prev = 0;
 3484|   103k|    for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3484:28): [True: 95.8k, False: 8.02k]
  ------------------
 3485|  95.8k|      limb xi = vec[index];
 3486|  95.8k|      vec[index] = (xi << shl) | (prev >> shr);
 3487|  95.8k|      prev = xi;
 3488|  95.8k|    }
 3489|       |
 3490|  8.02k|    limb carry = prev >> shr;
 3491|  8.02k|    if (carry != 0) {
  ------------------
  |  Branch (3491:9): [True: 2.34k, False: 5.67k]
  ------------------
 3492|  2.34k|      return vec.try_push(carry);
 3493|  2.34k|    }
 3494|  5.67k|    return true;
 3495|  8.02k|  }
_ZN3glz10fast_float6bigint9shl_limbsEm:
 3498|  4.84k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
 3499|  4.84k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  4.84k|  { ((void)(x)); }
  ------------------
 3500|  4.84k|    if (n + vec.len() > vec.capacity()) {
  ------------------
  |  Branch (3500:9): [True: 0, False: 4.84k]
  ------------------
 3501|      0|      return false;
 3502|  4.84k|    } else if (!vec.is_empty()) {
  ------------------
  |  Branch (3502:16): [True: 4.84k, False: 0]
  ------------------
 3503|       |      // move limbs
 3504|  4.84k|      limb *dst = vec.data + n;
 3505|  4.84k|      limb const *src = vec.data;
 3506|  4.84k|      std::copy_backward(src, src + vec.len(), dst + vec.len());
 3507|       |      // fill in empty limbs
 3508|  4.84k|      limb *first = vec.data;
 3509|  4.84k|      limb *last = first + n;
 3510|  4.84k|      ::std::fill(first, last, 0);
 3511|  4.84k|      vec.set_len(n + vec.len());
 3512|  4.84k|      return true;
 3513|  4.84k|    } else {
 3514|      0|      return true;
 3515|      0|    }
 3516|  4.84k|  }
_ZNK3glz10fast_float8stackvecILt62EE8is_emptyEv:
 3041|  10.0k|  constexpr bool is_empty() const noexcept { return length == 0; }
_ZNK3glz10fast_float6bigint4hi64ERb:
 3418|  5.17k|  GLZ_FASTFLOAT_CONSTEXPR20 uint64_t hi64(bool &truncated) const noexcept {
 3419|  5.17k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3420|  5.17k|    if (vec.len() == 0) {
  ------------------
  |  Branch (3420:9): [True: 0, False: 5.17k]
  ------------------
 3421|      0|      return empty_hi64(truncated);
 3422|  5.17k|    } else if (vec.len() == 1) {
  ------------------
  |  Branch (3422:16): [True: 1.86k, False: 3.30k]
  ------------------
 3423|  1.86k|      return uint64_hi64(vec.rindex(0), truncated);
 3424|  3.30k|    } else {
 3425|  3.30k|      uint64_t result = uint64_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3426|  3.30k|      truncated |= vec.nonzero(2);
 3427|  3.30k|      return result;
 3428|  3.30k|    }
 3429|       |#else
 3430|       |    if (vec.len() == 0) {
 3431|       |      return empty_hi64(truncated);
 3432|       |    } else if (vec.len() == 1) {
 3433|       |      return uint32_hi64(vec.rindex(0), truncated);
 3434|       |    } else if (vec.len() == 2) {
 3435|       |      return uint32_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3436|       |    } else {
 3437|       |      uint64_t result =
 3438|       |          uint32_hi64(vec.rindex(0), vec.rindex(1), vec.rindex(2), truncated);
 3439|       |      truncated |= vec.nonzero(3);
 3440|       |      return result;
 3441|       |    }
 3442|       |#endif
 3443|  5.17k|  }
_ZN3glz10fast_float11uint64_hi64EmRb:
 3132|  1.86k|uint64_hi64(uint64_t r0, bool &truncated) noexcept {
 3133|  1.86k|  truncated = false;
 3134|  1.86k|  int shl = leading_zeroes(r0);
 3135|  1.86k|  return r0 << shl;
 3136|  1.86k|}
_ZN3glz10fast_float11uint64_hi64EmmRb:
 3139|  3.30k|uint64_hi64(uint64_t r0, uint64_t r1, bool &truncated) noexcept {
 3140|  3.30k|  int shl = leading_zeroes(r0);
 3141|  3.30k|  if (shl == 0) {
  ------------------
  |  Branch (3141:7): [True: 328, False: 2.97k]
  ------------------
 3142|    328|    truncated = r1 != 0;
 3143|    328|    return r0;
 3144|  2.97k|  } else {
 3145|  2.97k|    int shr = 64 - shl;
 3146|  2.97k|    truncated = (r1 << shl) != 0;
 3147|  2.97k|    return (r0 << shl) | (r1 >> shr);
 3148|  2.97k|  }
 3149|  3.30k|}
_ZNK3glz10fast_float8stackvecILt62EE7nonzeroEm:
 3107|  3.30k|  GLZ_FASTFLOAT_CONSTEXPR14 bool nonzero(size_t index) const noexcept {
 3108|  3.30k|    while (index < len()) {
  ------------------
  |  Branch (3108:12): [True: 1.53k, False: 1.76k]
  ------------------
 3109|  1.53k|      if (rindex(index) != 0) {
  ------------------
  |  Branch (3109:11): [True: 1.53k, False: 4]
  ------------------
 3110|  1.53k|        return true;
 3111|  1.53k|      }
 3112|      4|      index++;
 3113|      4|    }
 3114|  1.76k|    return false;
 3115|  3.30k|  }
_ZNK3glz10fast_float6bigint10bit_lengthEv:
 3547|  5.17k|  GLZ_FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {
 3548|  5.17k|    int lz = ctlz();
 3549|  5.17k|    return int(limb_bits * vec.len()) - lz;
 3550|  5.17k|  }
_ZNK3glz10fast_float6bigint4ctlzEv:
 3532|  5.17k|  GLZ_FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
 3533|  5.17k|    if (vec.is_empty()) {
  ------------------
  |  Branch (3533:9): [True: 0, False: 5.17k]
  ------------------
 3534|      0|      return 0;
 3535|  5.17k|    } else {
 3536|  5.17k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3537|  5.17k|      return leading_zeroes(vec.rindex(0));
 3538|       |#else
 3539|       |      // no use defining a specialized leading_zeroes for a 32-bit type.
 3540|       |      uint64_t r0 = vec.rindex(0);
 3541|       |      return leading_zeroes(r0 << 32);
 3542|       |#endif
 3543|  5.17k|    }
 3544|  5.17k|  }
_ZN3glz10fast_float5roundIdZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiEUlRS3_iE_EEvS6_T0_:
 3707|  5.17k|                                                         callback cb) noexcept {
 3708|  5.17k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  5.17k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 5.17k]
  ------------------
 3710|       |    // have a denormal float
 3711|      0|    int32_t shift = -am.power2 + 1;
 3712|      0|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|      0|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 0, False: 0]
  ------------------
 3715|      0|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|      0|                    ? 0
 3717|      0|                    : 1;
 3718|      0|    return;
 3719|      0|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  5.17k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  5.17k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 5.17k]
  ------------------
 3726|  5.17k|      (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|  5.17k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  5.17k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 5.17k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  5.17k|}
_ZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_i:
 3951|  5.17k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  5.17k|    round_nearest_tie_even(
 3953|  5.17k|        a, shift,
 3954|  5.17k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  5.17k|          return is_above || (is_halfway && truncated) ||
 3956|  5.17k|                 (is_odd && is_halfway);
 3957|  5.17k|        });
 3958|  5.17k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS3_iE_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  5.17k|                       callback cb) noexcept {
 3743|  5.17k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 5.17k]
  ------------------
 3744|  5.17k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 5.17k]
  ------------------
 3745|  5.17k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  5.17k|  bool is_above = truncated_bits > halfway;
 3747|  5.17k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  5.17k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 5.17k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  5.17k|  } else {
 3753|  5.17k|    am.mantissa >>= shift;
 3754|  5.17k|  }
 3755|  5.17k|  am.power2 += shift;
 3756|       |
 3757|  5.17k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  5.17k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  5.17k|}
_ZZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_iENKUlbbbE_clEbbb:
 3954|  5.17k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  5.17k|          return is_above || (is_halfway && truncated) ||
  ------------------
  |  Branch (3955:18): [True: 1.58k, False: 3.58k]
  |  Branch (3955:31): [True: 1.46k, False: 2.12k]
  |  Branch (3955:45): [True: 744, False: 718]
  ------------------
 3956|  2.83k|                 (is_odd && is_halfway);
  ------------------
  |  Branch (3956:19): [True: 1.16k, False: 1.67k]
  |  Branch (3956:29): [True: 186, False: 978]
  ------------------
 3957|  5.17k|        });
_ZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_i:
 3970|  7.66k|    bigint &bigmant, adjusted_mantissa am, int32_t exponent) noexcept {
 3971|  7.66k|  bigint &real_digits = bigmant;
 3972|  7.66k|  int32_t real_exp = exponent;
 3973|       |
 3974|       |  // get the value of `b`, rounded down, and get a bigint representation of b+h
 3975|  7.66k|  adjusted_mantissa am_b = am;
 3976|       |  // gcc7 buf: use a lambda to remove the noexcept qualifier bug with
 3977|       |  // -Wnoexcept-type.
 3978|  7.66k|  round<T>(am_b,
 3979|  7.66k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
 3980|  7.66k|  T b;
 3981|  7.66k|  to_float(false, am_b, b);
 3982|  7.66k|  adjusted_mantissa theor = to_extended_halfway(b);
 3983|  7.66k|  bigint theor_digits(theor.mantissa);
 3984|  7.66k|  int32_t theor_exp = theor.power2;
 3985|       |
 3986|       |  // scale real digits and theor digits to be same power.
 3987|  7.66k|  int32_t pow2_exp = theor_exp - real_exp;
 3988|  7.66k|  uint32_t pow5_exp = uint32_t(-real_exp);
 3989|  7.66k|  if (pow5_exp != 0) {
  ------------------
  |  Branch (3989:7): [True: 7.66k, False: 0]
  ------------------
 3990|  7.66k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow5(pow5_exp));
  ------------------
  |  |  344|  7.66k|  { ((void)(x)); }
  ------------------
 3991|  7.66k|  }
 3992|  7.66k|  if (pow2_exp > 0) {
  ------------------
  |  Branch (3992:7): [True: 4.94k, False: 2.71k]
  ------------------
 3993|  4.94k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow2(uint32_t(pow2_exp)));
  ------------------
  |  |  344|  4.94k|  { ((void)(x)); }
  ------------------
 3994|  4.94k|  } else if (pow2_exp < 0) {
  ------------------
  |  Branch (3994:14): [True: 2.49k, False: 222]
  ------------------
 3995|  2.49k|    GLZ_FASTFLOAT_ASSERT(real_digits.pow2(uint32_t(-pow2_exp)));
  ------------------
  |  |  344|  2.49k|  { ((void)(x)); }
  ------------------
 3996|  2.49k|  }
 3997|       |
 3998|       |  // compare digits, and use it to director rounding
 3999|  7.66k|  int ord = real_digits.compare(theor_digits);
 4000|  7.66k|  adjusted_mantissa answer = am;
 4001|  7.66k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  7.66k|    round_nearest_tie_even(
 4003|  7.66k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.66k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.66k|          (void)__; // not needed, since we've done our comparison
 4006|  7.66k|          if (ord > 0) {
 4007|  7.66k|            return true;
 4008|  7.66k|          } else if (ord < 0) {
 4009|  7.66k|            return false;
 4010|  7.66k|          } else {
 4011|  7.66k|            return is_odd;
 4012|  7.66k|          }
 4013|  7.66k|        });
 4014|  7.66k|  });
 4015|       |
 4016|  7.66k|  return answer;
 4017|  7.66k|}
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE_EEvS6_T0_:
 3707|  7.66k|                                                         callback cb) noexcept {
 3708|  7.66k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  7.66k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 550, False: 7.11k]
  ------------------
 3710|       |    // have a denormal float
 3711|    550|    int32_t shift = -am.power2 + 1;
 3712|    550|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    550|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 550, False: 0]
  ------------------
 3715|    550|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    550|                    ? 0
 3717|    550|                    : 1;
 3718|    550|    return;
 3719|    550|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  7.11k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  7.11k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 7.11k]
  ------------------
 3726|  7.11k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|      0|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|      0|    am.power2++;
 3729|      0|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  7.11k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  7.11k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 7.11k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  7.11k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE_clES5_i:
 3979|  7.66k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
_ZN3glz10fast_float10round_downERNS0_17adjusted_mantissaEi:
 3762|  7.66k|round_down(adjusted_mantissa &am, int32_t shift) noexcept {
 3763|  7.66k|  if (shift == 64) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 7.66k]
  ------------------
 3764|      0|    am.mantissa = 0;
 3765|  7.66k|  } else {
 3766|  7.66k|    am.mantissa >>= shift;
 3767|  7.66k|  }
 3768|  7.66k|  am.power2 += shift;
 3769|  7.66k|}
_ZN3glz10fast_float19to_extended_halfwayIdEENS0_17adjusted_mantissaET_:
 3696|  7.66k|to_extended_halfway(T value) noexcept {
 3697|  7.66k|  adjusted_mantissa am = to_extended(value);
 3698|  7.66k|  am.mantissa <<= 1;
 3699|  7.66k|  am.mantissa += 1;
 3700|  7.66k|  am.power2 -= 1;
 3701|  7.66k|  return am;
 3702|  7.66k|}
_ZN3glz10fast_float11to_extendedIdEENS0_17adjusted_mantissaET_:
 3661|  7.66k|to_extended(T value) noexcept {
 3662|  7.66k|  using equiv_uint = equiv_uint_t<T>;
 3663|  7.66k|  constexpr equiv_uint exponent_mask = binary_format<T>::exponent_mask();
 3664|  7.66k|  constexpr equiv_uint mantissa_mask = binary_format<T>::mantissa_mask();
 3665|  7.66k|  constexpr equiv_uint hidden_bit_mask = binary_format<T>::hidden_bit_mask();
 3666|       |
 3667|  7.66k|  adjusted_mantissa am;
 3668|  7.66k|  int32_t bias = binary_format<T>::mantissa_explicit_bits() -
 3669|  7.66k|                 binary_format<T>::minimum_exponent();
 3670|  7.66k|  equiv_uint bits;
 3671|  7.66k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 3672|  7.66k|  bits = std::bit_cast<equiv_uint>(value);
 3673|       |#else
 3674|       |  ::memcpy(&bits, &value, sizeof(T));
 3675|       |#endif
 3676|  7.66k|  if ((bits & exponent_mask) == 0) {
  ------------------
  |  Branch (3676:7): [True: 550, False: 7.11k]
  ------------------
 3677|       |    // denormal
 3678|    550|    am.power2 = 1 - bias;
 3679|    550|    am.mantissa = bits & mantissa_mask;
 3680|  7.11k|  } else {
 3681|       |    // normal
 3682|  7.11k|    am.power2 = int32_t((bits & exponent_mask) >>
 3683|  7.11k|                        binary_format<T>::mantissa_explicit_bits());
 3684|  7.11k|    am.power2 -= bias;
 3685|  7.11k|    am.mantissa = (bits & mantissa_mask) | hidden_bit_mask;
 3686|  7.11k|  }
 3687|       |
 3688|  7.66k|  return am;
 3689|  7.66k|}
_ZN3glz10fast_float6bigintC2Em:
 3406|  7.66k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint(uint64_t value) : vec() {
 3407|  7.66k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3408|  7.66k|    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.66k|    vec.normalize();
 3414|  7.66k|  }
_ZNK3glz10fast_float6bigint7compareERKS1_:
 3451|  7.66k|  GLZ_FASTFLOAT_CONSTEXPR20 int compare(bigint const &other) const noexcept {
 3452|  7.66k|    if (vec.len() > other.vec.len()) {
  ------------------
  |  Branch (3452:9): [True: 0, False: 7.66k]
  ------------------
 3453|      0|      return 1;
 3454|  7.66k|    } else if (vec.len() < other.vec.len()) {
  ------------------
  |  Branch (3454:16): [True: 0, False: 7.66k]
  ------------------
 3455|      0|      return -1;
 3456|  7.66k|    } else {
 3457|  27.6k|      for (size_t index = vec.len(); index > 0; index--) {
  ------------------
  |  Branch (3457:38): [True: 27.0k, False: 588]
  ------------------
 3458|  27.0k|        limb xi = vec[index - 1];
 3459|  27.0k|        limb yi = other.vec[index - 1];
 3460|  27.0k|        if (xi > yi) {
  ------------------
  |  Branch (3460:13): [True: 3.58k, False: 23.4k]
  ------------------
 3461|  3.58k|          return 1;
 3462|  23.4k|        } else if (xi < yi) {
  ------------------
  |  Branch (3462:20): [True: 3.48k, False: 19.9k]
  ------------------
 3463|  3.48k|          return -1;
 3464|  3.48k|        }
 3465|  27.0k|      }
 3466|    588|      return 0;
 3467|  7.66k|    }
 3468|  7.66k|  }
_ZNK3glz10fast_float8stackvecILt62EEixEm:
 3022|  54.1k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &operator[](size_t index) const noexcept {
 3023|  54.1k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  54.1k|  { ((void)(x)); }
  ------------------
 3024|  54.1k|    return data[index];
 3025|  54.1k|  }
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE0_EEvS6_T0_:
 3707|  7.66k|                                                         callback cb) noexcept {
 3708|  7.66k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  7.66k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 550, False: 7.11k]
  ------------------
 3710|       |    // have a denormal float
 3711|    550|    int32_t shift = -am.power2 + 1;
 3712|    550|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    550|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 550, False: 0]
  ------------------
 3715|    550|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    550|                    ? 0
 3717|    550|                    : 1;
 3718|    550|    return;
 3719|    550|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  7.11k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  7.11k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 274, False: 6.83k]
  ------------------
 3726|  7.11k|      (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|  7.11k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  7.11k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 7.11k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  7.11k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_i:
 4001|  7.66k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  7.66k|    round_nearest_tie_even(
 4003|  7.66k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.66k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.66k|          (void)__; // not needed, since we've done our comparison
 4006|  7.66k|          if (ord > 0) {
 4007|  7.66k|            return true;
 4008|  7.66k|          } else if (ord < 0) {
 4009|  7.66k|            return false;
 4010|  7.66k|          } else {
 4011|  7.66k|            return is_odd;
 4012|  7.66k|          }
 4013|  7.66k|        });
 4014|  7.66k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iENKUlRS3_iE0_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  7.66k|                       callback cb) noexcept {
 3743|  7.66k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 7.66k]
  ------------------
 3744|  7.66k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 7.66k]
  ------------------
 3745|  7.66k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  7.66k|  bool is_above = truncated_bits > halfway;
 3747|  7.66k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  7.66k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 7.66k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  7.66k|  } else {
 3753|  7.66k|    am.mantissa >>= shift;
 3754|  7.66k|  }
 3755|  7.66k|  am.power2 += shift;
 3756|       |
 3757|  7.66k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  7.66k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  7.66k|}
_ZZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_iENKUlbbbE_clEbbb:
 4003|  7.66k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.66k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.66k|          (void)__; // not needed, since we've done our comparison
 4006|  7.66k|          if (ord > 0) {
  ------------------
  |  Branch (4006:15): [True: 3.58k, False: 4.07k]
  ------------------
 4007|  3.58k|            return true;
 4008|  4.07k|          } else if (ord < 0) {
  ------------------
  |  Branch (4008:22): [True: 3.48k, False: 588]
  ------------------
 4009|  3.48k|            return false;
 4010|  3.48k|          } else {
 4011|    588|            return is_odd;
 4012|    588|          }
 4013|  7.66k|        });
_ZN3glz10fast_float8to_floatIdEEvbNS0_17adjusted_mantissaERT_:
 1131|   164k|to_float(bool negative, adjusted_mantissa am, T &value) {
 1132|   164k|  using equiv_uint = equiv_uint_t<T>;
 1133|   164k|  equiv_uint word = equiv_uint(am.mantissa);
 1134|   164k|  word = equiv_uint(word | equiv_uint(am.power2)
 1135|   164k|                               << binary_format<T>::mantissa_explicit_bits());
 1136|   164k|  word =
 1137|   164k|      equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
 1138|   164k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 1139|   164k|  value = std::bit_cast<T>(word);
 1140|       |#else
 1141|       |  ::memcpy(&value, &word, sizeof(T));
 1142|       |#endif
 1143|   164k|}
_ZN3glz10fast_float13binary_formatIdE10sign_indexEv:
  758|   164k|template <> inline constexpr int binary_format<double>::sign_index() {
  759|   164k|  return 63;
  760|   164k|}
_ZN3glz10fast_float13binary_formatIdE14infinite_powerEv:
  750|   382k|template <> inline constexpr int binary_format<double>::infinite_power() {
  751|   382k|  return 0x7FF;
  752|   382k|}
_ZN3glz10fast_float15parse_options_tIcEC2ENS0_12chars_formatEci:
  217|  4.47M|      : format(fmt), decimal_point(dot), base(b) {}

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

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

_ZNK3glz4yaml12yaml_context12indent_stackMUlvE_clEv:
  101|  8.82M|      std::vector<int16_t> indent_stack = [] {
  102|  8.82M|         std::vector<int16_t> v;
  103|  8.82M|         v.reserve(max_yaml_recursive_depth);
  104|  8.82M|         return v;
  105|  8.82M|      }();
_ZN3glz4yaml12yaml_context16reset_read_stateEv:
  342|   164k|      {
  343|   164k|         indent_stack.clear();
  344|   164k|         anchors.clear();
  345|   164k|         active_alias_spans.clear();
  346|   164k|         sequence_item_value_context = false;
  347|   164k|         forced_block_mapping_indent = -1;
  348|   164k|         sequence_dash_indent = -1;
  349|   164k|         explicit_mapping_key_context = false;
  350|   164k|         allow_indentless_sequence = false;
  351|   164k|         reset_line_memo();
  352|   164k|      }
_ZNK3glz4yaml12yaml_context15reset_line_memoEv:
  328|   164k|      {
  329|   164k|         memo_line_begin = nullptr;
  330|   164k|         memo_verified_end = nullptr;
  331|   164k|         memo_first_tab = nullptr;
  332|   164k|         memo_first_content = nullptr;
  333|   164k|      }
_ZN3glz4yaml19skip_document_startIRPKcS3_NS0_12yaml_contextEEEvOT_T0_RT1_:
 1205|   164k|   {
 1206|   164k|      ctx.secondary_tag_handle_overridden = false;
 1207|       |
 1208|       |      // Skip leading blank/comment-only lines before directives or document start.
 1209|   170k|      while (it != end) {
  ------------------
  |  Branch (1209:14): [True: 170k, False: 78]
  ------------------
 1210|   170k|         auto line = it;
 1211|   170k|         skip_inline_ws(line, end);
 1212|   170k|         if (line == end) {
  ------------------
  |  Branch (1212:14): [True: 18, False: 170k]
  ------------------
 1213|     18|            it = line;
 1214|     18|            break;
 1215|     18|         }
 1216|   170k|         if (*line == '#') {
  ------------------
  |  Branch (1216:14): [True: 1.25k, False: 169k]
  ------------------
 1217|  1.25k|            it = line;
 1218|  1.25k|            skip_comment(it, end);
 1219|  1.25k|            skip_newline(it, end);
 1220|  1.25k|            continue;
 1221|  1.25k|         }
 1222|   169k|         if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1222:14): [True: 2.09k, False: 167k]
  |  Branch (1222:31): [True: 3.07k, False: 164k]
  ------------------
 1223|  5.16k|            it = line;
 1224|  5.16k|            skip_newline(it, end);
 1225|  5.16k|            continue;
 1226|  5.16k|         }
 1227|   164k|         it = line;
 1228|   164k|         break;
 1229|   169k|      }
 1230|       |
 1231|       |      // Track if we've seen a %YAML directive (duplicates are an error per spec)
 1232|   164k|      bool seen_yaml_directive = false;
 1233|   164k|      bool saw_any_directive = false;
 1234|   164k|      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|   169k|      while (it != end && *it == '%') {
  ------------------
  |  Branch (1238:14): [True: 169k, False: 658]
  |  Branch (1238:27): [True: 5.70k, False: 163k]
  ------------------
 1239|  5.70k|         saw_any_directive = true;
 1240|  5.70k|         ++it; // Skip the '%'
 1241|       |
 1242|       |         // Parse directive name
 1243|  5.70k|         auto name_start = it;
 1244|  25.1k|         while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1244:17): [True: 24.9k, False: 212]
  |  Branch (1244:30): [True: 23.1k, False: 1.74k]
  |  Branch (1244:44): [True: 20.7k, False: 2.44k]
  |  Branch (1244:59): [True: 20.1k, False: 632]
  |  Branch (1244:74): [True: 19.4k, False: 672]
  ------------------
 1245|  19.4k|            ++it;
 1246|  19.4k|         }
 1247|  5.70k|         std::string_view directive_name(name_start, static_cast<size_t>(it - name_start));
 1248|       |
 1249|       |         // Check for %YAML directive
 1250|  5.70k|         if (directive_name == "YAML") {
  ------------------
  |  Branch (1250:14): [True: 204, False: 5.49k]
  ------------------
 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|    352|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1296:20): [True: 344, False: 8]
  |  Branch (1296:33): [True: 268, False: 76]
  |  Branch (1296:47): [True: 268, False: 0]
  ------------------
 1297|    268|               ++it;
 1298|    268|            }
 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|    452|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1312:20): [True: 440, False: 12]
  |  Branch (1312:34): [True: 192, False: 248]
  |  Branch (1312:48): [True: 192, False: 56]
  ------------------
 1313|    384|               ++it;
 1314|    384|            }
 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.49k|         else if (directive_name == "TAG") {
  ------------------
  |  Branch (1320:19): [True: 2.59k, False: 2.90k]
  ------------------
 1321|  6.72k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1321:20): [True: 6.70k, False: 20]
  |  Branch (1321:34): [True: 2.20k, False: 4.49k]
  |  Branch (1321:48): [True: 1.92k, False: 2.57k]
  ------------------
 1322|  4.13k|               ++it;
 1323|  4.13k|            }
 1324|       |
 1325|  2.59k|            auto handle_start = it;
 1326|  10.5k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1326:20): [True: 10.4k, False: 74]
  |  Branch (1326:33): [True: 8.26k, False: 2.23k]
  |  Branch (1326:47): [True: 7.98k, False: 280]
  |  Branch (1326:62): [True: 7.97k, False: 4]
  |  Branch (1326:77): [True: 7.97k, False: 4]
  ------------------
 1327|  7.97k|               ++it;
 1328|  7.97k|            }
 1329|  2.59k|            const std::string_view handle(handle_start, static_cast<size_t>(it - handle_start));
 1330|       |
 1331|  5.88k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1331:20): [True: 5.79k, False: 92]
  |  Branch (1331:34): [True: 2.84k, False: 2.94k]
  |  Branch (1331:48): [True: 444, False: 2.50k]
  ------------------
 1332|  3.29k|               ++it;
 1333|  3.29k|            }
 1334|       |
 1335|  2.59k|            auto prefix_start = it;
 1336|  16.4k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1336:20): [True: 16.2k, False: 154]
  |  Branch (1336:33): [True: 14.8k, False: 1.40k]
  |  Branch (1336:47): [True: 14.6k, False: 208]
  |  Branch (1336:62): [True: 14.0k, False: 596]
  |  Branch (1336:77): [True: 13.8k, False: 228]
  ------------------
 1337|  13.8k|               ++it;
 1338|  13.8k|            }
 1339|  2.59k|            const std::string_view prefix(prefix_start, static_cast<size_t>(it - prefix_start));
 1340|       |
 1341|  2.59k|            if (handle.empty() || prefix.empty()) {
  ------------------
  |  Branch (1341:17): [True: 28, False: 2.56k]
  |  Branch (1341:35): [True: 72, False: 2.49k]
  ------------------
 1342|    100|               ctx.error = error_code::syntax_error;
 1343|    100|               return;
 1344|    100|            }
 1345|       |
 1346|  2.49k|            if (handle == "!!") {
  ------------------
  |  Branch (1346:17): [True: 682, False: 1.81k]
  ------------------
 1347|    682|               ctx.secondary_tag_handle_overridden = (prefix != "tag:yaml.org,2002:");
 1348|    682|            }
 1349|  2.49k|         }
 1350|       |         // %TAG and other directives are silently skipped (per spec: should be ignored)
 1351|       |
 1352|       |         // Skip to end of directive line
 1353|  60.0k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1353:17): [True: 59.5k, False: 452]
  |  Branch (1353:30): [True: 56.4k, False: 3.08k]
  |  Branch (1353:45): [True: 54.5k, False: 1.88k]
  ------------------
 1354|  54.5k|            ++it;
 1355|  54.5k|         }
 1356|       |         // Skip the newline
 1357|  5.42k|         skip_newline(it, end);
 1358|       |         // Skip blank and comment-only lines between directives and document start.
 1359|  7.40k|         while (it != end) {
  ------------------
  |  Branch (1359:17): [True: 6.85k, False: 552]
  ------------------
 1360|  6.85k|            auto line = it;
 1361|  6.85k|            skip_inline_ws(line, end);
 1362|  6.85k|            if (line == end) {
  ------------------
  |  Branch (1362:17): [True: 10, False: 6.84k]
  ------------------
 1363|     10|               it = line;
 1364|     10|               break;
 1365|     10|            }
 1366|  6.84k|            if (*line == '#') {
  ------------------
  |  Branch (1366:17): [True: 692, False: 6.15k]
  ------------------
 1367|    692|               it = line;
 1368|    692|               skip_comment(it, end);
 1369|    692|               skip_newline(it, end);
 1370|    692|               continue;
 1371|    692|            }
 1372|  6.15k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1372:17): [True: 516, False: 5.63k]
  |  Branch (1372:34): [True: 768, False: 4.86k]
  ------------------
 1373|  1.28k|               it = line;
 1374|  1.28k|               skip_newline(it, end);
 1375|  1.28k|               continue;
 1376|  1.28k|            }
 1377|  4.86k|            break;
 1378|  6.15k|         }
 1379|  5.42k|      }
 1380|       |
 1381|       |      // Check for ---
 1382|   164k|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1382:11): [True: 162k, False: 2.09k]
  |  Branch (1382:28): [True: 4.55k, False: 157k]
  |  Branch (1382:44): [True: 314, False: 4.23k]
  |  Branch (1382:60): [True: 268, False: 46]
  ------------------
 1383|    268|         auto after = it + 3;
 1384|       |         // Must be followed by whitespace, newline, or end
 1385|    268|         if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' || *after == '#') {
  ------------------
  |  Branch (1385:14): [True: 4, False: 264]
  |  Branch (1385:30): [True: 44, False: 220]
  |  Branch (1385:47): [True: 72, False: 148]
  |  Branch (1385:65): [True: 44, False: 104]
  |  Branch (1385:83): [True: 28, False: 76]
  |  Branch (1385:101): [True: 28, False: 48]
  ------------------
 1386|    220|            auto content = after;
 1387|    676|            while (content != end && (*content == ' ' || *content == '\t')) {
  ------------------
  |  Branch (1387:20): [True: 654, False: 22]
  |  Branch (1387:39): [True: 216, False: 438]
  |  Branch (1387:58): [True: 240, False: 198]
  ------------------
 1388|    456|               ++content;
 1389|    456|            }
 1390|       |            // Per yaml-test-suite, block mappings cannot begin on the same line as '---'.
 1391|    220|            if (content != end && *content != '\n' && *content != '\r' && *content != '#' &&
  ------------------
  |  Branch (1391:17): [True: 198, False: 22]
  |  Branch (1391:35): [True: 154, False: 44]
  |  Branch (1391:55): [True: 122, False: 32]
  |  Branch (1391:75): [True: 94, False: 28]
  ------------------
 1392|     94|                line_could_be_block_mapping(content, end)) {
  ------------------
  |  Branch (1392:17): [True: 22, False: 72]
  ------------------
 1393|     22|               ctx.error = error_code::syntax_error;
 1394|     22|               return;
 1395|     22|            }
 1396|    198|            consumed_document_start = true;
 1397|    198|            it = after;
 1398|       |            // Skip rest of line (whitespace and optional comment)
 1399|    198|            skip_ws_and_comment(it, end);
 1400|    198|            skip_newline(it, end);
 1401|    198|         }
 1402|    268|      }
 1403|       |
 1404|       |      // A directives section must be followed by a document start marker.
 1405|   164k|      if (saw_any_directive && !consumed_document_start) {
  ------------------
  |  Branch (1405:11): [True: 784, False: 163k]
  |  Branch (1405:32): [True: 762, False: 22]
  ------------------
 1406|    762|         ctx.error = error_code::syntax_error;
 1407|    762|         return;
 1408|    762|      }
 1409|   164k|   }
_ZN3glz4yaml14skip_inline_wsIRPKcS3_EEvOT_T0_:
  901|   160M|   {
  902|   197M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (902:14): [True: 196M, False: 988k]
  |  Branch (902:28): [True: 35.8M, False: 160M]
  |  Branch (902:42): [True: 1.16M, False: 159M]
  ------------------
  903|  37.0M|         ++it;
  904|  37.0M|      }
  905|   160M|   }
_ZN3glz4yaml12skip_commentIRPKcS3_EEvOT_T0_:
  910|  9.96M|   {
  911|  9.96M|      if (it != end && *it == '#') {
  ------------------
  |  Branch (911:11): [True: 9.29M, False: 667k]
  |  Branch (911:24): [True: 1.61M, False: 7.67M]
  ------------------
  912|       |         // Stops on a forbidden control byte rather than consuming it, leaving the
  913|       |         // caller's line-end validation to reject the document.
  914|   124M|         while (it != end && !comment_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (914:17): [True: 124M, False: 62.1k]
  |  Branch (914:30): [True: 122M, False: 1.55M]
  ------------------
  915|   122M|            ++it;
  916|   122M|         }
  917|  1.61M|      }
  918|  9.96M|   }
_ZN3glz4yaml27line_could_be_block_mappingIPKcS3_EEbT_T0_:
 1116|  3.31M|   {
 1117|  3.31M|      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.31M|      bool at_node_start = true;
 1125|  3.31M|      bool prev_was_whitespace = true; // For the '#' rule, which is about the preceding character
 1126|  3.31M|      int flow_depth = 0;
 1127|  42.8M|      while (it != stop) {
  ------------------
  |  Branch (1127:14): [True: 42.5M, False: 306k]
  ------------------
 1128|  42.5M|         const char c = *it;
 1129|  42.5M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1129:14): [True: 609k, False: 41.8M]
  |  Branch (1129:27): [True: 990k, False: 40.9M]
  ------------------
 1130|  1.60M|            return false;
 1131|  1.60M|         }
 1132|  40.9M|         if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1132:14): [True: 5.82M, False: 35.0M]
  |  Branch (1132:26): [True: 707k, False: 34.3M]
  ------------------
 1133|  6.52M|            prev_was_whitespace = true; // Whitespace separates nodes, it does not end one
 1134|  6.52M|            ++it;
 1135|  6.52M|            continue;
 1136|  6.52M|         }
 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.3M|         const bool after_whitespace = std::exchange(prev_was_whitespace, false);
 1141|  34.3M|         const bool node_start = std::exchange(at_node_start, false);
 1142|       |
 1143|  34.3M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (1143:14): [True: 2.94M, False: 31.4M]
  |  Branch (1143:26): [True: 2.17M, False: 775k]
  ------------------
 1144|  2.17M|            ++it;
 1145|       |            // Colon followed by space, newline, or end indicates a mapping key
 1146|  2.17M|            if (it == end || *it == ' ' || *it == '\t' || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1146:17): [True: 103k, False: 2.06M]
  |  Branch (1146:30): [True: 807k, False: 1.26M]
  |  Branch (1146:44): [True: 57.7k, False: 1.20M]
  |  Branch (1146:59): [True: 122k, False: 1.08M]
  |  Branch (1146:74): [True: 176k, False: 904k]
  ------------------
 1147|  1.26M|               return true;
 1148|  1.26M|            }
 1149|       |            // Otherwise this ':' is part of plain content (e.g., "::", "http://").
 1150|       |            // Continue scanning for a later mapping separator on the same line.
 1151|   904k|            continue;
 1152|  2.17M|         }
 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.2M|         if (c == '#' && flow_depth == 0 && after_whitespace) {
  ------------------
  |  Branch (1155:14): [True: 870k, False: 31.3M]
  |  Branch (1155:26): [True: 764k, False: 105k]
  |  Branch (1155:45): [True: 106k, False: 658k]
  ------------------
 1156|   106k|            return false;
 1157|   106k|         }
 1158|  32.0M|         if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (1158:15): [True: 379k, False: 31.7M]
  |  Branch (1158:27): [True: 67.8k, False: 31.6M]
  |  Branch (1158:41): [True: 272k, False: 174k]
  ------------------
 1159|   272k|            if (not skip_probe_quoted_scalar(it, stop)) {
  ------------------
  |  Branch (1159:17): [True: 29.8k, False: 243k]
  ------------------
 1160|  29.8k|               return false;
 1161|  29.8k|            }
 1162|   243k|            continue;
 1163|   272k|         }
 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|  31.8M|         if ((c == '[' || c == '{') && (node_start || flow_depth > 0)) {
  ------------------
  |  Branch (1167:15): [True: 431k, False: 31.3M]
  |  Branch (1167:27): [True: 837k, False: 30.5M]
  |  Branch (1167:41): [True: 950k, False: 318k]
  |  Branch (1167:55): [True: 129k, False: 189k]
  ------------------
 1168|  1.07M|            ++flow_depth;
 1169|  1.07M|            at_node_start = true;
 1170|  1.07M|            ++it;
 1171|  1.07M|            continue;
 1172|  1.07M|         }
 1173|  30.7M|         if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (1173:15): [True: 175k, False: 30.5M]
  |  Branch (1173:27): [True: 480k, False: 30.0M]
  |  Branch (1173:40): [True: 202k, False: 452k]
  ------------------
 1174|   202k|            --flow_depth; // A closing bracket ends a node; it never starts one
 1175|   202k|            ++it;
 1176|   202k|            continue;
 1177|   202k|         }
 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.5M|         if (flow_depth > 0 && (c == ',' || c == ':')) {
  ------------------
  |  Branch (1181:14): [True: 6.88M, False: 23.6M]
  |  Branch (1181:33): [True: 489k, False: 6.39M]
  |  Branch (1181:45): [True: 775k, False: 5.62M]
  ------------------
 1182|  1.26M|            at_node_start = true;
 1183|  1.26M|            ++it;
 1184|  1.26M|            continue;
 1185|  1.26M|         }
 1186|  29.2M|         if (node_start && skip_probe_node_property(it, stop)) {
  ------------------
  |  Branch (1186:14): [True: 4.43M, False: 24.8M]
  |  Branch (1186:28): [True: 1.42M, False: 3.01M]
  ------------------
 1187|  1.42M|            at_node_start = true; // Properties precede the node, so it is still starting
 1188|  1.42M|            continue;
 1189|  1.42M|         }
 1190|  27.8M|         ++it;
 1191|  27.8M|      }
 1192|   306k|      return false;
 1193|  3.31M|   }
_ZN3glz4yaml21implicit_key_scan_endIPKcS3_EET_S4_T0_:
   89|  17.5M|   {
   90|  17.5M|      const size_t remaining = size_t(end - it);
   91|  17.5M|      return it + (remaining < max_implicit_key_lookahead ? remaining : max_implicit_key_lookahead);
  ------------------
  |  Branch (91:20): [True: 13.7M, False: 3.77M]
  ------------------
   92|  17.5M|   }
_ZN3glz4yaml24skip_probe_quoted_scalarIPKcS3_EEbRT_T0_:
 1049|  2.26M|   {
 1050|  2.26M|      const char quote = *it;
 1051|  2.26M|      ++it;
 1052|  10.0M|      while (it != stop) {
  ------------------
  |  Branch (1052:14): [True: 10.0M, False: 17.1k]
  ------------------
 1053|  10.0M|         const char c = *it;
 1054|  10.0M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1054:14): [True: 22.5k, False: 10.0M]
  |  Branch (1054:27): [True: 60.7k, False: 9.98M]
  ------------------
 1055|  83.2k|            return false;
 1056|  83.2k|         }
 1057|  9.98M|         if (c == quote) {
  ------------------
  |  Branch (1057:14): [True: 2.15M, False: 7.82M]
  ------------------
 1058|  2.15M|            ++it;
 1059|  2.15M|            if (quote == '\'' && it != stop && *it == '\'') {
  ------------------
  |  Branch (1059:17): [True: 201k, False: 1.95M]
  |  Branch (1059:34): [True: 196k, False: 4.56k]
  |  Branch (1059:48): [True: 29.2k, False: 167k]
  ------------------
 1060|  29.2k|               ++it; // '' is an escaped quote, not the end of the scalar
 1061|  29.2k|               continue;
 1062|  29.2k|            }
 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.12M|            return true;
 1067|  2.15M|         }
 1068|  7.82M|         if (c == '\\' && quote == '"') {
  ------------------
  |  Branch (1068:14): [True: 84.0k, False: 7.74M]
  |  Branch (1068:27): [True: 78.2k, False: 5.86k]
  ------------------
 1069|  78.2k|            ++it; // Skip escape character
 1070|  78.2k|            if (it == stop) {
  ------------------
  |  Branch (1070:17): [True: 6.76k, False: 71.4k]
  ------------------
 1071|  6.76k|               return false;
 1072|  6.76k|            }
 1073|  71.4k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1073:17): [True: 10.4k, False: 61.0k]
  |  Branch (1073:32): [True: 16.2k, False: 44.7k]
  ------------------
 1074|  26.7k|               return false;
 1075|  26.7k|            }
 1076|  71.4k|         }
 1077|  7.79M|         ++it;
 1078|  7.79M|      }
 1079|  17.1k|      return false;
 1080|  2.26M|   }
_ZN3glz4yaml24skip_probe_node_propertyIPKcS3_EEbRT_T0_:
 1088|  23.5M|   {
 1089|  23.5M|      const char c = *it;
 1090|  23.5M|      if (c == '&' || c == '!') {
  ------------------
  |  Branch (1090:11): [True: 2.96M, False: 20.5M]
  |  Branch (1090:23): [True: 1.41M, False: 19.1M]
  ------------------
 1091|       |         // An anchor name and a tag shorthand both run to the next whitespace or flow indicator.
 1092|  4.38M|         ++it;
 1093|   863M|         while (it != stop && *it != ' ' && *it != '\t' && *it != ',' && *it != '[' && *it != ']' && *it != '{' &&
  ------------------
  |  Branch (1093:17): [True: 863M, False: 183k]
  |  Branch (1093:31): [True: 861M, False: 2.41M]
  |  Branch (1093:45): [True: 860M, False: 645k]
  |  Branch (1093:60): [True: 860M, False: 72.1k]
  |  Branch (1093:74): [True: 860M, False: 92.6k]
  |  Branch (1093:88): [True: 860M, False: 29.2k]
  |  Branch (1093:102): [True: 860M, False: 403k]
  ------------------
 1094|   860M|                *it != '}' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1094:17): [True: 860M, False: 92.7k]
  |  Branch (1094:31): [True: 859M, False: 214k]
  |  Branch (1094:46): [True: 859M, False: 232k]
  ------------------
 1095|   859M|            ++it;
 1096|   859M|         }
 1097|  4.38M|         return true;
 1098|  4.38M|      }
 1099|       |      // Only "? " is the explicit key indicator; "?foo" is an ordinary plain scalar.
 1100|  19.1M|      if (c == '?') {
  ------------------
  |  Branch (1100:11): [True: 1.14M, False: 17.9M]
  ------------------
 1101|  1.14M|         const auto next = it + 1;
 1102|  1.14M|         if (next != stop && (*next == ' ' || *next == '\t')) {
  ------------------
  |  Branch (1102:14): [True: 1.13M, False: 13.0k]
  |  Branch (1102:31): [True: 277k, False: 857k]
  |  Branch (1102:47): [True: 3.32k, False: 854k]
  ------------------
 1103|   281k|            ++it;
 1104|   281k|            return true;
 1105|   281k|         }
 1106|  1.14M|      }
 1107|  18.8M|      return false;
 1108|  19.1M|   }
_ZN3glz4yaml19skip_ws_and_commentIRPKcS3_EEvOT_T0_:
  923|  2.82M|   {
  924|  2.82M|      skip_inline_ws(it, end);
  925|  2.82M|      skip_comment(it, end);
  926|  2.82M|   }
_ZN3glz4yaml17at_document_startIRPKcS3_EEbOT_T0_:
 1415|  8.55M|   {
 1416|  8.55M|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1416:11): [True: 8.27M, False: 277k]
  |  Branch (1416:28): [True: 464k, False: 7.81M]
  |  Branch (1416:44): [True: 34.0k, False: 430k]
  |  Branch (1416:60): [True: 25.5k, False: 8.52k]
  ------------------
 1417|  25.5k|         auto after = it + 3;
 1418|  25.5k|         return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r';
  ------------------
  |  Branch (1418:17): [True: 4.34k, False: 21.1k]
  |  Branch (1418:33): [True: 5.46k, False: 15.7k]
  |  Branch (1418:50): [True: 3.03k, False: 12.6k]
  |  Branch (1418:68): [True: 4.27k, False: 8.42k]
  |  Branch (1418:86): [True: 1.07k, False: 7.35k]
  ------------------
 1419|  25.5k|      }
 1420|  8.53M|      return false;
 1421|  8.55M|   }
_ZN3glz4yaml15at_document_endIRPKcS3_EEbOT_T0_:
 1427|  10.8M|   {
 1428|  10.8M|      if (end - it >= 3 && it[0] == '.' && it[1] == '.' && it[2] == '.') {
  ------------------
  |  Branch (1428:11): [True: 10.4M, False: 388k]
  |  Branch (1428:28): [True: 202k, False: 10.2M]
  |  Branch (1428:44): [True: 141k, False: 60.8k]
  |  Branch (1428:60): [True: 114k, False: 27.1k]
  ------------------
 1429|   114k|         auto after = it + 3;
 1430|   297k|         while (after != end && (*after == ' ' || *after == '\t')) ++after;
  ------------------
  |  Branch (1430:17): [True: 258k, False: 38.8k]
  |  Branch (1430:34): [True: 97.1k, False: 161k]
  |  Branch (1430:51): [True: 85.9k, False: 75.1k]
  ------------------
 1431|   114k|         return after == end || *after == '\n' || *after == '\r' || *after == '#';
  ------------------
  |  Branch (1431:17): [True: 38.8k, False: 75.1k]
  |  Branch (1431:33): [True: 25.4k, False: 49.7k]
  |  Branch (1431:51): [True: 14.2k, False: 35.4k]
  |  Branch (1431:69): [True: 14.0k, False: 21.3k]
  ------------------
 1432|   114k|      }
 1433|  10.7M|      return false;
 1434|  10.8M|   }
_ZN3glz4yaml25skip_ws_newlines_commentsIRPKcS3_EEvOT_T0_:
  966|  19.5M|   {
  967|  21.6M|      while (it != end) {
  ------------------
  |  Branch (967:14): [True: 21.6M, False: 1.07k]
  ------------------
  968|  21.6M|         if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (968:14): [True: 1.83M, False: 19.8M]
  |  Branch (968:28): [True: 31.3k, False: 19.8M]
  ------------------
  969|  1.86M|            ++it;
  970|  1.86M|         }
  971|  19.8M|         else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (971:19): [True: 106k, False: 19.7M]
  |  Branch (971:34): [True: 136k, False: 19.5M]
  ------------------
  972|   242k|            skip_newline(it, end);
  973|   242k|         }
  974|  19.5M|         else if (*it == '#') {
  ------------------
  |  Branch (974:19): [True: 51.1k, False: 19.5M]
  ------------------
  975|  51.1k|            skip_comment(it, end);
  976|  51.1k|         }
  977|  19.5M|         else {
  978|  19.5M|            break;
  979|  19.5M|         }
  980|  21.6M|      }
  981|  19.5M|   }
_ZN3glz4yaml17parse_anchor_nameIPKcS3_EENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEERT_T0_:
 1515|  19.0M|   {
 1516|  19.0M|      auto start = it;
 1517|  19.0M|      if (start == end) return {};
  ------------------
  |  Branch (1517:11): [True: 3.71k, False: 18.9M]
  ------------------
 1518|  3.34G|      while (it != end) {
  ------------------
  |  Branch (1518:14): [True: 3.34G, False: 239k]
  ------------------
 1519|  3.34G|         const char c = *it;
 1520|       |         // Per YAML, anchor names end at whitespace or flow indicators.
 1521|       |         // Colon is allowed in anchor names.
 1522|  3.34G|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == '[' || c == ']' || c == '{' ||
  ------------------
  |  Branch (1522:14): [True: 10.1M, False: 3.33G]
  |  Branch (1522:26): [True: 320k, False: 3.33G]
  |  Branch (1522:39): [True: 1.55M, False: 3.33G]
  |  Branch (1522:52): [True: 1.10M, False: 3.33G]
  |  Branch (1522:65): [True: 796k, False: 3.33G]
  |  Branch (1522:77): [True: 123k, False: 3.33G]
  |  Branch (1522:89): [True: 59.5k, False: 3.33G]
  |  Branch (1522:101): [True: 2.01M, False: 3.33G]
  ------------------
 1523|  3.33G|             c == '}') {
  ------------------
  |  Branch (1523:14): [True: 2.60M, False: 3.32G]
  ------------------
 1524|  18.7M|            break;
 1525|  18.7M|         }
 1526|  3.32G|         ++it;
 1527|  3.32G|      }
 1528|  18.9M|      return std::string_view(&*start, static_cast<size_t>(it - start));
 1529|  19.0M|   }
_ZNK3glz4yaml12yaml_context23transparent_string_hashclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  138|  74.7M|         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.7M|         bool operator()(std::string_view lhs, std::string_view rhs) const noexcept { return lhs == rhs; }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_NS0_12yaml_contextEEENS0_8yaml_tagERT_T0_RKT1_:
  852|  38.2M|   {
  853|  38.2M|      return parse_yaml_tag(it, end, !ctx.secondary_tag_handle_overridden);
  854|  38.2M|   }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_EENS0_8yaml_tagERT_T0_b:
  733|  38.2M|   {
  734|  38.2M|      if (it == end || *it != '!') {
  ------------------
  |  Branch (734:11): [True: 0, False: 38.2M]
  |  Branch (734:24): [True: 35.7M, False: 2.54M]
  ------------------
  735|  35.7M|         return yaml_tag::none;
  736|  35.7M|      }
  737|       |
  738|  2.54M|      ++it; // skip first !
  739|       |
  740|  2.54M|      if (it == end) {
  ------------------
  |  Branch (740:11): [True: 778, False: 2.54M]
  ------------------
  741|    778|         return yaml_tag::unknown;
  742|    778|      }
  743|       |
  744|       |      // Check for !! (shorthand tag)
  745|  2.54M|      if (*it == '!') {
  ------------------
  |  Branch (745:11): [True: 1.46M, False: 1.07M]
  ------------------
  746|  1.46M|         ++it; // skip second !
  747|       |
  748|       |         // Read tag name
  749|  1.46M|         auto tag_start = it;
  750|   753M|         while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (750:17): [True: 753M, False: 6.79k]
  |  Branch (750:30): [True: 752M, False: 1.46M]
  ------------------
  751|   752M|            ++it;
  752|   752M|         }
  753|       |
  754|  1.46M|         std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  755|  1.46M|         if (tag_name.empty() || malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (755:14): [True: 948, False: 1.46M]
  |  Branch (755:34): [True: 0, False: 1.46M]
  ------------------
  756|    948|            return yaml_tag::unknown;
  757|    948|         }
  758|  1.46M|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (758:14): [True: 1.46M, False: 6.25k]
  |  Branch (758:27): [True: 512, False: 1.46M]
  ------------------
  759|    512|            return yaml_tag::unknown;
  760|    512|         }
  761|       |
  762|       |         // Skip whitespace after tag
  763|  4.83M|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (763:17): [True: 4.82M, False: 9.97k]
  |  Branch (763:31): [True: 2.66M, False: 2.16M]
  |  Branch (763:45): [True: 701k, False: 1.45M]
  ------------------
  764|  3.36M|            ++it;
  765|  3.36M|         }
  766|       |
  767|  1.46M|         if (!allow_core_schema_secondary_handle) {
  ------------------
  |  Branch (767:14): [True: 30, False: 1.46M]
  ------------------
  768|     30|            return yaml_tag::none;
  769|     30|         }
  770|       |
  771|       |         // Match known tags
  772|  1.46M|         if (tag_name == "str") return yaml_tag::str;
  ------------------
  |  Branch (772:14): [True: 46.6k, False: 1.42M]
  ------------------
  773|  1.42M|         if (tag_name == "int") return yaml_tag::int_tag;
  ------------------
  |  Branch (773:14): [True: 27.3k, False: 1.39M]
  ------------------
  774|  1.39M|         if (tag_name == "float") return yaml_tag::float_tag;
  ------------------
  |  Branch (774:14): [True: 23.5k, False: 1.37M]
  ------------------
  775|  1.37M|         if (tag_name == "bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (775:14): [True: 175k, False: 1.19M]
  ------------------
  776|  1.19M|         if (tag_name == "null") return yaml_tag::null_tag;
  ------------------
  |  Branch (776:14): [True: 8.90k, False: 1.18M]
  ------------------
  777|  1.18M|         if (tag_name == "map") return yaml_tag::map;
  ------------------
  |  Branch (777:14): [True: 232k, False: 953k]
  ------------------
  778|   953k|         if (tag_name == "seq") return yaml_tag::seq;
  ------------------
  |  Branch (778:14): [True: 229k, False: 724k]
  ------------------
  779|       |
  780|       |         // Unrecognized shorthand tag (e.g., !!omap) — ignore and parse value normally
  781|   724k|         return yaml_tag::none;
  782|   953k|      }
  783|       |
  784|       |      // Check for verbatim tag !<...>
  785|  1.07M|      if (*it == '<') {
  ------------------
  |  Branch (785:11): [True: 10.4k, False: 1.06M]
  ------------------
  786|  10.4k|         ++it;
  787|  10.4k|         auto tag_start = it;
  788|  3.78M|         while (it != end && *it != '>') {
  ------------------
  |  Branch (788:17): [True: 3.78M, False: 362]
  |  Branch (788:30): [True: 3.77M, False: 10.0k]
  ------------------
  789|  3.77M|            ++it;
  790|  3.77M|         }
  791|  10.4k|         if (it == end) {
  ------------------
  |  Branch (791:14): [True: 362, False: 10.0k]
  ------------------
  792|    362|            return yaml_tag::unknown;
  793|    362|         }
  794|       |
  795|  10.0k|         std::string_view tag_uri(tag_start, static_cast<size_t>(it - tag_start));
  796|  10.0k|         if (tag_uri.empty() || malformed_tag_token(tag_uri)) {
  ------------------
  |  Branch (796:14): [True: 194, False: 9.88k]
  |  Branch (796:33): [True: 396, False: 9.48k]
  ------------------
  797|    590|            return yaml_tag::unknown;
  798|    590|         }
  799|  9.48k|         ++it; // skip >
  800|  9.48k|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (800:14): [True: 7.99k, False: 1.49k]
  |  Branch (800:27): [True: 338, False: 7.65k]
  ------------------
  801|    338|            return yaml_tag::unknown;
  802|    338|         }
  803|       |
  804|       |         // Skip whitespace after tag
  805|  15.1k|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (805:17): [True: 13.2k, False: 1.85k]
  |  Branch (805:31): [True: 4.19k, False: 9.10k]
  |  Branch (805:45): [True: 1.80k, False: 7.29k]
  ------------------
  806|  6.00k|            ++it;
  807|  6.00k|         }
  808|       |
  809|       |         // Match known YAML 1.2 URIs
  810|  9.15k|         if (tag_uri == "tag:yaml.org,2002:str") return yaml_tag::str;
  ------------------
  |  Branch (810:14): [True: 1.30k, False: 7.85k]
  ------------------
  811|  7.85k|         if (tag_uri == "tag:yaml.org,2002:int") return yaml_tag::int_tag;
  ------------------
  |  Branch (811:14): [True: 194, False: 7.65k]
  ------------------
  812|  7.65k|         if (tag_uri == "tag:yaml.org,2002:float") return yaml_tag::float_tag;
  ------------------
  |  Branch (812:14): [True: 438, False: 7.21k]
  ------------------
  813|  7.21k|         if (tag_uri == "tag:yaml.org,2002:bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (813:14): [True: 194, False: 7.02k]
  ------------------
  814|  7.02k|         if (tag_uri == "tag:yaml.org,2002:null") return yaml_tag::null_tag;
  ------------------
  |  Branch (814:14): [True: 190, False: 6.83k]
  ------------------
  815|  6.83k|         if (tag_uri == "tag:yaml.org,2002:map") return yaml_tag::map;
  ------------------
  |  Branch (815:14): [True: 450, False: 6.38k]
  ------------------
  816|  6.38k|         if (tag_uri == "tag:yaml.org,2002:seq") return yaml_tag::seq;
  ------------------
  |  Branch (816:14): [True: 194, False: 6.19k]
  ------------------
  817|       |
  818|       |         // Unrecognized verbatim tag — ignore and parse value normally
  819|  6.19k|         return yaml_tag::none;
  820|  6.38k|      }
  821|       |
  822|       |      // Named tag !name - skip it and read name
  823|  1.06M|      auto tag_start = it;
  824|  85.0M|      while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (824:14): [True: 85.0M, False: 3.65k]
  |  Branch (824:27): [True: 83.9M, False: 1.06M]
  ------------------
  825|  83.9M|         ++it;
  826|  83.9M|      }
  827|  1.06M|      std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  828|  1.06M|      if (!tag_name.empty() && malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (828:11): [True: 733k, False: 333k]
  |  Branch (828:32): [True: 0, False: 733k]
  ------------------
  829|      0|         return yaml_tag::unknown;
  830|      0|      }
  831|  1.06M|      if (!tag_name.empty() && it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (831:11): [True: 733k, False: 333k]
  |  Branch (831:32): [True: 729k, False: 3.65k]
  |  Branch (831:45): [True: 762, False: 728k]
  ------------------
  832|    762|         return yaml_tag::unknown;
  833|    762|      }
  834|       |
  835|       |      // Skip whitespace after tag
  836|  2.87M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (836:14): [True: 2.87M, False: 8.46k]
  |  Branch (836:28): [True: 1.52M, False: 1.34M]
  |  Branch (836:42): [True: 292k, False: 1.05M]
  ------------------
  837|  1.81M|         ++it;
  838|  1.81M|      }
  839|       |
  840|       |      // Unrecognized named tag — ignore and parse value normally
  841|  1.06M|      return yaml_tag::none;
  842|  1.06M|   }
_ZN3glz4yaml19malformed_tag_tokenENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  711|  2.21M|   {
  712|       |      // Reject obviously malformed tag tokens used by conformance tests.
  713|       |      // Unknown-but-well-formed tags are still ignored.
  714|   840M|      for (const char c : token) {
  ------------------
  |  Branch (714:25): [True: 840M, False: 2.21M]
  ------------------
  715|   840M|         if (c == '{' || c == '}') return true;
  ------------------
  |  Branch (715:14): [True: 198, False: 840M]
  |  Branch (715:26): [True: 198, False: 840M]
  ------------------
  716|   840M|      }
  717|  2.21M|      return false;
  718|  2.21M|   }
_ZN3glz4yaml25malformed_tag_terminationEc:
  721|  2.20M|   {
  722|  2.20M|      return !(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}');
  ------------------
  |  Branch (722:16): [True: 947k, False: 1.25M]
  |  Branch (722:28): [True: 754k, False: 497k]
  |  Branch (722:41): [True: 85.5k, False: 412k]
  |  Branch (722:54): [True: 104k, False: 308k]
  |  Branch (722:67): [True: 127k, False: 180k]
  |  Branch (722:79): [True: 135k, False: 44.1k]
  |  Branch (722:91): [True: 3.24k, False: 40.9k]
  |  Branch (722:103): [True: 39.2k, False: 1.61k]
  ------------------
  723|  2.20M|   }
_ZN3glz4yaml20tag_valid_for_stringENS0_8yaml_tagE:
  858|  20.2M|   {
  859|  20.2M|      return tag == yaml_tag::none || tag == yaml_tag::str;
  ------------------
  |  Branch (859:14): [True: 20.1M, False: 8.99k]
  |  Branch (859:39): [True: 8.83k, False: 162]
  ------------------
  860|  20.2M|   }
_ZN3glz4yaml17tag_valid_for_mapENS0_8yaml_tagE:
  894|  9.21M|   {
  895|  9.21M|      return tag == yaml_tag::none || tag == yaml_tag::map;
  ------------------
  |  Branch (895:14): [True: 9.20M, False: 3.85k]
  |  Branch (895:39): [True: 3.81k, False: 36]
  ------------------
  896|  9.21M|   }
_ZNK3glz4yaml12yaml_context23alias_span_is_replayingEPKcS3_:
  158|  2.23M|      {
  159|  4.79M|         for (const auto& [b, e] : active_alias_spans) {
  ------------------
  |  Branch (159:34): [True: 4.79M, False: 2.23M]
  ------------------
  160|  4.79M|            if (b == begin && e == end) return true;
  ------------------
  |  Branch (160:17): [True: 12.0k, False: 4.78M]
  |  Branch (160:31): [True: 3.19k, False: 8.80k]
  ------------------
  161|  4.79M|         }
  162|  2.23M|         return false;
  163|  2.23M|      }
_ZN3glz4yaml12yaml_context22charge_alias_expansionEm:
  178|  4.11M|      {
  179|  4.11M|         if (alias_expansion_budget == 0) {
  ------------------
  |  Branch (179:14): [True: 0, False: 4.11M]
  ------------------
  180|      0|            return true; // unbudgeted
  181|      0|         }
  182|  4.11M|         if (bytes >= alias_expansion_budget) {
  ------------------
  |  Branch (182:14): [True: 428, False: 4.11M]
  ------------------
  183|    428|            alias_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  184|    428|            return false;
  185|    428|         }
  186|  4.11M|         alias_expansion_budget -= bytes;
  187|  4.11M|         return true;
  188|  4.11M|      }
_ZN3glz4yaml12yaml_context11push_indentEi:
  110|  5.20M|      {
  111|  5.20M|         if (indent_stack.size() >= max_yaml_recursive_depth) [[unlikely]] {
  ------------------
  |  Branch (111:14): [True: 0, False: 5.20M]
  ------------------
  112|      0|            error = error_code::exceeded_max_recursive_depth;
  113|      0|            return false;
  114|      0|         }
  115|  5.20M|         indent_stack.push_back(static_cast<int16_t>(indent));
  116|  5.20M|         return true;
  117|  5.20M|      }
_ZN3glz4yaml20skip_ws_and_newlinesIRPKcS3_EEvOT_T0_:
  951|  29.1M|   {
  952|  34.3M|      while (it != end && (*it == ' ' || *it == '\t' || *it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (952:14): [True: 34.3M, False: 63.8k]
  |  Branch (952:28): [True: 3.65M, False: 30.6M]
  |  Branch (952:42): [True: 248k, False: 30.4M]
  |  Branch (952:57): [True: 374k, False: 30.0M]
  |  Branch (952:72): [True: 938k, False: 29.1M]
  ------------------
  953|  5.21M|         if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (953:14): [True: 374k, False: 4.84M]
  |  Branch (953:29): [True: 938k, False: 3.90M]
  ------------------
  954|  1.31M|            skip_newline(it, end);
  955|  1.31M|         }
  956|  3.90M|         else {
  957|  3.90M|            ++it;
  958|  3.90M|         }
  959|  5.21M|      }
  960|  29.1M|   }
_ZN3glz4yaml19detect_scalar_styleEc:
 1533|  3.94M|   {
 1534|  3.94M|      switch (c) {
 1535|  51.3k|      case '"':
  ------------------
  |  Branch (1535:7): [True: 51.3k, False: 3.89M]
  ------------------
 1536|  51.3k|         return scalar_style::double_quoted;
 1537|  15.3k|      case '\'':
  ------------------
  |  Branch (1537:7): [True: 15.3k, False: 3.92M]
  ------------------
 1538|  15.3k|         return scalar_style::single_quoted;
 1539|  10.1k|      case '|':
  ------------------
  |  Branch (1539:7): [True: 10.1k, False: 3.93M]
  ------------------
 1540|  10.1k|         return scalar_style::literal_block;
 1541|  39.7k|      case '>':
  ------------------
  |  Branch (1541:7): [True: 39.7k, False: 3.90M]
  ------------------
 1542|  39.7k|         return scalar_style::folded_block;
 1543|  3.82M|      default:
  ------------------
  |  Branch (1543:7): [True: 3.82M, False: 116k]
  ------------------
 1544|  3.82M|         return scalar_style::plain;
 1545|  3.94M|      }
 1546|  3.94M|   }
_ZN3glz4yaml23skip_folded_line_indentINS0_12yaml_contextEEEbRPKcS4_RT_Pi:
 1017|  1.19M|   {
 1018|  1.19M|      bool saw_space = false;
 1019|  1.19M|      int indent_count = 0;
 1020|  1.46M|      while (src < src_end && (*src == ' ' || *src == '\t')) {
  ------------------
  |  Branch (1020:14): [True: 1.44M, False: 24.8k]
  |  Branch (1020:32): [True: 243k, False: 1.19M]
  |  Branch (1020:47): [True: 28.0k, False: 1.16M]
  ------------------
 1021|       |         // In nested block contexts, a tab at indentation column 0 is invalid.
 1022|   272k|         if (*src == '\t' && !saw_space && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1022:14): [True: 28.0k, False: 243k]
  |  Branch (1022:30): [True: 16.4k, False: 11.6k]
  |  Branch (1022:44): [True: 112, False: 16.2k]
  ------------------
 1023|    112|            ctx.error = error_code::syntax_error;
 1024|    112|            return false;
 1025|    112|         }
 1026|   271k|         if (*src == ' ') saw_space = true;
  ------------------
  |  Branch (1026:14): [True: 243k, False: 27.9k]
  ------------------
 1027|   271k|         ++indent_count;
 1028|   271k|         ++src;
 1029|   271k|      }
 1030|  1.19M|      if (ctx.current_indent() >= 0 && src < src_end && *src != '\n' && *src != '\r' &&
  ------------------
  |  Branch (1030:11): [True: 53.7k, False: 1.13M]
  |  Branch (1030:40): [True: 37.5k, False: 16.2k]
  |  Branch (1030:57): [True: 18.1k, False: 19.3k]
  |  Branch (1030:73): [True: 13.0k, False: 5.13k]
  ------------------
 1031|  13.0k|          indent_count < ctx.current_indent()) {
  ------------------
  |  Branch (1031:11): [True: 150, False: 12.8k]
  ------------------
 1032|    150|         ctx.error = error_code::syntax_error;
 1033|    150|         return false;
 1034|    150|      }
 1035|  1.19M|      if (indent_out) *indent_out = indent_count;
  ------------------
  |  Branch (1035:11): [True: 1.19M, False: 0]
  ------------------
 1036|  1.19M|      return true;
 1037|  1.19M|   }
_ZN3glz4yaml27starts_with_document_markerIPKcS3_EEbT_T0_:
  994|  1.15M|   {
  995|  1.15M|      if (src >= src_end) return false;
  ------------------
  |  Branch (995:11): [True: 16.9k, False: 1.13M]
  ------------------
  996|  1.13M|      if ((src_end - src) >= 3) {
  ------------------
  |  Branch (996:11): [True: 1.12M, False: 18.6k]
  ------------------
  997|  1.12M|         if (src[0] == '-' && src[1] == '-' && src[2] == '-') {
  ------------------
  |  Branch (997:14): [True: 124k, False: 995k]
  |  Branch (997:31): [True: 117k, False: 7.31k]
  |  Branch (997:48): [True: 2.68k, False: 114k]
  ------------------
  998|  2.68k|            const auto* after = src + 3;
  999|  2.68k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (999:20): [True: 30, False: 2.65k]
  |  Branch (999:40): [True: 30, False: 2.62k]
  |  Branch (999:57): [True: 30, False: 2.59k]
  |  Branch (999:75): [True: 30, False: 2.56k]
  |  Branch (999:93): [True: 30, False: 2.53k]
  ------------------
 1000|  2.53k|                   *after == '#';
  ------------------
  |  Branch (1000:20): [True: 22, False: 2.50k]
  ------------------
 1001|  2.68k|         }
 1002|  1.11M|         if (src[0] == '.' && src[1] == '.' && src[2] == '.') {
  ------------------
  |  Branch (1002:14): [True: 65.4k, False: 1.05M]
  |  Branch (1002:31): [True: 61.2k, False: 4.15k]
  |  Branch (1002:48): [True: 58.0k, False: 3.22k]
  ------------------
 1003|  58.0k|            const auto* after = src + 3;
 1004|  58.0k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (1004:20): [True: 34, False: 57.9k]
  |  Branch (1004:40): [True: 32, False: 57.9k]
  |  Branch (1004:57): [True: 34, False: 57.9k]
  |  Branch (1004:75): [True: 30, False: 57.9k]
  |  Branch (1004:93): [True: 30, False: 57.8k]
  ------------------
 1005|  57.8k|                   *after == '#';
  ------------------
  |  Branch (1005:20): [True: 16, False: 57.8k]
  ------------------
 1006|  58.0k|         }
 1007|  1.11M|      }
 1008|  1.07M|      return false;
 1009|  1.13M|   }
_ZN3glz4yaml19tag_valid_for_floatENS0_8yaml_tagE:
  870|  4.70M|   {
  871|  4.70M|      return tag == yaml_tag::none || tag == yaml_tag::float_tag || tag == yaml_tag::int_tag;
  ------------------
  |  Branch (871:14): [True: 4.69M, False: 6.56k]
  |  Branch (871:39): [True: 2.68k, False: 3.88k]
  |  Branch (871:69): [True: 2.06k, False: 1.81k]
  ------------------
  872|  4.70M|   }
_ZN3glz4yaml18tag_valid_for_boolENS0_8yaml_tagE:
  876|   314k|   {
  877|   314k|      return tag == yaml_tag::none || tag == yaml_tag::bool_tag;
  ------------------
  |  Branch (877:14): [True: 307k, False: 7.40k]
  |  Branch (877:39): [True: 7.37k, False: 28]
  ------------------
  878|   314k|   }
_ZN3glz4yaml12is_yaml_nullENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1568|   108k|   {
 1569|   108k|      return s == "null" || s == "Null" || s == "NULL" || s == "~" || s.empty();
  ------------------
  |  Branch (1569:14): [True: 42.8k, False: 65.9k]
  |  Branch (1569:29): [True: 14.9k, False: 51.0k]
  |  Branch (1569:44): [True: 45.6k, False: 5.39k]
  |  Branch (1569:59): [True: 0, False: 5.39k]
  |  Branch (1569:71): [True: 5.14k, False: 246]
  ------------------
 1570|   108k|   }
_ZN3glz4yaml14measure_indentILb1ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1444|  2.04M|   {
 1445|  2.04M|      int32_t indent = 0;
 1446|  5.63M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1446:14): [True: 5.39M, False: 242k]
  |  Branch (1446:27): [True: 3.58M, False: 1.80M]
  ------------------
 1447|  3.58M|         ++indent;
 1448|  3.58M|         ++it;
 1449|  3.58M|      }
 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.80M, False: 242k]
  |  Branch (1452:27): [True: 124, False: 1.80M]
  ------------------
 1453|    124|            ctx.error = error_code::syntax_error;
 1454|    124|         }
 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|  14.3M|      {
  307|  14.3M|         if (!stream_begin || p < stream_begin) {
  ------------------
  |  Branch (307:14): [True: 0, False: 14.3M]
  |  Branch (307:31): [True: 0, False: 14.3M]
  ------------------
  308|      0|            return p;
  309|      0|         }
  310|  14.3M|         memoize_line(p);
  311|  14.3M|         return memo_line_begin;
  312|  14.3M|      }
_ZNK3glz4yaml12yaml_context12memoize_lineEPKc:
  270|  14.3M|      {
  271|  14.3M|         if (memo_line_begin && p >= memo_line_begin && p <= memo_verified_end) {
  ------------------
  |  Branch (271:14): [True: 13.8M, False: 454k]
  |  Branch (271:33): [True: 12.3M, False: 1.51M]
  |  Branch (271:57): [True: 4.96M, False: 7.38M]
  ------------------
  272|  4.96M|            return;
  273|  4.96M|         }
  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|  9.36M|         const bool extends = memo_line_begin && p > memo_verified_end;
  ------------------
  |  Branch (276:31): [True: 8.90M, False: 454k]
  |  Branch (276:50): [True: 7.38M, False: 1.51M]
  ------------------
  277|  9.36M|         const char* const floor = extends ? memo_verified_end : stream_begin;
  ------------------
  |  Branch (277:36): [True: 7.38M, False: 1.97M]
  ------------------
  278|  9.36M|         const char* first_tab = nullptr;
  279|  9.36M|         const char* first_content = nullptr;
  280|  9.36M|         const char* q = p;
  281|  1.94G|         while (q > floor) {
  ------------------
  |  Branch (281:17): [True: 1.93G, False: 3.40M]
  ------------------
  282|  1.93G|            const char c = *(q - 1);
  283|  1.93G|            if (c == '\n' || c == '\r') break;
  ------------------
  |  Branch (283:17): [True: 2.29M, False: 1.93G]
  |  Branch (283:30): [True: 3.65M, False: 1.93G]
  ------------------
  284|  1.93G|            --q;
  285|       |            // Walking backward, the last one seen is the earliest one on the line.
  286|  1.93G|            if (c == '\t')
  ------------------
  |  Branch (286:17): [True: 317k, False: 1.93G]
  ------------------
  287|   317k|               first_tab = q;
  288|  1.93G|            else if (c != ' ')
  ------------------
  |  Branch (288:22): [True: 1.90G, False: 29.5M]
  ------------------
  289|  1.90G|               first_content = q;
  290|  1.93G|         }
  291|  9.36M|         if (extends && q == floor) {
  ------------------
  |  Branch (291:14): [True: 7.38M, False: 1.97M]
  |  Branch (291:25): [True: 2.91M, False: 4.47M]
  ------------------
  292|       |            // The new bytes continue the memoized line, so anything it already found is earlier.
  293|  2.91M|            if (memo_first_tab) first_tab = memo_first_tab;
  ------------------
  |  Branch (293:17): [True: 34.7k, False: 2.87M]
  ------------------
  294|  2.91M|            if (memo_first_content) first_content = memo_first_content;
  ------------------
  |  Branch (294:17): [True: 1.64M, False: 1.26M]
  ------------------
  295|  2.91M|         }
  296|  6.44M|         else {
  297|  6.44M|            memo_line_begin = q;
  298|  6.44M|         }
  299|  9.36M|         memo_verified_end = p;
  300|  9.36M|         memo_first_tab = first_tab;
  301|  9.36M|         memo_first_content = first_content;
  302|  9.36M|      }
_ZN3glz4yaml12yaml_context10pop_indentEv:
  120|  4.79M|      {
  121|  4.79M|         if (!indent_stack.empty()) {
  ------------------
  |  Branch (121:14): [True: 4.79M, False: 0]
  ------------------
  122|  4.79M|            indent_stack.pop_back();
  123|  4.79M|         }
  124|  4.79M|      }
_ZN3glz4yaml17tag_valid_for_seqENS0_8yaml_tagE:
  888|  1.60M|   {
  889|  1.60M|      return tag == yaml_tag::none || tag == yaml_tag::seq;
  ------------------
  |  Branch (889:14): [True: 1.58M, False: 18.0k]
  |  Branch (889:39): [True: 18.0k, False: 32]
  ------------------
  890|  1.60M|   }
_ZN3glz4yaml12yaml_context20charge_key_expansionEm:
  198|  4.80M|      {
  199|  4.80M|         if (key_expansion_budget == 0) {
  ------------------
  |  Branch (199:14): [True: 0, False: 4.80M]
  ------------------
  200|      0|            return true; // unbudgeted
  201|      0|         }
  202|  4.80M|         if (bytes >= key_expansion_budget) {
  ------------------
  |  Branch (202:14): [True: 396, False: 4.80M]
  ------------------
  203|    396|            key_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  204|    396|            return false;
  205|    396|         }
  206|  4.80M|         key_expansion_budget -= bytes;
  207|  4.80M|         return true;
  208|  4.80M|      }
_ZN3glz4yaml14measure_indentILb0ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1444|  8.78M|   {
 1445|  8.78M|      int32_t indent = 0;
 1446|  16.0M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1446:14): [True: 15.9M, False: 111k]
  |  Branch (1446:27): [True: 7.22M, False: 8.67M]
  ------------------
 1447|  7.22M|         ++indent;
 1448|  7.22M|         ++it;
 1449|  7.22M|      }
 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|  8.78M|      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|  8.78M|         if (indent == 0 && it != end && *it == '\t') {
  ------------------
  |  Branch (1459:14): [True: 8.03M, False: 758k]
  |  Branch (1459:29): [True: 7.91M, False: 111k]
  |  Branch (1459:42): [True: 278, False: 7.91M]
  ------------------
 1460|    278|            ctx.error = error_code::syntax_error;
 1461|    278|         }
 1462|  8.78M|      }
 1463|  8.78M|      return indent;
 1464|  8.78M|   }
_ZNK3glz4yaml12yaml_context16make_speculativeEv:
  362|  8.65M|      {
  363|  8.65M|         yaml_context c{};
  364|  8.65M|         c.indent_stack = indent_stack;
  365|  8.65M|         c.anchors = anchors;
  366|  8.65M|         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.65M|         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.65M|         c.key_expansion_budget = key_expansion_budget;
  373|  8.65M|         c.sequence_item_value_context = sequence_item_value_context;
  374|  8.65M|         c.sequence_dash_indent = sequence_dash_indent;
  375|  8.65M|         c.explicit_mapping_key_context = explicit_mapping_key_context;
  376|  8.65M|         c.allow_indentless_sequence = allow_indentless_sequence;
  377|  8.65M|         c.stream_begin = stream_begin;
  378|       |         // The line memo only records what the buffer says, so a probe may keep using it.
  379|  8.65M|         c.memo_line_begin = memo_line_begin;
  380|  8.65M|         c.memo_verified_end = memo_verified_end;
  381|  8.65M|         c.memo_first_tab = memo_first_tab;
  382|  8.65M|         c.memo_first_content = memo_first_content;
  383|  8.65M|         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.65M|         c.depth = depth;
  387|  8.65M|         return c;
  388|  8.65M|      }
_ZNK3glz4yaml12yaml_context14current_indentEv:
  107|  75.8M|      int32_t current_indent() const noexcept { return indent_stack.empty() ? int32_t(-1) : indent_stack.back(); }
  ------------------
  |  Branch (107:56): [True: 52.1M, False: 23.7M]
  ------------------
_ZNK3glz4yaml12yaml_context18line_prefix_beforeEPKc:
  315|  10.8M|      {
  316|  10.8M|         const char* const begin = line_begin_of(p);
  317|  10.8M|         if (begin >= p) {
  ------------------
  |  Branch (317:14): [True: 3.37M, False: 7.43M]
  ------------------
  318|  3.37M|            return {};
  319|  3.37M|         }
  320|  7.43M|         return {int32_t(p - begin), memo_first_tab && memo_first_tab < p,
  ------------------
  |  Branch (320:38): [True: 301k, False: 7.13M]
  |  Branch (320:56): [True: 285k, False: 16.7k]
  ------------------
  321|  7.43M|                 memo_first_content && memo_first_content < p};
  ------------------
  |  Branch (321:18): [True: 6.48M, False: 951k]
  |  Branch (321:40): [True: 6.47M, False: 4.47k]
  ------------------
  322|  10.8M|      }
_ZN3glz4yaml12skip_newlineIRPKcS3_EEbOT_T0_:
  931|  57.0M|   {
  932|  57.0M|      if (it == end) return false;
  ------------------
  |  Branch (932:11): [True: 82.0k, False: 57.0M]
  ------------------
  933|       |
  934|  57.0M|      if (*it == '\r') {
  ------------------
  |  Branch (934:11): [True: 37.0M, False: 19.9M]
  ------------------
  935|  37.0M|         ++it;
  936|  37.0M|         if (it != end && *it == '\n') {
  ------------------
  |  Branch (936:14): [True: 36.1M, False: 863k]
  |  Branch (936:27): [True: 1.60M, False: 34.5M]
  ------------------
  937|  1.60M|            ++it;
  938|  1.60M|         }
  939|  37.0M|         return true;
  940|  37.0M|      }
  941|  19.9M|      else if (*it == '\n') {
  ------------------
  |  Branch (941:16): [True: 19.9M, False: 2.64k]
  ------------------
  942|  19.9M|         ++it;
  943|  19.9M|         return true;
  944|  19.9M|      }
  945|  2.64k|      return false;
  946|  57.0M|   }

_ZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  41.1k|      {
   70|  41.1k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  41.1k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 41.1k, False: 0]
  |  Branch (71:38): [True: 41.1k, False: 0]
  ------------------
   72|  41.1k|               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|  41.1k|               if constexpr (requires { ctx.reset_read_state(); }) {
   76|  41.1k|                  ctx.reset_read_state();
   77|  41.1k|               }
   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|  41.1k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  41.1k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  41.1k|                  ctx.alias_expansion_budget =
   84|  41.1k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 299, False: 40.8k]
  ------------------
   85|  41.1k|               }
   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|  41.1k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  41.1k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  41.1k|                  ctx.key_expansion_budget =
   91|  41.1k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 299, False: 40.8k]
  ------------------
   92|  41.1k|               }
   93|  41.1k|            }
   94|  41.1k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  41.1k|         yaml::skip_document_start(it, end, ctx);
   97|  41.1k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 268, False: 40.8k]
  ------------------
   98|    268|            return;
   99|    268|         }
  100|       |
  101|  40.8k|         using V = std::remove_cvref_t<T>;
  102|  40.8k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 69, False: 40.7k]
  ------------------
  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.8k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 74, False: 40.7k]
  |  Branch (120:50): [True: 21, False: 40.7k]
  ------------------
  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.8k|         if constexpr (!check_partial_read(Opts)) {
  144|  40.8k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 9.16k, False: 31.7k]
  |  Branch (144:37): [True: 9.16k, False: 0]
  ------------------
  145|  9.16k|               auto is_document_start = [&](auto pos) {
  146|  9.16k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  9.16k|                     auto after = pos + 3;
  148|  9.16k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  9.16k|                            *after == '#';
  150|  9.16k|                  }
  151|  9.16k|                  return false;
  152|  9.16k|               };
  153|       |
  154|       |               // The scan below reads the tail a line at a time, which only means anything if the
  155|       |               // tail starts at one. A root node can stop mid-line -- a plain scalar ends at a
  156|       |               // ':' it is not allowed to take as a separator, a flow collection ends at its
  157|       |               // bracket -- and what sits after it there is leftover content on that line, not
  158|       |               // the opening of a new one. Only inline whitespace and a comment may follow. Let
  159|       |               // the line scan see anything else and it misreads it: a leftover ':' passes as an
  160|       |               // explicit-key continuation and the remainder of the document falls on the floor.
  161|  9.16k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  9.16k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.47k, False: 7.68k]
  |  Branch (162:23): [True: 999, False: 8.16k]
  |  Branch (162:36): [True: 999, False: 479]
  ------------------
  163|    999|                     auto rest = it;
  164|  2.80k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 2.75k, False: 50]
  |  Branch (164:45): [True: 1.46k, False: 1.29k]
  |  Branch (164:61): [True: 345, False: 949]
  ------------------
  165|    999|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 949, False: 50]
  |  Branch (165:41): [True: 718, False: 231]
  |  Branch (165:58): [True: 402, False: 316]
  |  Branch (165:75): [True: 309, False: 93]
  ------------------
  166|    309|                        ctx.error = error_code::syntax_error;
  167|    309|                        return;
  168|    309|                     }
  169|    999|                  }
  170|  9.16k|               }
  171|       |
  172|  8.85k|               auto tail_scan = it;
  173|  9.16k|               bool seen_document_end_marker = false;
  174|  41.3k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 32.8k, False: 8.46k]
  ------------------
  175|  32.8k|                  auto line = tail_scan;
  176|  51.4k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 51.3k, False: 84]
  |  Branch (176:42): [True: 18.0k, False: 33.3k]
  |  Branch (176:58): [True: 517, False: 32.7k]
  ------------------
  177|  32.8k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 1.27k, False: 31.5k]
  |  Branch (177:44): [True: 1.18k, False: 84]
  |  Branch (177:59): [True: 856, False: 333]
  |  Branch (177:76): [True: 570, False: 286]
  |  Branch (177:93): [True: 127, False: 443]
  ------------------
  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|    127|                     const char first = *line;
  182|    127|                     const bool explicit_or_structural_start =
  183|    127|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 10, False: 117]
  |  Branch (183:42): [True: 2, False: 115]
  |  Branch (183:58): [True: 4, False: 111]
  |  Branch (183:74): [True: 2, False: 109]
  |  Branch (183:90): [True: 3, False: 106]
  |  Branch (183:106): [True: 5, False: 101]
  ------------------
  184|    101|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 2, False: 99]
  |  Branch (184:42): [True: 3, False: 96]
  |  Branch (184:58): [True: 2, False: 94]
  |  Branch (184:75): [True: 11, False: 83]
  ------------------
  185|    127|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 83, False: 44]
  ------------------
  186|     83|                        auto scan = line;
  187|  1.27k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 1.22k, False: 50]
  |  Branch (187:47): [True: 1.21k, False: 5]
  |  Branch (187:64): [True: 1.21k, False: 3]
  ------------------
  188|  1.21k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 318, False: 895]
  ------------------
  189|    318|                              auto after = scan + 1;
  190|    318|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 17, False: 301]
  |  Branch (190:51): [True: 3, False: 298]
  |  Branch (190:68): [True: 2, False: 296]
  |  Branch (190:86): [True: 2, False: 294]
  |  Branch (190:104): [True: 1, False: 293]
  ------------------
  191|     25|                                 ctx.error = error_code::syntax_error;
  192|     25|                                 return;
  193|     25|                              }
  194|    318|                           }
  195|  1.18k|                           ++scan;
  196|  1.18k|                        }
  197|     83|                     }
  198|    102|                     return;
  199|    127|                  }
  200|  32.7k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 84, False: 32.6k]
  ------------------
  201|     84|                     return;
  202|     84|                  }
  203|  32.6k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 26, False: 32.6k]
  |  Branch (203:39): [True: 15, False: 32.6k]
  ------------------
  204|     41|                     return; // Explicit key/value continuation.
  205|     41|                  }
  206|  32.6k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 1.10k, False: 31.5k]
  |  Branch (206:40): [True: 10.0k, False: 21.4k]
  ------------------
  207|  11.2k|                     tail_scan = line;
  208|  11.2k|                     yaml::skip_newline(tail_scan, end);
  209|  11.2k|                     continue;
  210|  11.2k|                  }
  211|  21.4k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 16.4k, False: 4.99k]
  ------------------
  212|   127k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 127k, False: 134]
  |  Branch (212:49): [True: 123k, False: 3.52k]
  |  Branch (212:71): [True: 110k, False: 12.7k]
  ------------------
  213|  16.4k|                     yaml::skip_newline(tail_scan, end);
  214|  16.4k|                     continue;
  215|  16.4k|                  }
  216|  4.99k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 4.55k, False: 445]
  ------------------
  217|  4.55k|                     seen_document_end_marker = true;
  218|  28.7k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 28.6k, False: 85]
  |  Branch (218:49): [True: 25.5k, False: 3.13k]
  |  Branch (218:71): [True: 24.1k, False: 1.33k]
  ------------------
  219|  4.55k|                     yaml::skip_newline(tail_scan, end);
  220|  4.55k|                     continue;
  221|  4.55k|                  }
  222|    445|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 133, False: 312]
  ------------------
  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|    862|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 836, False: 26]
  |  Branch (228:47): [True: 426, False: 410]
  |  Branch (228:65): [True: 303, False: 107]
  ------------------
  229|    133|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 107, False: 26]
  |  Branch (229:43): [True: 58, False: 49]
  ------------------
  230|     58|                        auto tag_end = header + 1;
  231|  3.21M|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 3.21M, False: 20]
  |  Branch (231:50): [True: 3.21M, False: 30]
  |  Branch (231:69): [True: 3.21M, False: 2]
  |  Branch (231:89): [True: 3.21M, False: 1]
  ------------------
  232|  3.21M|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 3.21M, False: 2]
  |  Branch (232:52): [True: 3.21M, False: 3]
  ------------------
  233|  3.21M|                           ++tag_end;
  234|  3.21M|                        }
  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: 44, False: 14]
  ------------------
  238|     44|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     44|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 44, False: 0]
  |  Branch (239:49): [True: 42, False: 2]
  ------------------
  240|     42|                              ctx.error = error_code::syntax_error;
  241|     42|                              return;
  242|     42|                           }
  243|     44|                        }
  244|     58|                     }
  245|     91|                     return; // Additional documents are allowed in the stream tail.
  246|    133|                  }
  247|    312|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 312, False: 0]
  |  Branch (247:38): [True: 6, False: 306]
  ------------------
  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|    306|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 44, False: 262]
  ------------------
  257|     44|                     return; // Implicit next document after explicit document end marker.
  258|     44|                  }
  259|    262|                  ctx.error = error_code::syntax_error;
  260|    262|                  return;
  261|    306|               }
  262|  9.16k|            }
  263|  40.8k|         }
  264|  40.8k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   563k|      {
  275|   563k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   563k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   563k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   563k|      }
_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|   732k|      {
 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|   732k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|   732k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|   732k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|   732k|                       "the internally tagged shape, so it is rejected here instead.");
 5759|   732k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 732k]
  ------------------
 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|   732k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 137k, False: 594k]
  ------------------
 5769|   137k|            yaml::skip_ws_newlines_comments(it, end);
 5770|   137k|         }
 5771|   594k|         else {
 5772|   594k|            yaml::skip_inline_ws(it, end);
 5773|   594k|         }
 5774|       |
 5775|   732k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 116, False: 731k]
  ------------------
 5776|    116|            ctx.error = error_code::unexpected_end;
 5777|    116|            return;
 5778|    116|         }
 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|   731k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|   731k|            using V = std::remove_cvref_t<T>;
 5886|   731k|            using counts = yaml_variant_type_count<V>;
 5887|   731k|            const char c = *it;
 5888|   731k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|   731k|               switch (ch) {
 5890|   731k|               case ' ':
 5891|   731k|               case '\t':
 5892|   731k|               case '\n':
 5893|   731k|               case '\r':
 5894|   731k|               case ',':
 5895|   731k|               case ']':
 5896|   731k|               case '}':
 5897|   731k|                  return true;
 5898|   731k|               default:
 5899|   731k|                  return false;
 5900|   731k|               }
 5901|   731k|            };
 5902|       |
 5903|   731k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|   731k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|   731k|                  return false;
 5906|   731k|               }
 5907|   731k|               if (ctx.current_indent() < 0) {
 5908|   731k|                  return false;
 5909|   731k|               }
 5910|   731k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|   731k|                  return false;
 5912|   731k|               }
 5913|       |
 5914|   731k|               auto look = word_end;
 5915|   731k|               yaml::skip_newline(look, end);
 5916|   731k|               while (look != end) {
 5917|   731k|                  int32_t line_indent = 0;
 5918|   731k|                  while (look != end && *look == ' ') {
 5919|   731k|                     ++line_indent;
 5920|   731k|                     ++look;
 5921|   731k|                  }
 5922|   731k|                  if (look != end && *look == '\t') {
 5923|   731k|                     return false;
 5924|   731k|                  }
 5925|   731k|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|   731k|                     if (look != end) {
 5927|   731k|                        yaml::skip_newline(look, end);
 5928|   731k|                        continue;
 5929|   731k|                     }
 5930|   731k|                     return false;
 5931|   731k|                  }
 5932|   731k|                  if (*look == '#') {
 5933|   731k|                     yaml::skip_comment(look, end);
 5934|   731k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|   731k|                        yaml::skip_newline(look, end);
 5936|   731k|                        continue;
 5937|   731k|                     }
 5938|   731k|                     return false;
 5939|   731k|                  }
 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|   731k|                  {
 5945|   731k|                     auto scan = look;
 5946|   731k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|   731k|                        if (*scan == ':') {
 5948|   731k|                           auto after_colon = scan + 1;
 5949|   731k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|   731k|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|   731k|                              return false;
 5952|   731k|                           }
 5953|   731k|                        }
 5954|   731k|                        ++scan;
 5955|   731k|                     }
 5956|   731k|                  }
 5957|       |
 5958|   731k|                  return line_indent > ctx.current_indent();
 5959|   731k|               }
 5960|   731k|               return false;
 5961|   731k|            };
 5962|   731k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   731k|               if (ptr == end) {
 5964|   731k|                  return true;
 5965|   731k|               }
 5966|   731k|               if (*ptr == ':') {
 5967|   731k|                  auto next = ptr + 1;
 5968|   731k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|   731k|               }
 5970|   731k|               return is_plain_scalar_boundary(*ptr);
 5971|   731k|            };
 5972|       |
 5973|   731k|            switch (c) {
 5974|   123k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 123k, False: 607k]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   123k|               ++it;
 5977|   123k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   123k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 179, False: 123k]
  ------------------
 5979|    179|                  ctx.error = error_code::syntax_error;
 5980|    179|                  return;
 5981|    179|               }
 5982|   123k|               yaml::skip_inline_ws(it, end);
 5983|   123k|               bool anchor_on_same_line = true;
 5984|   123k|               bool value_is_indentless_sequence = false;
 5985|   123k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 1.46k, False: 122k]
  |  Branch (5985:33): [True: 7.24k, False: 115k]
  |  Branch (5985:48): [True: 10.8k, False: 104k]
  |  Branch (5985:63): [True: 7.41k, False: 96.7k]
  ------------------
 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|  26.9k|                  bool value_on_next_line = false;
 5989|  26.9k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 25.5k, False: 1.46k]
  ------------------
 5990|  25.5k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|  25.5k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 7.41k, False: 18.0k]
  ------------------
 5993|   104k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 103k, False: 517]
  |  Branch (5993:47): [True: 101k, False: 2.54k]
  |  Branch (5993:64): [True: 96.8k, False: 4.34k]
  ------------------
 5994|  7.41k|                     }
 5995|       |                     // Skip newline
 5996|  25.5k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 24.9k, False: 517]
  |  Branch (5996:42): [True: 9.79k, False: 15.2k]
  |  Branch (5996:59): [True: 15.2k, False: 0]
  ------------------
 5997|  24.9k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|  45.9k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 44.2k, False: 1.64k]
  |  Branch (5999:48): [True: 15.5k, False: 28.7k]
  |  Branch (5999:65): [True: 5.39k, False: 23.3k]
  ------------------
 6000|  20.9k|                           yaml::skip_newline(peek, end);
 6001|  20.9k|                        }
 6002|       |                        // Measure indent of next content line
 6003|  24.9k|                        int32_t next_indent = 0;
 6004|   105k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 103k, False: 1.96k]
  |  Branch (6004:47): [True: 80.1k, False: 23.0k]
  ------------------
 6005|  80.1k|                           ++next_indent;
 6006|  80.1k|                           ++peek;
 6007|  80.1k|                        }
 6008|  24.9k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 23.0k, False: 1.96k]
  |  Branch (6008:44): [True: 22.5k, False: 476]
  |  Branch (6008:61): [True: 21.8k, False: 665]
  ------------------
 6009|  21.8k|                           const bool indentless_sequence =
 6010|  21.8k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 19.3k, False: 2.51k]
  |  Branch (6010:69): [True: 9.21k, False: 10.1k]
  ------------------
 6011|  9.21k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 286, False: 8.92k]
  ------------------
 6012|  8.92k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 8.44k, False: 477]
  ------------------
 6013|  8.73k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 4.26k, False: 4.46k]
  ------------------
 6014|  4.46k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 3.17k, False: 1.29k]
  |  Branch (6014:61): [True: 1.73k, False: 1.43k]
  ------------------
 6015|  21.8k|                           value_is_indentless_sequence = indentless_sequence;
 6016|  21.8k|                           const bool same_indent_property_node =
 6017|  21.8k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 8.62k, False: 13.2k]
  ------------------
 6018|  8.62k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 908, False: 7.72k]
  |  Branch (6018:48): [True: 1.48k, False: 6.23k]
  |  Branch (6018:64): [True: 266, False: 5.96k]
  |  Branch (6018:80): [True: 226, False: 5.73k]
  |  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: 329, False: 4.75k]
  |  Branch (6019:65): [True: 253, False: 4.49k]
  |  Branch (6019:81): [True: 62, False: 4.43k]
  ------------------
 6020|  21.8k|                           value_on_next_line =
 6021|  21.8k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 8.23k, False: 13.6k]
  |  Branch (6021:71): [True: 6.00k, False: 7.64k]
  |  Branch (6021:94): [True: 4.19k, False: 3.45k]
  ------------------
 6022|  21.8k|                        }
 6023|  24.9k|                     }
 6024|  25.5k|                  }
 6025|  26.9k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 8.54k, False: 18.4k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  8.54k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  8.54k|                     return;
 6029|  8.54k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|  18.4k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 5.22k, False: 13.2k]
  ------------------
 6032|  69.5k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 69.5k, False: 0]
  |  Branch (6032:42): [True: 67.6k, False: 1.86k]
  |  Branch (6032:57): [True: 64.2k, False: 3.36k]
  ------------------
 6033|  5.22k|                  }
 6034|  18.4k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 18.4k, False: 0]
  ------------------
 6035|  35.6k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 35.6k, False: 0]
  |  Branch (6035:40): [True: 14.5k, False: 21.0k]
  |  Branch (6035:55): [True: 2.61k, False: 18.4k]
  ------------------
 6036|  17.1k|                     yaml::skip_newline(it, end);
 6037|  17.1k|                  }
 6038|  18.4k|                  yaml::skip_inline_ws(it, end);
 6039|  18.4k|                  anchor_on_same_line = false;
 6040|  18.4k|               }
 6041|       |
 6042|   115k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|   115k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6043:23): [True: 96.7k, False: 18.4k]
  |  Branch (6043:46): [True: 5.80k, False: 90.9k]
  ------------------
 6044|  5.80k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6044:24): [True: 3, False: 5.79k]
  |  Branch (6044:43): [True: 8, False: 5.79k]
  ------------------
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|     11|                     ctx.error = error_code::syntax_error;
 6047|     11|                     return;
 6048|     11|                  }
 6049|   115k|               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   115k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 115k, False: 26]
  |  Branch (6053:33): [True: 837, False: 114k]
  |  Branch (6053:47): [True: 85, False: 752]
  ------------------
 6054|     85|                  ctx.error = error_code::syntax_error;
 6055|     85|                  return;
 6056|     85|               }
 6057|       |
 6058|   115k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|   115k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6059:23): [True: 18.4k, False: 96.7k]
  |  Branch (6059:47): [True: 18.3k, False: 15]
  |  Branch (6059:60): [True: 2.15k, False: 16.2k]
  ------------------
 6060|  2.15k|                     auto probe = it + 1;
 6061|  2.15k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|  2.15k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6062:26): [True: 24, False: 2.13k]
  ------------------
 6063|     24|                        ctx.error = error_code::syntax_error;
 6064|     24|                        return;
 6065|     24|                     }
 6066|  2.13k|                     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.13k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6070:26): [True: 44, False: 2.09k]
  ------------------
 6071|     44|                        ctx.error = error_code::syntax_error;
 6072|     44|                        return;
 6073|     44|                     }
 6074|  2.13k|                  }
 6075|   115k|               }
 6076|       |
 6077|   115k|               const char* anchor_start = &*it;
 6078|   115k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|   115k|               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|   115k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6084:23): [True: 96.7k, False: 18.4k]
  |  Branch (6084:46): [True: 47.1k, False: 49.5k]
  ------------------
 6085|  47.1k|                     auto key_start = it;
 6086|  47.1k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6086:26): [True: 899, False: 46.2k]
  ------------------
 6087|    899|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|    899|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6088:29): [True: 2, False: 897]
  |  Branch (6088:67): [True: 6, False: 891]
  ------------------
 6089|      8|                           ctx.error = error_code::syntax_error;
 6090|      8|                           return;
 6091|      8|                        }
 6092|    891|                        yaml::skip_inline_ws(key_start, end);
 6093|    891|                        if (key_start == end) {
  ------------------
  |  Branch (6093:29): [True: 4, False: 887]
  ------------------
 6094|      4|                           ctx.error = error_code::unexpected_end;
 6095|      4|                           return;
 6096|      4|                        }
 6097|    887|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6097:29): [True: 1, False: 886]
  |  Branch (6097:51): [True: 1, False: 885]
  ------------------
 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|    885|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6106:29): [True: 169, False: 716]
  |  Branch (6106:50): [True: 6, False: 163]
  ------------------
 6107|      6|                           ctx.error = error_code::syntax_error;
 6108|      6|                           return;
 6109|      6|                        }
 6110|    885|                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|  47.0k|                     auto key_scan = key_start;
 6114|  47.0k|                     auto key_end = key_start;
 6115|  47.0k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6115:26): [True: 593, False: 46.5k]
  |  Branch (6115:46): [True: 343, False: 46.1k]
  ------------------
 6116|       |                        // Quoted key: skip to closing quote
 6117|    936|                        const char quote = *key_scan;
 6118|    936|                        ++key_scan;
 6119|  7.08k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6119:32): [True: 7.08k, False: 4]
  |  Branch (6119:51): [True: 6.15k, False: 932]
  ------------------
 6120|  6.15k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6120:32): [True: 615, False: 5.53k]
  |  Branch (6120:53): [True: 270, False: 345]
  ------------------
 6121|    270|                              ++key_scan;
 6122|    270|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6122:35): [True: 270, False: 0]
  ------------------
 6123|    270|                           }
 6124|  5.88k|                           else {
 6125|  5.88k|                              ++key_scan;
 6126|  5.88k|                           }
 6127|  6.15k|                        }
 6128|    936|                        if (key_scan == end) {
  ------------------
  |  Branch (6128:29): [True: 4, False: 932]
  ------------------
 6129|      4|                           ctx.error = error_code::syntax_error;
 6130|      4|                           return;
 6131|      4|                        }
 6132|    932|                        ++key_scan; // past closing quote
 6133|    932|                        key_end = key_scan;
 6134|    932|                        yaml::skip_inline_ws(key_scan, end);
 6135|    932|                     }
 6136|  46.1k|                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|   794k|                        while (key_scan != end) {
  ------------------
  |  Branch (6138:32): [True: 794k, False: 1]
  ------------------
 6139|   794k|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6139:32): [True: 87.8k, False: 706k]
  ------------------
 6140|  87.8k|                              auto next = key_scan + 1;
 6141|  87.8k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6141:35): [True: 5.53k, False: 82.3k]
  |  Branch (6141:50): [True: 33.7k, False: 48.5k]
  |  Branch (6141:66): [True: 1.42k, False: 47.1k]
  |  Branch (6141:83): [True: 3.33k, False: 43.8k]
  |  Branch (6141:100): [True: 2.12k, False: 41.6k]
  ------------------
 6142|  46.1k|                                 break;
 6143|  46.1k|                              }
 6144|  87.8k|                           }
 6145|   747k|                           ++key_scan;
 6146|   747k|                        }
 6147|  46.1k|                        key_end = key_scan;
 6148|  54.1k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6148:32): [True: 51.2k, False: 2.87k]
  |  Branch (6148:57): [True: 7.49k, False: 43.7k]
  |  Branch (6148:82): [True: 487, False: 43.2k]
  ------------------
 6149|  7.97k|                           --key_end;
 6150|  7.97k|                        }
 6151|  46.1k|                     }
 6152|  47.0k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6152:26): [True: 2, False: 47.0k]
  |  Branch (6152:45): [True: 28, False: 47.0k]
  ------------------
 6153|     30|                        ctx.error = error_code::syntax_error;
 6154|     30|                        return;
 6155|     30|                     }
 6156|       |                     // Store anchor with just the key text span
 6157|  47.0k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|  47.0k|                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|  47.0k|                     if constexpr (counts::n_object > 0) {
 6161|  47.0k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|  47.0k|                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|  47.0k|                     return;
 6168|  47.0k|                  }
 6169|   115k|               }
 6170|       |
 6171|  68.0k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   115k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   115k|               redispatch<Opts>(value, ctx, it, end);
 6174|   115k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   115k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 64.0k, False: 51.0k]
  ------------------
 6176|  64.0k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|  64.0k|               }
 6178|   115k|               return;
 6179|   115k|            }
 6180|  91.4k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 91.4k, False: 640k]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|  91.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|  91.4k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6183:23): [True: 7.00k, False: 84.3k]
  ------------------
 6184|  7.00k|                     if constexpr (counts::n_object > 0) {
 6185|  7.00k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|  7.00k|                                                                                                        end);
 6187|  7.00k|                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|  7.00k|                  }
 6194|  91.4k|               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|  91.4k|               return;
 6199|   115k|            }
 6200|  72.9k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 72.9k, False: 659k]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|  72.9k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|  72.9k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 88, False: 72.8k]
  ------------------
 6204|     88|                  ctx.error = error_code::syntax_error;
 6205|     88|                  return;
 6206|     88|               }
 6207|  72.8k|               yaml::skip_inline_ws(it, end);
 6208|  72.8k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 72.2k, False: 561]
  |  Branch (6208:33): [True: 8.92k, False: 63.3k]
  ------------------
 6209|  8.92k|                  yaml::skip_comment(it, end);
 6210|  8.92k|               }
 6211|  72.8k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 71.9k, False: 896]
  |  Branch (6211:34): [True: 13.6k, False: 58.3k]
  |  Branch (6211:49): [True: 9.51k, False: 48.8k]
  ------------------
 6212|  23.1k|                  auto content = it;
 6213|  23.1k|                  yaml::skip_newline(content, end);
 6214|  23.1k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|  23.1k|                  bool consume_following_content = false;
 6217|  23.1k|                  auto content_token = content;
 6218|  23.1k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 21.4k, False: 1.66k]
  ------------------
 6219|  21.4k|                     auto indent_probe = content;
 6220|  21.4k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  21.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 3, False: 21.4k]
  ------------------
 6222|      3|                        return;
 6223|  21.4k|                     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.4k|                     bool tagged_indentless_sequence = false;
 6228|  21.4k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 2.45k, False: 19.0k]
  |  Branch (6228:56): [True: 2.45k, False: 0]
  |  Branch (6228:79): [True: 2.06k, False: 387]
  ------------------
 6229|  2.06k|                        const auto after_dash = indent_probe + 1;
 6230|  2.06k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 247, False: 1.81k]
  ------------------
 6231|  1.83k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 1.58k, False: 236]
  ------------------
 6232|  1.83k|                           tagged_indentless_sequence =
 6233|  1.83k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 602, False: 1.22k]
  ------------------
 6234|  1.22k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 610, False: 618]
  |  Branch (6234:60): [True: 477, False: 133]
  ------------------
 6235|  1.83k|                        }
 6236|  2.06k|                     }
 6237|       |
 6238|  21.4k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 1.74k, False: 19.7k]
  ------------------
 6239|  19.7k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 4.54k, False: 15.1k]
  |  Branch (6239:93): [True: 1.07k, False: 14.0k]
  ------------------
 6240|  21.4k|                  }
 6241|       |
 6242|  23.1k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 7.37k, False: 15.7k]
  ------------------
 6243|  7.37k|                     it = content_token;
 6244|  7.37k|                  }
 6245|  15.7k|                  else {
 6246|  15.7k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 2.60k, False: 13.1k]
  ------------------
 6247|  2.60k|                        if constexpr (counts::n_str > 0) {
 6248|  2.60k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  2.60k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  2.60k|                           value = StrType{};
 6251|  2.60k|                           return;
 6252|  2.60k|                        }
 6253|  2.60k|                     }
 6254|  15.7k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 261, False: 15.4k]
  ------------------
 6255|    261|                        if constexpr (counts::n_null > 0) {
 6256|    261|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    261|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    261|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 261]
  ------------------
 6259|    261|                           return;
 6260|    261|                        }
 6261|    261|                     }
 6262|  15.7k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 12.3k, False: 3.44k]
  ------------------
 6263|  12.3k|                        if constexpr (counts::n_null > 0) {
 6264|  12.3k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  12.3k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  12.3k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 12.3k]
  ------------------
 6267|  12.3k|                           return;
 6268|  12.3k|                        }
 6269|  12.3k|                     }
 6270|  15.7k|                  }
 6271|  23.1k|               }
 6272|  72.8k|               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|  72.8k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6275:23): [True: 56.7k, False: 16.0k]
  |  Branch (6275:36): [True: 10, False: 56.7k]
  ------------------
 6276|     10|                     ctx.error = error_code::syntax_error;
 6277|     10|                     return;
 6278|     10|                  }
 6279|  72.8k|                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|  72.8k|                     const bool starts_block_sequence_entry =
 6282|  72.8k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6282:26): [True: 56.7k, False: 16.0k]
  |  Branch (6282:39): [True: 3.57k, False: 53.1k]
  ------------------
 6283|  3.57k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6283:26): [True: 523, False: 3.05k]
  |  Branch (6283:45): [True: 2.38k, False: 667]
  ------------------
 6284|  72.8k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6284:26): [True: 54.7k, False: 18.0k]
  |  Branch (6284:58): [True: 14.7k, False: 39.9k]
  ------------------
 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|  14.7k|                        redispatch<Opts>(value, ctx, it, end);
 6288|  14.7k|                        return;
 6289|  14.7k|                     }
 6290|  72.8k|                  }
 6291|  72.8k|               }
 6292|  72.8k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 896, False: 71.9k]
  ------------------
 6293|    896|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 264, False: 632]
  ------------------
 6294|    264|                     if constexpr (counts::n_str > 0) {
 6295|    264|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|    264|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|    264|                        value = StrType{};
 6298|    264|                        return;
 6299|    264|                     }
 6300|    264|                  }
 6301|    896|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 605, False: 291]
  ------------------
 6302|    605|                     if constexpr (counts::n_null > 0) {
 6303|    605|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|    605|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|    605|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 605]
  ------------------
 6306|    605|                        return;
 6307|    605|                     }
 6308|    605|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|    896|                  return;
 6311|    896|               }
 6312|  71.9k|               switch (tag) {
 6313|  1.09k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 1.09k, False: 70.8k]
  ------------------
 6314|  1.09k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  1.09k|                  return;
 6316|  1.26k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 1.26k, False: 70.6k]
  ------------------
 6317|  1.40k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 141, False: 71.7k]
  ------------------
 6318|  1.40k|                  if constexpr (counts::n_num > 0) {
 6319|  1.40k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  1.40k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  10.3k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 8.95k, False: 62.9k]
  ------------------
 6327|  10.3k|                  if constexpr (counts::n_bool > 0) {
 6328|  10.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  10.3k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  10.6k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 299, False: 71.6k]
  ------------------
 6336|  10.6k|                  if constexpr (counts::n_null > 0) {
 6337|  10.6k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  10.6k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  10.6k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 10.6k]
  ------------------
 6340|  10.6k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  10.6k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  15.6k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 4.96k, False: 66.9k]
  ------------------
 6348|  15.6k|                  if constexpr (counts::n_object > 0) {
 6349|  15.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  15.6k|                                                                                                     end);
 6351|  15.6k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  22.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 6.42k, False: 65.4k]
  ------------------
 6358|  22.0k|                  if constexpr (counts::n_array > 0) {
 6359|  22.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|  22.0k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|  22.0k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6361:29): [True: 6.42k, False: 15.6k]
  |  Branch (6361:42): [True: 1.87k, False: 4.55k]
  ------------------
 6362|  1.87k|                           ctx.allow_indentless_sequence = true;
 6363|  1.87k|                        }
 6364|  22.0k|                     }
 6365|  22.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  22.0k|                                                                                                    end);
 6367|  22.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  22.0k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|  40.8k|               default: {
  ------------------
  |  Branch (6374:16): [True: 18.8k, False: 53.1k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|  40.8k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 18.8k, False: 22.0k]
  |  Branch (6377:36): [True: 3.69k, False: 15.1k]
  ------------------
 6378|  3.69k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  3.69k|                     return;
 6380|  3.69k|                  }
 6381|       |
 6382|  37.1k|                  if constexpr (counts::n_array > 0) {
 6383|  37.1k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 15.1k, False: 22.0k]
  |  Branch (6383:39): [True: 339, False: 14.7k]
  ------------------
 6384|    339|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|    339|                                                                                                       end);
 6386|    339|                        return;
 6387|    339|                     }
 6388|  37.1k|                  }
 6389|  37.1k|                  if constexpr (counts::n_object > 0) {
 6390|  37.1k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 14.7k, False: 22.3k]
  |  Branch (6390:39): [True: 321, False: 14.4k]
  ------------------
 6391|    321|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|    321|                                                                                                        end);
 6393|    321|                        return;
 6394|    321|                     }
 6395|  37.1k|                  }
 6396|       |
 6397|  37.1k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|  37.1k|                     if constexpr (counts::n_array > 0) {
 6399|  37.1k|                        const bool starts_block_sequence_entry =
 6400|  37.1k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6400:29): [True: 14.4k, False: 22.7k]
  |  Branch (6400:42): [True: 1.32k, False: 13.1k]
  ------------------
 6401|  1.32k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6401:29): [True: 276, False: 1.05k]
  |  Branch (6401:48): [True: 782, False: 270]
  ------------------
 6402|  37.1k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6402:29): [True: 1.05k, False: 36.1k]
  ------------------
 6403|  1.05k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|  1.05k|                                                                                                          it, end);
 6405|  1.05k|                           return;
 6406|  1.05k|                        }
 6407|  37.1k|                     }
 6408|  37.1k|                     if constexpr (counts::n_object > 0) {
 6409|  37.1k|                        const bool starts_explicit_mapping_indicator =
 6410|  37.1k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6410:29): [True: 13.3k, False: 23.7k]
  |  Branch (6410:43): [True: 1.43k, False: 11.9k]
  |  Branch (6410:57): [True: 570, False: 11.3k]
  ------------------
 6411|  2.00k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6411:29): [True: 325, False: 1.68k]
  |  Branch (6411:48): [True: 1.04k, False: 640]
  ------------------
 6412|  37.1k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6412:29): [True: 1.36k, False: 35.7k]
  ------------------
 6413|  1.36k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|  1.36k|                                                                                                           it, end);
 6415|  1.36k|                           return;
 6416|  1.36k|                        }
 6417|  35.7k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6417:29): [True: 0, False: 35.7k]
  ------------------
 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|  35.7k|                     }
 6423|  37.1k|                  }
 6424|       |
 6425|  37.1k|                  if constexpr (counts::n_str > 0) {
 6426|  37.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|  37.1k|                     return;
 6428|  37.1k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|  37.1k|                  return;
 6433|  40.8k|               }
 6434|  71.9k|               }
 6435|      0|               return;
 6436|  71.9k|            }
 6437|  21.1k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 21.1k, False: 710k]
  ------------------
 6438|  21.1k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|  21.1k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6440:23): [True: 9.52k, False: 11.6k]
  |  Branch (6440:51): [True: 857, False: 8.67k]
  ------------------
 6441|    857|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|    857|                                                                                                     end);
 6443|    857|                     return;
 6444|    857|                  }
 6445|  21.1k|               }
 6446|       |               // Flow mapping - object type
 6447|  20.2k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  21.1k|               return;
 6449|  29.2k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 29.2k, False: 702k]
  ------------------
 6450|  29.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|  29.2k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6452:23): [True: 19.4k, False: 9.77k]
  |  Branch (6452:51): [True: 667, False: 18.8k]
  ------------------
 6453|    667|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|    667|                                                                                                     end);
 6455|    667|                     return;
 6456|    667|                  }
 6457|  29.2k|               }
 6458|       |               // Flow sequence - array type
 6459|  28.5k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  29.2k|               return;
 6461|  90.7k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 90.7k, False: 641k]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|  90.7k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 90.4k, False: 307]
  |  Branch (6463:39): [True: 3, False: 90.4k]
  ------------------
 6464|      3|                  ctx.error = error_code::syntax_error;
 6465|      3|                  return;
 6466|      3|               }
 6467|  90.7k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 90.4k, False: 307]
  |  Branch (6467:40): [True: 29.1k, False: 61.3k]
  |  Branch (6467:56): [True: 26.1k, False: 35.1k]
  |  Branch (6467:73): [True: 26.8k, False: 8.28k]
  ------------------
 6468|  82.1k|                  if constexpr (counts::n_object > 0) {
 6469|  82.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|  82.1k|                                                                                                     end);
 6471|  82.1k|                     return;
 6472|  82.1k|                  }
 6473|  82.1k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|  90.7k|               return;
 6476|      9|            case '%':
  ------------------
  |  Branch (6476:13): [True: 9, False: 731k]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|      9|               ctx.error = error_code::syntax_error;
 6479|      9|               return;
 6480|  1.76k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 1.76k, False: 730k]
  ------------------
 6481|  2.76k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 995, False: 730k]
  ------------------
 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.76k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  2.76k|               return;
 6486|  10.7k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 10.7k, False: 721k]
  ------------------
 6487|  15.1k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 4.34k, False: 727k]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  15.1k|               if constexpr (counts::n_bool > 0) {
 6490|  15.1k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 14.5k, False: 565]
  |  Branch (6490:44): [True: 11.9k, False: 2.54k]
  |  Branch (6490:60): [True: 10.8k, False: 1.10k]
  |  Branch (6490:76): [True: 10.0k, False: 890]
  ------------------
 6491|  10.8k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 1.38k, False: 3.14k]
  |  Branch (6491:60): [True: 1.11k, False: 274]
  |  Branch (6491:76): [True: 847, False: 264]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  10.8k|                     const auto after_true = it + 4;
 6494|  10.8k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  10.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 10.3k, False: 504]
  ------------------
 6497|  10.3k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 245, False: 10.1k]
  ------------------
 6498|    245|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|    245|                           return;
 6500|    245|                        }
 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.1k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 8.50k, False: 1.59k]
  |  Branch (6503:47): [True: 3.70k, False: 4.79k]
  ------------------
 6504|  3.70k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 2.32k, False: 1.37k]
  |  Branch (6504:47): [True: 500, False: 875]
  |  Branch (6504:63): [True: 261, False: 614]
  |  Branch (6504:80): [True: 268, False: 346]
  |  Branch (6504:97): [True: 346, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  3.70k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  3.70k|                           return;
 6508|  3.70k|                        }
 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.1k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  10.8k|                  }
 6515|  15.1k|               }
 6516|  4.75k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  15.1k|               return;
 6518|  10.2k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 10.2k, False: 721k]
  ------------------
 6519|  17.5k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 7.31k, False: 724k]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  17.5k|               if constexpr (counts::n_bool > 0) {
 6522|  17.5k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 17.1k, False: 379]
  |  Branch (6522:44): [True: 12.1k, False: 5.02k]
  |  Branch (6522:60): [True: 11.4k, False: 708]
  |  Branch (6522:76): [True: 8.99k, False: 2.42k]
  |  Branch (6522:92): [True: 8.28k, False: 710]
  ------------------
 6523|  8.90k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 1.71k, False: 7.14k]
  |  Branch (6523:60): [True: 1.31k, False: 404]
  |  Branch (6523:76): [True: 916, False: 398]
  |  Branch (6523:92): [True: 620, False: 296]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  8.90k|                     const auto after_false = it + 5;
 6526|  8.90k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  8.90k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 8.07k, False: 829]
  ------------------
 6529|  8.07k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 513, False: 7.56k]
  ------------------
 6530|    513|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|    513|                           return;
 6532|    513|                        }
 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.56k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 7.43k, False: 125]
  |  Branch (6535:47): [True: 1.79k, False: 5.64k]
  ------------------
 6536|  1.79k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 255, False: 1.53k]
  |  Branch (6536:47): [True: 218, False: 1.32k]
  |  Branch (6536:63): [True: 489, False: 831]
  |  Branch (6536:80): [True: 268, False: 563]
  |  Branch (6536:97): [True: 563, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  1.79k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  1.79k|                           return;
 6540|  1.79k|                        }
 6541|  5.76k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  5.76k|                                                                                                      end);
 6543|  5.76k|                        return;
 6544|  7.56k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  8.90k|                  }
 6547|  17.5k|               }
 6548|  9.45k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  17.5k|               return;
 6550|  4.66k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 4.66k, False: 727k]
  ------------------
 6551|  17.7k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 13.1k, False: 718k]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  17.7k|               if constexpr (counts::n_null > 0) {
 6554|  17.7k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 17.4k, False: 346]
  |  Branch (6554:44): [True: 6.13k, False: 11.3k]
  |  Branch (6554:60): [True: 5.47k, False: 665]
  |  Branch (6554:76): [True: 5.18k, False: 290]
  ------------------
 6555|  14.7k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 10.2k, False: 2.03k]
  |  Branch (6555:60): [True: 9.78k, False: 449]
  |  Branch (6555:76): [True: 9.54k, False: 246]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  14.7k|                     const auto after_null = it + 4;
 6558|  14.7k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  14.7k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 12.5k, False: 2.20k]
  ------------------
 6561|  12.5k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 263, False: 12.2k]
  ------------------
 6562|    263|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|    263|                           return;
 6564|    263|                        }
 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|  12.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 11.8k, False: 418]
  |  Branch (6567:47): [True: 1.80k, False: 10.0k]
  ------------------
 6568|  1.80k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 263, False: 1.54k]
  |  Branch (6568:47): [True: 368, False: 1.17k]
  |  Branch (6568:63): [True: 542, False: 635]
  |  Branch (6568:80): [True: 372, False: 263]
  |  Branch (6568:97): [True: 263, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  1.80k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  1.80k|                           return;
 6572|  1.80k|                        }
 6573|  10.4k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  10.4k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  10.4k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 10.4k]
  ------------------
 6576|  10.4k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  10.4k|                        return;
 6578|  12.2k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  14.7k|                  }
 6581|  17.7k|               }
 6582|  5.27k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  17.7k|               return;
 6584|  1.37k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 1.37k, False: 730k]
  ------------------
 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.2k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 44.2k, False: 687k]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|  44.2k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 669, False: 43.5k]
  |  Branch (6596:41): [True: 33.5k, False: 10.0k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|  34.1k|                  if constexpr (counts::n_array > 0) {
 6599|  34.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|  34.1k|                                                                                                    end);
 6601|  34.1k|                     return;
 6602|  34.1k|                  }
 6603|  34.1k|               }
 6604|  44.2k|               if constexpr (counts::n_num > 0) {
 6605|  44.2k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 10.0k, False: 34.1k]
  |  Branch (6605:43): [True: 763, False: 9.27k]
  |  Branch (6605:94): [True: 885, False: 8.38k]
  ------------------
 6606|  1.64k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  1.64k|                     return;
 6608|  1.64k|                  }
 6609|  44.2k|               }
 6610|  42.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|  44.2k|               return;
 6612|  3.39k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 3.39k, False: 728k]
  ------------------
 6613|  10.8k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 7.42k, False: 724k]
  ------------------
 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.8k|               if constexpr (counts::n_num > 0) {
 6617|  10.8k|                  auto start_it = it;
 6618|  10.8k|                  auto temp_ctx = ctx.make_speculative();
 6619|  10.8k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  10.8k|                                                                                               end);
 6621|  10.8k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  10.8k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  10.8k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 3.43k, False: 7.38k]
  ------------------
 6624|  3.43k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  3.43k|                     return; // Successfully parsed as number
 6626|  3.43k|                  }
 6627|  7.38k|                  it = start_it; // Restore and fall through to string
 6628|  7.38k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  10.8k|               return;
 6631|   192k|            default:
  ------------------
  |  Branch (6631:13): [True: 192k, False: 539k]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|   192k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 109k, False: 83.1k]
  |  Branch (6633:32): [True: 25.3k, False: 84.4k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  25.3k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 8.72k, False: 16.5k]
  ------------------
 6636|  8.72k|                     return;
 6637|  8.72k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  16.5k|                  if constexpr (counts::n_num > 0) {
 6640|  16.5k|                     auto start_it = it;
 6641|  16.5k|                     auto temp_ctx = ctx.make_speculative();
 6642|  16.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  16.5k|                                                                                                  end);
 6644|  16.5k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  16.5k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  16.5k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 2.83k, False: 13.7k]
  ------------------
 6647|  2.83k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  2.83k|                        return; // Successfully parsed as number
 6649|  2.83k|                     }
 6650|  13.7k|                     it = start_it; // Restore and fall through to string
 6651|  13.7k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|  16.5k|                  return;
 6655|  25.3k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   167k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   167k|               return;
 6659|   731k|            }
 6660|   731k|         }
 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|   731k|         error_code expansion_error{};
 6670|   731k|         std::string_view expansion_message{};
 6671|       |
 6672|   731k|         auto try_parse = [&]<size_t I>() -> bool {
 6673|   731k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|   731k|            auto start = it;
 6675|       |
 6676|   731k|            V v{};
 6677|   731k|            auto temp_ctx = ctx.make_speculative();
 6678|   731k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|   731k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|   731k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|   731k|            if (!bool(temp_ctx.error)) {
 6683|   731k|               value = std::move(v);
 6684|   731k|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|   731k|               return true;
 6686|   731k|            }
 6687|       |
 6688|   731k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|   731k|               expansion_error = temp_ctx.error;
 6690|   731k|               expansion_message = temp_ctx.custom_error_message;
 6691|   731k|            }
 6692|   731k|            it = start;
 6693|   731k|            return false;
 6694|   731k|         };
 6695|       |
 6696|   731k|         bool parsed = false;
 6697|   731k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|   731k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|   731k|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|   731k|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 731k]
  ------------------
 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|   731k|      }
_ZN3glz4yaml26alias_token_is_mapping_keyIPKcS3_EEbT_T0_:
  371|  9.62M|      {
  372|  9.62M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (372:14): [True: 0, False: 9.62M]
  |  Branch (372:27): [True: 9.00M, False: 618k]
  ------------------
  373|   618k|         ++it; // skip '*'
  374|   618k|         auto name = parse_anchor_name(it, end);
  375|   618k|         if (name.empty()) return false;
  ------------------
  |  Branch (375:14): [True: 1.00k, False: 617k]
  ------------------
  376|   617k|         skip_inline_ws(it, end);
  377|   617k|         return (it != end && *it == ':') &&
  ------------------
  |  Branch (377:18): [True: 594k, False: 22.5k]
  |  Branch (377:31): [True: 115k, False: 479k]
  ------------------
  378|   115k|                ((it + 1) == end || whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (378:18): [True: 15.9k, False: 99.7k]
  |  Branch (378:37): [True: 72.2k, False: 27.4k]
  ------------------
  379|   618k|      }
_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|   303k|      {
 5311|   303k|         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|   303k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   303k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   303k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   303k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 303k, False: 0]
  ------------------
 5321|   303k|            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|   303k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|   306k|      {
 4617|   306k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 306k]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|   306k|         yaml::node_preamble_state preamble{};
 4621|   306k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 4.00k, False: 302k]
  ------------------
 4622|   306k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  4.00k|            return;
 4624|       |
 4625|   302k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|   302k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 6, False: 302k]
  ------------------
 4627|      6|            return;
 4628|       |
 4629|   302k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|   302k|         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|   302k|         std::remove_cvref_t<T> preexisting_entries;
 4643|   302k|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 302k]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|   302k|         struct merge_restore_guard
 4648|   302k|         {
 4649|   302k|            std::remove_cvref_t<T>& target;
 4650|   302k|            std::remove_cvref_t<T>& saved;
 4651|   302k|            ~merge_restore_guard()
 4652|   302k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   302k|               for (auto& entry : saved) {
 4656|   302k|                  target.emplace(entry.first, std::move(entry.second));
 4657|   302k|               }
 4658|   302k|            }
 4659|   302k|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|   302k|         const bool treat_as_block_mapping =
 4662|   302k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [True: 302k, Folded]
  |  Branch (4662:48): [True: 25.1k, False: 277k]
  |  Branch (4662:62): [True: 466, False: 24.6k]
  ------------------
 4663|       |
 4664|   302k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 25.1k, False: 277k]
  |  Branch (4664:28): [True: 24.6k, False: 466]
  ------------------
 4665|       |            // Flow mapping
 4666|  24.6k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  24.6k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  24.6k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 24.0k, False: 630]
  |  Branch (4670:30): [True: 4.05k, False: 19.9k]
  ------------------
 4671|  4.05k|               ++it;
 4672|  4.05k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  4.05k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 11, False: 4.04k]
  ------------------
 4674|     11|                  return;
 4675|  4.04k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  4.04k|               return;
 4677|  4.05k|            }
 4678|       |
 4679|  72.8k|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 70.6k, False: 2.19k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  70.6k|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  70.6k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 70.6k, False: 0]
  |  Branch (4683:33): [True: 3.14k, False: 67.4k]
  ------------------
 4684|  3.14k|                  ++it;
 4685|  3.14k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  3.14k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 7, False: 3.13k]
  ------------------
 4687|      7|                     return;
 4688|  3.13k|                  break;
 4689|  3.14k|               }
 4690|       |
 4691|  67.4k|               bool explicit_flow_key = false;
 4692|  67.4k|               auto explicit_probe = it;
 4693|  67.4k|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  67.4k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 67.4k, False: 0]
  |  Branch (4694:45): [True: 2.51k, False: 64.9k]
  ------------------
 4695|  2.51k|                  const auto after_q = explicit_probe + 1;
 4696|  2.51k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 6, False: 2.50k]
  |  Branch (4696:41): [True: 1.00k, False: 1.50k]
  ------------------
 4697|  1.81k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 407, False: 1.09k]
  |  Branch (4697:42): [True: 397, False: 699]
  ------------------
 4698|  1.81k|                     explicit_flow_key = true;
 4699|  1.81k|                     it = explicit_probe + 1;
 4700|  1.81k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  1.81k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 2, False: 1.81k]
  ------------------
 4702|      2|                        return;
 4703|  1.81k|                  }
 4704|  2.51k|               }
 4705|       |               // Parse key
 4706|  67.4k|               key_t key{};
 4707|  67.4k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  67.4k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 1.81k, False: 65.6k]
  |  Branch (4708:44): [True: 1.79k, False: 16]
  |  Branch (4708:58): [True: 241, False: 1.55k]
  |  Branch (4708:72): [True: 661, False: 894]
  |  Branch (4708:86): [True: 472, False: 422]
  ------------------
 4709|  1.37k|                     key.clear();
 4710|  1.37k|                  }
 4711|  66.0k|                  else {
 4712|  66.0k|                     auto key_probe = it;
 4713|  66.0k|                     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.0k|                     bool parse_complex_flow_key = false;
 4718|  66.0k|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 66.0k, False: 16]
  ------------------
 4719|  66.0k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 683, False: 65.3k]
  |  Branch (4719:50): [True: 2.74k, False: 62.6k]
  ------------------
 4720|  3.42k|                           parse_complex_flow_key = true;
 4721|  3.42k|                        }
 4722|  62.6k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 6.85k, False: 55.7k]
  ------------------
 4723|  6.85k|                           ++key_probe;
 4724|  6.85k|                           yaml::parse_anchor_name(key_probe, end);
 4725|  6.85k|                           yaml::skip_inline_ws(key_probe, end);
 4726|  6.85k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 6.78k, False: 68]
  |  Branch (4726:53): [True: 394, False: 6.39k]
  |  Branch (4726:74): [True: 567, False: 5.82k]
  ------------------
 4727|    961|                              parse_complex_flow_key = true;
 4728|    961|                           }
 4729|  6.85k|                        }
 4730|  66.0k|                     }
 4731|       |
 4732|  66.0k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 4.38k, False: 61.7k]
  ------------------
 4733|  4.38k|                        glz::generic key_node{};
 4734|  4.38k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  4.38k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 917, False: 3.46k]
  ------------------
 4736|    917|                           return;
 4737|  3.46k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 3, False: 3.46k]
  ------------------
 4738|      3|                           return;
 4739|  3.46k|                     }
 4740|  61.7k|                     else {
 4741|  61.7k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 1.51k, False: 60.1k]
  ------------------
 4742|  1.51k|                           return;
 4743|  1.51k|                        }
 4744|  61.7k|                     }
 4745|  66.0k|                  }
 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.0k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  67.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 5, False: 67.4k]
  ------------------
 4761|      5|                  return;
 4762|       |
 4763|  67.4k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  67.4k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  67.4k|                     val = {};
 4766|  67.4k|                     return true;
 4767|  67.4k|                  }
 4768|  67.4k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  67.4k|                     val = glz::generic{};
 4770|  67.4k|                     return true;
 4771|  67.4k|                  }
 4772|  67.4k|                  else {
 4773|  67.4k|                     static constexpr std::string_view null_value{"null"};
 4774|  67.4k|                     auto null_it = null_value.data();
 4775|  67.4k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  67.4k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  67.4k|                     return !bool(ctx.error);
 4778|  67.4k|                  }
 4779|  67.4k|               };
 4780|       |
 4781|  67.4k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 63.8k, False: 3.58k]
  |  Branch (4781:34): [True: 39.8k, False: 23.9k]
  |  Branch (4781:48): [True: 5.71k, False: 18.2k]
  ------------------
 4782|  45.6k|                  val_t val{};
 4783|  45.6k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 45.6k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|  45.6k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|  45.6k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 5.71k, False: 39.8k]
  ------------------
 4789|  5.71k|                     ++it;
 4790|  5.71k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  5.71k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 18, False: 5.69k]
  ------------------
 4792|     18|                        return;
 4793|  5.69k|                     break;
 4794|  5.71k|                  }
 4795|       |
 4796|  39.8k|                  ++it; // skip comma
 4797|  39.8k|                  yaml::skip_ws_and_newlines(it, end);
 4798|  39.8k|                  continue;
 4799|  45.6k|               }
 4800|       |
 4801|  21.8k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 3.58k, False: 18.2k]
  |  Branch (4801:33): [True: 227, False: 18.0k]
  ------------------
 4802|  1.37k|                  ctx.error = error_code::syntax_error;
 4803|  1.37k|                  return;
 4804|  1.37k|               }
 4805|  20.4k|               ++it;
 4806|       |
 4807|  20.4k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  20.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 4, False: 20.4k]
  ------------------
 4809|      4|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  20.4k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 17.9k, False: 2.52k]
  |  Branch (4812:34): [True: 3.30k, False: 14.6k]
  |  Branch (4812:48): [True: 3.14k, False: 11.5k]
  ------------------
 4813|  6.45k|                  val_t val{};
 4814|  6.45k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 6.45k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  6.45k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  6.45k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 3.14k, False: 3.30k]
  ------------------
 4820|  3.14k|                     ++it;
 4821|  3.14k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  3.14k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 4, False: 3.14k]
  ------------------
 4823|      4|                        return;
 4824|  3.14k|                     break;
 4825|  3.14k|                  }
 4826|       |
 4827|  3.30k|                  ++it; // skip comma
 4828|  3.30k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  3.30k|                  continue;
 4830|  6.45k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  14.0k|               val_t val{};
 4834|  14.0k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  14.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 339, False: 13.6k]
  ------------------
 4836|    339|                  return;
 4837|       |
 4838|  13.6k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  13.6k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  13.6k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 10.9k, False: 2.69k]
  |  Branch (4842:33): [True: 1.53k, False: 9.46k]
  ------------------
 4843|  1.53k|                  ++it;
 4844|  1.53k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|  1.53k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 10, False: 1.52k]
  ------------------
 4846|     10|                     return;
 4847|  1.52k|                  break;
 4848|  1.53k|               }
 4849|  12.1k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 9.46k, False: 2.69k]
  |  Branch (4849:38): [True: 7.96k, False: 1.49k]
  ------------------
 4850|  7.96k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  7.96k|                  yaml::skip_ws_and_newlines(it, end);
 4853|  7.96k|               }
 4854|  4.18k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 1.49k, False: 2.69k]
  |  Branch (4854:39): [True: 714, False: 781]
  |  Branch (4854:54): [True: 715, False: 66]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  1.42k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  1.42k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 1.36k, False: 64]
  |  Branch (4858:36): [True: 276, False: 1.08k]
  ------------------
 4859|    276|                     ++it;
 4860|    276|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|    276|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 2, False: 274]
  ------------------
 4862|      2|                        return;
 4863|    274|                     break;
 4864|    276|                  }
 4865|  1.15k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 1.08k, False: 64]
  |  Branch (4865:36): [True: 1.06k, False: 28]
  ------------------
 4866|  1.06k|                     ++it;
 4867|  1.06k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  1.06k|                     continue;
 4869|  1.06k|                  }
 4870|     92|                  ctx.error = error_code::syntax_error;
 4871|     92|                  return;
 4872|  1.15k|               }
 4873|  2.75k|               else {
 4874|  2.75k|                  ctx.error = error_code::syntax_error;
 4875|  2.75k|                  return;
 4876|  2.75k|               }
 4877|  13.6k|            }
 4878|  20.5k|         }
 4879|   278k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   278k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   278k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   278k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   278k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   278k|                        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|   278k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   278k|                           if (ctx.stream_begin) {
 4893|   278k|                              auto is_line_content_start = [&](auto pos) {
 4894|   278k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   278k|                              };
 4896|       |
 4897|   278k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   278k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   278k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   278k|                                 return line != end && *line == ':';
 4901|   278k|                              };
 4902|       |
 4903|   278k|                              if (!is_line_content_start(it) &&
 4904|   278k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   278k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   278k|                                 ctx.error = error_code::syntax_error;
 4907|   278k|                                 return false;
 4908|   278k|                              }
 4909|   278k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   278k|                           }
 4911|   278k|                        }
 4912|       |
 4913|   278k|                        if (*it == '-' &&
 4914|   278k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   278k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   278k|                           ctx.error = error_code::syntax_error;
 4918|   278k|                           return false;
 4919|   278k|                        }
 4920|       |
 4921|   278k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   278k|                           return false;
 4923|   278k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   278k|                        ctx.pop_indent();
 4925|   278k|                     }
 4926|   278k|                     else {
 4927|   278k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   278k|                        if (nested_indent >= 0) {
 4929|   278k|                           yaml::skip_to_content(it, end);
 4930|   278k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   278k|                              ctx.error = error_code::syntax_error;
 4932|   278k|                              return false;
 4933|   278k|                           }
 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|   278k|                           const int32_t value_indent =
 4937|   278k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   278k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   278k|                              return false;
 4940|   278k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   278k|                           ctx.pop_indent();
 4942|   278k|                        }
 4943|   278k|                     }
 4944|   278k|                     return !bool(ctx.error);
 4945|   278k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   278k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   278k|                     ctx.error = error_code::syntax_error;
 4952|   278k|                     return false;
 4953|   278k|                  }
 4954|   278k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   278k|                     ++it; // skip '?'
 4956|   278k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   278k|                     const int32_t explicit_value_indicator_indent =
 4959|   278k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   278k|                     key_t key{};
 4962|   278k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   278k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   278k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   278k|                        };
 4966|       |
 4967|   278k|                        auto key_it = it;
 4968|   278k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   278k|                        auto content = key_it;
 4971|   278k|                        yaml::skip_to_content(content, end);
 4972|   278k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   278k|                        if (content != end && *content == '&') {
 4978|   278k|                           auto anchor_probe = content + 1;
 4979|   278k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   278k|                           if (!anchor_name.empty()) {
 4981|   278k|                              auto after_anchor = anchor_probe;
 4982|   278k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   278k|                              auto value_indicator = after_anchor;
 4985|   278k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   278k|                                 key.clear();
 4987|   278k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   278k|                                 it = value_indicator;
 4989|   278k|                                 handled_anchor_only_empty_key = true;
 4990|   278k|                              }
 4991|   278k|                              else {
 4992|   278k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   278k|                                    yaml::skip_comment(value_indicator, end);
 4994|   278k|                                 }
 4995|   278k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   278k|                                    yaml::skip_newline(value_indicator, end);
 4997|   278k|                                    auto value_line = value_indicator;
 4998|   278k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   278k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   278k|                                       return false;
 5001|   278k|                                    if (value_line != end && *value_line == ':' &&
 5002|   278k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   278k|                                       key.clear();
 5004|   278k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   278k|                                       it = value_line;
 5006|   278k|                                       handled_anchor_only_empty_key = true;
 5007|   278k|                                    }
 5008|   278k|                                    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|   278k|                                       ctx.error = error_code::syntax_error;
 5013|   278k|                                       return false;
 5014|   278k|                                    }
 5015|   278k|                                 }
 5016|   278k|                              }
 5017|   278k|                           }
 5018|   278k|                        }
 5019|       |
 5020|   278k|                        const bool key_content_spans_lines = [&] {
 5021|   278k|                           auto scan = key_it;
 5022|   278k|                           while (scan != content && scan != end) {
 5023|   278k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   278k|                              ++scan;
 5025|   278k|                           }
 5026|   278k|                           return false;
 5027|   278k|                        }();
 5028|       |
 5029|   278k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   278k|                        }
 5032|   278k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   278k|                           key.clear();
 5034|   278k|                           it = content;
 5035|   278k|                        }
 5036|   278k|                        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|   278k|                           auto key_node_it = content;
 5042|   278k|                           auto key_node_end = end;
 5043|   278k|                           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|   278k|                              auto scan = content;
 5048|   278k|                              while (scan != end) {
 5049|   278k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   278k|                                    ++scan;
 5051|   278k|                                 }
 5052|   278k|                                 if (scan == end) {
 5053|   278k|                                    break;
 5054|   278k|                                 }
 5055|       |
 5056|   278k|                                 yaml::skip_newline(scan, end);
 5057|   278k|                                 auto line_start = scan;
 5058|       |
 5059|   278k|                                 int32_t indicator_indent = 0;
 5060|   278k|                                 while (scan != end && *scan == ' ') {
 5061|   278k|                                    ++indicator_indent;
 5062|   278k|                                    ++scan;
 5063|   278k|                                 }
 5064|       |
 5065|   278k|                                 if (scan != end && *scan == ':') {
 5066|   278k|                                    const auto after_colon = scan + 1;
 5067|   278k|                                    if ((after_colon == end ||
 5068|   278k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   278k|                                        indicator_indent <= line_indent) {
 5070|   278k|                                       key_node_end = line_start;
 5071|   278k|                                       break;
 5072|   278k|                                    }
 5073|   278k|                                 }
 5074|   278k|                              }
 5075|   278k|                           }
 5076|       |
 5077|   278k|                           glz::generic key_node{};
 5078|   278k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   278k|                           ctx.explicit_mapping_key_context = true;
 5080|   278k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   278k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   278k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   278k|                              return false;
 5084|   278k|                           it = key_node_it;
 5085|   278k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   278k|                              return false;
 5087|   278k|                        }
 5088|   278k|                     }
 5089|   278k|                     else {
 5090|   278k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   278k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   278k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   278k|                              return false;
 5094|   278k|                        }
 5095|   278k|                     }
 5096|       |
 5097|   278k|                     yaml::skip_inline_ws(it, end);
 5098|   278k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   278k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   278k|                        auto probe = it;
 5103|   278k|                        bool found_value_indicator = false;
 5104|       |
 5105|   278k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   278k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   278k|                           auto value_line = probe;
 5109|   278k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   278k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   278k|                              return false;
 5112|       |
 5113|   278k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   278k|                              probe = value_line;
 5115|   278k|                              continue; // blank line
 5116|   278k|                           }
 5117|   278k|                           if (*value_line == '#') {
 5118|   278k|                              yaml::skip_comment(value_line, end);
 5119|   278k|                              probe = value_line;
 5120|   278k|                              continue; // comment-only line
 5121|   278k|                           }
 5122|   278k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   278k|                              it = value_line;
 5124|   278k|                              found_value_indicator = true;
 5125|   278k|                           }
 5126|   278k|                           break;
 5127|   278k|                        }
 5128|       |
 5129|   278k|                        if (found_value_indicator) {
 5130|   278k|                           yaml::skip_inline_ws(it, end);
 5131|   278k|                        }
 5132|   278k|                     }
 5133|       |
 5134|   278k|                     val_t val{};
 5135|   278k|                     if (it != end && *it == ':') {
 5136|   278k|                        ++it;
 5137|   278k|                        if (it != end && *it == '\t') {
 5138|   278k|                           ctx.error = error_code::syntax_error;
 5139|   278k|                           return false;
 5140|   278k|                        }
 5141|   278k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   278k|                           auto probe = it;
 5143|   278k|                           yaml::skip_newline(probe, end);
 5144|   278k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   278k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   278k|                              ctx.error = error_code::syntax_error;
 5147|   278k|                              return false;
 5148|   278k|                           }
 5149|   278k|                        }
 5150|   278k|                        yaml::skip_inline_ws(it, end);
 5151|   278k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   278k|                           return false;
 5153|   278k|                     }
 5154|       |
 5155|   278k|                     value.emplace(std::move(key), std::move(val));
 5156|   278k|                     return true;
 5157|   278k|                  }
 5158|       |
 5159|   278k|                  key_t key{};
 5160|   278k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   278k|                     auto key_probe = it;
 5162|   278k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   278k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   278k|                     if (complex_flow_key) {
 5165|   278k|                        glz::generic key_node{};
 5166|   278k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   278k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   278k|                           return false;
 5169|   278k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   278k|                           return false;
 5171|   278k|                     }
 5172|   278k|                     else {
 5173|   278k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   278k|                           return false;
 5175|   278k|                        }
 5176|   278k|                     }
 5177|   278k|                  }
 5178|   278k|                  else {
 5179|   278k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   278k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   278k|                        return false;
 5182|   278k|                  }
 5183|       |
 5184|   278k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   278k|                  if (it == end || *it != ':') {
 5187|   278k|                     ctx.error = error_code::syntax_error;
 5188|   278k|                     return false;
 5189|   278k|                  }
 5190|   278k|                  ++it;
 5191|   278k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   278k|                  val_t val{};
 5194|   278k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   278k|                     return false;
 5196|       |
 5197|   278k|                  value.emplace(std::move(key), std::move(val));
 5198|   278k|                  return true;
 5199|   278k|               });
 5200|   278k|         }
 5201|       |
 5202|   293k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|   293k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   306k|      {
  466|   306k|         skip_inline_ws(it, end);
  467|       |
  468|   306k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 306k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|   306k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   306k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 306k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   306k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 306k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   306k|         skip_inline_ws(it, end);
  486|       |
  487|   306k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 306k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   306k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.99k, False: 302k]
  ------------------
  495|  3.99k|            return true;
  496|  3.99k|         }
  497|       |
  498|   302k|         return false;
  499|   306k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|   306k|                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|   306k|      {
  409|   306k|         state.has_anchor = false;
  410|   306k|         state.anchor_name.clear();
  411|   306k|         state.anchor_start = nullptr;
  412|   306k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   306k|         if constexpr (Policy.allow_alias) {
  415|   306k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   306k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 298k, False: 7.66k]
  ------------------
  417|   298k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 3.96k, False: 295k]
  ------------------
  418|   298k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   306k|         }
  424|       |
  425|   306k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 302k, False: 3.96k]
  |  Branch (425:27): [True: 21.4k, False: 281k]
  ------------------
  426|  21.4k|            ++it;
  427|  21.4k|            auto name = parse_anchor_name(it, end);
  428|  21.4k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 19, False: 21.4k]
  ------------------
  429|     19|               ctx.error = error_code::syntax_error;
  430|     19|               return true;
  431|     19|            }
  432|  21.4k|            skip_inline_ws(it, end);
  433|  21.4k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 5, False: 21.4k]
  ------------------
  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|  21.4k|            state.has_anchor = true;
  446|  21.4k|            state.anchor_name = std::string(name);
  447|  21.4k|            state.anchor_start = &*it;
  448|  21.4k|         }
  449|       |
  450|   306k|         return false;
  451|   306k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   298k|      {
  301|   298k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 298k]
  |  Branch (301:27): [True: 295k, False: 3.96k]
  ------------------
  302|       |
  303|  3.96k|         ++it; // skip '*'
  304|  3.96k|         auto name = parse_anchor_name(it, end);
  305|  3.96k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 11, False: 3.95k]
  ------------------
  306|     11|            ctx.error = error_code::syntax_error;
  307|     11|            return true;
  308|     11|         }
  309|       |
  310|  3.95k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.95k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 28, False: 3.92k]
  ------------------
  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.92k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.92k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 911, False: 3.01k]
  ------------------
  322|    911|            return true;
  323|    911|         }
  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.01k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 18, False: 3.00k]
  ------------------
  329|     18|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     18|            return true;
  331|     18|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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.00k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.00k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 2.99k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  2.99k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.99k]
  ------------------
  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.99k|         auto replay_it = span.begin;
  348|  2.99k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.99k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.99k|         ctx.indent_stack.clear();
  353|  2.99k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.38k, False: 617]
  ------------------
  354|  2.38k|            ctx.push_indent(span.base_indent - 1);
  355|  2.38k|         }
  356|       |
  357|  2.99k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.99k|         using V = std::remove_cvref_t<T>;
  360|  2.99k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.99k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.99k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.99k|         return true;
  367|  2.99k|      }
_ZN3glz4yaml40inline_value_has_plain_mapping_indicatorIPKcS3_EEbT_T0_:
 3104|  3.51M|      {
 3105|  3.51M|         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.51M|         bool at_node_start = true;
 3109|  3.51M|         int flow_depth = 0;
 3110|  29.8M|         while (pos != stop) {
  ------------------
  |  Branch (3110:17): [True: 29.5M, False: 255k]
  ------------------
 3111|  29.5M|            const char c = *pos;
 3112|  29.5M|            if (c == '\n' || c == '\r' || c == '#') return false;
  ------------------
  |  Branch (3112:17): [True: 691k, False: 28.8M]
  |  Branch (3112:30): [True: 532k, False: 28.3M]
  |  Branch (3112:43): [True: 1.46M, False: 26.8M]
  ------------------
 3113|  26.8M|            if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (3113:17): [True: 5.76M, False: 21.1M]
  |  Branch (3113:29): [True: 723k, False: 20.4M]
  ------------------
 3114|  6.49M|               ++pos;
 3115|  6.49M|               continue;
 3116|  6.49M|            }
 3117|  20.4M|            const bool node_start = std::exchange(at_node_start, false);
 3118|       |
 3119|  20.4M|            if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (3119:18): [True: 229k, False: 20.1M]
  |  Branch (3119:30): [True: 44.1k, False: 20.1M]
  |  Branch (3119:44): [True: 121k, False: 152k]
  ------------------
 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|   121k|               if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (3122:20): [True: 4.93k, False: 116k]
  ------------------
 3123|   116k|               continue;
 3124|   121k|            }
 3125|  20.2M|            if ((c == '[' || c == '{') && (node_start || flow_depth > 0)) {
  ------------------
  |  Branch (3125:18): [True: 262k, False: 20.0M]
  |  Branch (3125:30): [True: 534k, False: 19.4M]
  |  Branch (3125:44): [True: 637k, False: 159k]
  |  Branch (3125:58): [True: 81.8k, False: 77.8k]
  ------------------
 3126|   719k|               ++flow_depth;
 3127|   719k|               at_node_start = true;
 3128|   719k|               ++pos;
 3129|   719k|               continue;
 3130|   719k|            }
 3131|  19.5M|            if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (3131:18): [True: 129k, False: 19.4M]
  |  Branch (3131:30): [True: 276k, False: 19.1M]
  |  Branch (3131:43): [True: 194k, False: 211k]
  ------------------
 3132|   194k|               --flow_depth;
 3133|   194k|               ++pos;
 3134|   194k|               continue;
 3135|   194k|            }
 3136|  19.3M|            if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (3136:17): [True: 947k, False: 18.4M]
  |  Branch (3136:29): [True: 565k, False: 381k]
  ------------------
 3137|   565k|               const auto next = pos + 1;
 3138|   565k|               return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (3138:23): [True: 5.98k, False: 559k]
  |  Branch (3138:40): [True: 197k, False: 362k]
  |  Branch (3138:56): [True: 10.9k, False: 351k]
  |  Branch (3138:73): [True: 7.04k, False: 344k]
  |  Branch (3138:90): [True: 50.5k, False: 293k]
  ------------------
 3139|   565k|            }
 3140|  18.8M|            if (flow_depth > 0 && (c == ',' || c == ':')) {
  ------------------
  |  Branch (3140:17): [True: 3.90M, False: 14.8M]
  |  Branch (3140:36): [True: 222k, False: 3.68M]
  |  Branch (3140:48): [True: 381k, False: 3.30M]
  ------------------
 3141|   604k|               at_node_start = true;
 3142|   604k|               ++pos;
 3143|   604k|               continue;
 3144|   604k|            }
 3145|  18.1M|            if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (3145:17): [True: 5.59M, False: 12.5M]
  |  Branch (3145:31): [True: 2.57M, False: 3.02M]
  ------------------
 3146|  2.57M|               at_node_start = true;
 3147|  2.57M|               continue;
 3148|  2.57M|            }
 3149|  15.6M|            ++pos;
 3150|  15.6M|         }
 3151|   255k|         return false;
 3152|  3.51M|      }
_ZN3glz4yaml32validate_flow_node_adjacent_tailINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  947|  4.83M|      {
  948|  4.83M|         if (it == end) return;
  ------------------
  |  Branch (948:14): [True: 1.80M, False: 3.02M]
  ------------------
  949|  3.02M|         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|  3.02M|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}' ||
  ------------------
  |  Branch (952:14): [True: 381k, False: 2.64M]
  |  Branch (952:26): [True: 67.8k, False: 2.57M]
  |  Branch (952:39): [True: 52.9k, False: 2.52M]
  |  Branch (952:52): [True: 105k, False: 2.42M]
  |  Branch (952:65): [True: 69.3k, False: 2.35M]
  |  Branch (952:77): [True: 1.79M, False: 556k]
  |  Branch (952:89): [True: 33.2k, False: 523k]
  |  Branch (952:101): [True: 71.1k, False: 452k]
  ------------------
  953|  3.02M|             c == ':') {
  ------------------
  |  Branch (953:14): [True: 449k, False: 3.03k]
  ------------------
  954|  3.02M|            return;
  955|  3.02M|         }
  956|  3.03k|         ctx.error = error_code::syntax_error;
  957|  3.03k|      }
_ZN3glz4yaml20finalize_node_anchorINS0_12yaml_contextEPKcEEvRNS0_19node_property_stateERT_T0_:
  455|  19.0M|      {
  456|  19.0M|         if (state.has_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (456:14): [True: 449k, False: 18.6M]
  |  Branch (456:34): [True: 419k, False: 30.7k]
  ------------------
  457|   419k|            ctx.anchors[std::move(state.anchor_name)] = {state.anchor_start, &*it, state.anchor_indent};
  458|   419k|         }
  459|  19.0M|      }
_ZN3glz4yaml25skip_flow_ws_and_newlinesINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_Pb:
  869|  32.4M|      {
  870|  32.4M|         bool at_line_start = false;
  871|  32.4M|         bool saw_separation_ws = false;
  872|  32.4M|         bool line_has_indent = false;
  873|  47.5M|         while (it != end) {
  ------------------
  |  Branch (873:17): [True: 47.0M, False: 554k]
  ------------------
  874|  47.0M|            if (*it == ' ') {
  ------------------
  |  Branch (874:17): [True: 9.53M, False: 37.4M]
  ------------------
  875|  9.53M|               ++it;
  876|  9.53M|               saw_separation_ws = true;
  877|  9.53M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (877:20): [True: 3.25M, False: 6.27M]
  ------------------
  878|  9.53M|               continue;
  879|  9.53M|            }
  880|  37.4M|            if (*it == '\t') {
  ------------------
  |  Branch (880:17): [True: 540k, False: 36.9M]
  ------------------
  881|   540k|               if (at_line_start && !line_has_indent) {
  ------------------
  |  Branch (881:20): [True: 174k, False: 365k]
  |  Branch (881:37): [True: 118k, False: 56.0k]
  ------------------
  882|   118k|                  auto probe = it;
  883|   293k|                  while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (883:26): [True: 290k, False: 2.87k]
  |  Branch (883:43): [True: 26.4k, False: 264k]
  |  Branch (883:60): [True: 148k, False: 115k]
  ------------------
  884|   118k|                  if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (884:23): [True: 115k, False: 2.87k]
  |  Branch (884:39): [True: 107k, False: 8.54k]
  |  Branch (884:57): [True: 17.2k, False: 90.1k]
  |  Branch (884:75): [True: 15.1k, False: 2.08k]
  ------------------
  885|  15.1k|                     const char c = *probe;
  886|  15.1k|                     const bool allowed_flow_delim = (c == ']' || c == '}' || c == '[' || c == '{' || c == ',');
  ------------------
  |  Branch (886:55): [True: 728, False: 14.4k]
  |  Branch (886:67): [True: 3.81k, False: 10.5k]
  |  Branch (886:79): [True: 290, False: 10.2k]
  |  Branch (886:91): [True: 540, False: 9.75k]
  |  Branch (886:103): [True: 9.54k, False: 214]
  ------------------
  887|  15.1k|                     if (!allowed_flow_delim) {
  ------------------
  |  Branch (887:26): [True: 214, False: 14.9k]
  ------------------
  888|    214|                        ctx.error = error_code::syntax_error;
  889|    214|                        return;
  890|    214|                     }
  891|  15.1k|                  }
  892|   118k|               }
  893|   540k|               ++it;
  894|   540k|               saw_separation_ws = true;
  895|   540k|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (895:20): [True: 174k, False: 365k]
  ------------------
  896|   540k|               continue;
  897|   540k|            }
  898|  36.9M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (898:17): [True: 932k, False: 36.0M]
  |  Branch (898:32): [True: 3.91M, False: 32.0M]
  ------------------
  899|  4.85M|               skip_newline(it, end);
  900|  4.85M|               if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (900:20): [True: 13.0k, False: 4.83M]
  ------------------
  901|  4.85M|               at_line_start = true;
  902|  4.85M|               saw_separation_ws = true;
  903|  4.85M|               line_has_indent = false;
  904|  4.85M|               continue;
  905|  4.85M|            }
  906|  32.0M|            if (*it == '#') {
  ------------------
  |  Branch (906:17): [True: 261k, False: 31.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|   261k|               bool separated_by_prev_ws = false;
  911|   261k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
  912|   261k|                  if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (912:23): [True: 261k, False: 0]
  |  Branch (912:43): [True: 261k, False: 0]
  ------------------
  913|   261k|                     const char prev = *(it - 1);
  914|   261k|                     separated_by_prev_ws = (prev == ' ' || prev == '\t');
  ------------------
  |  Branch (914:46): [True: 117k, False: 143k]
  |  Branch (914:61): [True: 20.4k, False: 123k]
  ------------------
  915|   261k|                  }
  916|   261k|               }
  917|   261k|               if (!(at_line_start || saw_separation_ws || separated_by_prev_ws)) {
  ------------------
  |  Branch (917:22): [True: 122k, False: 138k]
  |  Branch (917:39): [True: 50.7k, False: 87.6k]
  |  Branch (917:60): [True: 55.2k, False: 32.4k]
  ------------------
  918|  32.4k|                  break;
  919|  32.4k|               }
  920|   228k|               skip_comment(it, end);
  921|   228k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (921:20): [True: 225k, False: 3.23k]
  |  Branch (921:34): [True: 124k, False: 101k]
  |  Branch (921:49): [True: 100k, False: 630]
  ------------------
  922|   225k|                  skip_newline(it, end);
  923|   225k|                  if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (923:23): [True: 2.61k, False: 222k]
  ------------------
  924|   225k|                  at_line_start = true;
  925|   225k|                  saw_separation_ws = true;
  926|   225k|                  continue;
  927|   225k|               }
  928|  3.86k|               continue;
  929|   228k|            }
  930|       |
  931|       |            // In block context, multiline flow nodes require indentation on content
  932|       |            // continuation lines (except structural tokens).
  933|  31.8M|            if (at_line_start && ctx.current_indent() >= 0 && !line_has_indent) {
  ------------------
  |  Branch (933:17): [True: 3.29M, False: 28.5M]
  |  Branch (933:34): [True: 140k, False: 3.15M]
  |  Branch (933:63): [True: 55.7k, False: 84.4k]
  ------------------
  934|  55.7k|               const char c = *it;
  935|  55.7k|               const bool structural = (c == ']' || c == '}' || c == ',');
  ------------------
  |  Branch (935:41): [True: 1.09k, False: 54.6k]
  |  Branch (935:53): [True: 16.4k, False: 38.2k]
  |  Branch (935:65): [True: 37.6k, False: 538]
  ------------------
  936|  55.7k|               if (!structural) {
  ------------------
  |  Branch (936:20): [True: 538, False: 55.1k]
  ------------------
  937|    538|                  ctx.error = error_code::syntax_error;
  938|    538|                  return;
  939|    538|               }
  940|  55.7k|            }
  941|  31.8M|            break;
  942|  31.8M|         }
  943|  32.4M|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.99M|      {
  275|  1.99M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.99M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.99M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.99M|      }
_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.72M|      {
 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.72M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  2.72M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  2.72M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  2.72M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  2.72M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 2.72M]
  ------------------
 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.72M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 2.24M, False: 482k]
  ------------------
 5769|  2.24M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  2.24M|         }
 5771|   482k|         else {
 5772|   482k|            yaml::skip_inline_ws(it, end);
 5773|   482k|         }
 5774|       |
 5775|  2.72M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 425, False: 2.72M]
  ------------------
 5776|    425|            ctx.error = error_code::unexpected_end;
 5777|    425|            return;
 5778|    425|         }
 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.72M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  2.72M|            using V = std::remove_cvref_t<T>;
 5886|  2.72M|            using counts = yaml_variant_type_count<V>;
 5887|  2.72M|            const char c = *it;
 5888|  2.72M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  2.72M|               switch (ch) {
 5890|  2.72M|               case ' ':
 5891|  2.72M|               case '\t':
 5892|  2.72M|               case '\n':
 5893|  2.72M|               case '\r':
 5894|  2.72M|               case ',':
 5895|  2.72M|               case ']':
 5896|  2.72M|               case '}':
 5897|  2.72M|                  return true;
 5898|  2.72M|               default:
 5899|  2.72M|                  return false;
 5900|  2.72M|               }
 5901|  2.72M|            };
 5902|       |
 5903|  2.72M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  2.72M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  2.72M|                  return false;
 5906|  2.72M|               }
 5907|  2.72M|               if (ctx.current_indent() < 0) {
 5908|  2.72M|                  return false;
 5909|  2.72M|               }
 5910|  2.72M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  2.72M|                  return false;
 5912|  2.72M|               }
 5913|       |
 5914|  2.72M|               auto look = word_end;
 5915|  2.72M|               yaml::skip_newline(look, end);
 5916|  2.72M|               while (look != end) {
 5917|  2.72M|                  int32_t line_indent = 0;
 5918|  2.72M|                  while (look != end && *look == ' ') {
 5919|  2.72M|                     ++line_indent;
 5920|  2.72M|                     ++look;
 5921|  2.72M|                  }
 5922|  2.72M|                  if (look != end && *look == '\t') {
 5923|  2.72M|                     return false;
 5924|  2.72M|                  }
 5925|  2.72M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  2.72M|                     if (look != end) {
 5927|  2.72M|                        yaml::skip_newline(look, end);
 5928|  2.72M|                        continue;
 5929|  2.72M|                     }
 5930|  2.72M|                     return false;
 5931|  2.72M|                  }
 5932|  2.72M|                  if (*look == '#') {
 5933|  2.72M|                     yaml::skip_comment(look, end);
 5934|  2.72M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  2.72M|                        yaml::skip_newline(look, end);
 5936|  2.72M|                        continue;
 5937|  2.72M|                     }
 5938|  2.72M|                     return false;
 5939|  2.72M|                  }
 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.72M|                  {
 5945|  2.72M|                     auto scan = look;
 5946|  2.72M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  2.72M|                        if (*scan == ':') {
 5948|  2.72M|                           auto after_colon = scan + 1;
 5949|  2.72M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  2.72M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  2.72M|                              return false;
 5952|  2.72M|                           }
 5953|  2.72M|                        }
 5954|  2.72M|                        ++scan;
 5955|  2.72M|                     }
 5956|  2.72M|                  }
 5957|       |
 5958|  2.72M|                  return line_indent > ctx.current_indent();
 5959|  2.72M|               }
 5960|  2.72M|               return false;
 5961|  2.72M|            };
 5962|  2.72M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  2.72M|               if (ptr == end) {
 5964|  2.72M|                  return true;
 5965|  2.72M|               }
 5966|  2.72M|               if (*ptr == ':') {
 5967|  2.72M|                  auto next = ptr + 1;
 5968|  2.72M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  2.72M|               }
 5970|  2.72M|               return is_plain_scalar_boundary(*ptr);
 5971|  2.72M|            };
 5972|       |
 5973|  2.72M|            switch (c) {
 5974|   545k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 545k, False: 2.17M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   545k|               ++it;
 5977|   545k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   545k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 185, False: 544k]
  ------------------
 5979|    185|                  ctx.error = error_code::syntax_error;
 5980|    185|                  return;
 5981|    185|               }
 5982|   544k|               yaml::skip_inline_ws(it, end);
 5983|   544k|               bool anchor_on_same_line = true;
 5984|   544k|               bool value_is_indentless_sequence = false;
 5985|   544k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 5.45k, False: 539k]
  |  Branch (5985:33): [True: 21.4k, False: 518k]
  |  Branch (5985:48): [True: 40.3k, False: 477k]
  |  Branch (5985:63): [True: 5.14k, False: 472k]
  ------------------
 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|  72.4k|                  bool value_on_next_line = false;
 5989|  72.4k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 66.9k, False: 5.45k]
  ------------------
 5990|  66.9k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|  66.9k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 5.14k, False: 61.8k]
  ------------------
 5993|  39.8k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 39.5k, False: 269]
  |  Branch (5993:47): [True: 37.3k, False: 2.24k]
  |  Branch (5993:64): [True: 34.7k, False: 2.63k]
  ------------------
 5994|  5.14k|                     }
 5995|       |                     // Skip newline
 5996|  66.9k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 66.6k, False: 269]
  |  Branch (5996:42): [True: 23.6k, False: 43.0k]
  |  Branch (5996:59): [True: 43.0k, False: 0]
  ------------------
 5997|  66.6k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   121k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 119k, False: 1.84k]
  |  Branch (5999:48): [True: 25.6k, False: 94.1k]
  |  Branch (5999:65): [True: 29.3k, False: 64.8k]
  ------------------
 6000|  54.9k|                           yaml::skip_newline(peek, end);
 6001|  54.9k|                        }
 6002|       |                        // Measure indent of next content line
 6003|  66.6k|                        int32_t next_indent = 0;
 6004|   179k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 177k, False: 2.66k]
  |  Branch (6004:47): [True: 112k, False: 64.0k]
  ------------------
 6005|   112k|                           ++next_indent;
 6006|   112k|                           ++peek;
 6007|   112k|                        }
 6008|  66.6k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 64.0k, False: 2.66k]
  |  Branch (6008:44): [True: 62.2k, False: 1.77k]
  |  Branch (6008:61): [True: 61.7k, False: 495]
  ------------------
 6009|  61.7k|                           const bool indentless_sequence =
 6010|  61.7k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 60.7k, False: 1.00k]
  |  Branch (6010:69): [True: 15.0k, False: 45.7k]
  ------------------
 6011|  15.0k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 439, False: 14.6k]
  ------------------
 6012|  14.6k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 13.9k, False: 641]
  ------------------
 6013|  14.4k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 1.18k, False: 13.2k]
  ------------------
 6014|  13.2k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 8.30k, False: 4.91k]
  |  Branch (6014:61): [True: 7.62k, False: 684]
  ------------------
 6015|  61.7k|                           value_is_indentless_sequence = indentless_sequence;
 6016|  61.7k|                           const bool same_indent_property_node =
 6017|  61.7k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 7.28k, False: 54.4k]
  ------------------
 6018|  7.28k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 401, False: 6.88k]
  |  Branch (6018:48): [True: 1.23k, False: 5.64k]
  |  Branch (6018:64): [True: 337, False: 5.30k]
  |  Branch (6018:80): [True: 354, False: 4.95k]
  |  Branch (6018:96): [True: 299, False: 4.65k]
  ------------------
 6019|  4.65k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 354, False: 4.29k]
  |  Branch (6019:48): [True: 577, False: 3.72k]
  |  Branch (6019:65): [True: 221, False: 3.50k]
  |  Branch (6019:81): [True: 320, False: 3.18k]
  ------------------
 6020|  61.7k|                           value_on_next_line =
 6021|  61.7k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 38.7k, False: 22.9k]
  |  Branch (6021:71): [True: 8.80k, False: 14.1k]
  |  Branch (6021:94): [True: 4.10k, False: 10.0k]
  ------------------
 6022|  61.7k|                        }
 6023|  66.6k|                     }
 6024|  66.9k|                  }
 6025|  72.4k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 20.7k, False: 51.6k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  20.7k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  20.7k|                     return;
 6029|  20.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.82k, False: 48.8k]
  ------------------
 6032|  19.5k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 19.5k, False: 0]
  |  Branch (6032:42): [True: 17.6k, False: 1.87k]
  |  Branch (6032:57): [True: 16.7k, False: 948]
  ------------------
 6033|  2.82k|                  }
 6034|  51.6k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 51.6k, False: 0]
  ------------------
 6035|  87.2k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 87.2k, False: 0]
  |  Branch (6035:40): [True: 10.6k, False: 76.6k]
  |  Branch (6035:55): [True: 24.9k, False: 51.6k]
  ------------------
 6036|  35.5k|                     yaml::skip_newline(it, end);
 6037|  35.5k|                  }
 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|   524k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 524k, False: 15]
  |  Branch (6053:33): [True: 489, False: 523k]
  |  Branch (6053:47): [True: 61, False: 428]
  ------------------
 6054|     61|                  ctx.error = error_code::syntax_error;
 6055|     61|                  return;
 6056|     61|               }
 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|   524k|               const char* anchor_start = &*it;
 6078|   524k|               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|   524k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   524k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   524k|               redispatch<Opts>(value, ctx, it, end);
 6174|   524k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   524k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 513k, False: 10.6k]
  ------------------
 6176|   513k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|   513k|               }
 6178|   524k|               return;
 6179|   524k|            }
 6180|   179k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 179k, False: 2.54M]
  ------------------
 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|   179k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   179k|               return;
 6199|   524k|            }
 6200|   190k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 190k, False: 2.53M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   190k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   190k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 42, False: 189k]
  ------------------
 6204|     42|                  ctx.error = error_code::syntax_error;
 6205|     42|                  return;
 6206|     42|               }
 6207|   189k|               yaml::skip_inline_ws(it, end);
 6208|   189k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 189k, False: 919]
  |  Branch (6208:33): [True: 8.93k, False: 180k]
  ------------------
 6209|  8.93k|                  yaml::skip_comment(it, end);
 6210|  8.93k|               }
 6211|   189k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 188k, False: 1.51k]
  |  Branch (6211:34): [True: 14.0k, False: 174k]
  |  Branch (6211:49): [True: 22.1k, False: 152k]
  ------------------
 6212|  36.2k|                  auto content = it;
 6213|  36.2k|                  yaml::skip_newline(content, end);
 6214|  36.2k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|  36.2k|                  bool consume_following_content = false;
 6217|  36.2k|                  auto content_token = content;
 6218|  36.2k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 32.5k, False: 3.72k]
  ------------------
 6219|  32.5k|                     auto indent_probe = content;
 6220|  32.5k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  32.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 2, False: 32.5k]
  ------------------
 6222|      2|                        return;
 6223|  32.5k|                     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|  32.5k|                     bool tagged_indentless_sequence = false;
 6228|  32.5k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 4.60k, False: 27.9k]
  |  Branch (6228:56): [True: 4.60k, False: 0]
  |  Branch (6228:79): [True: 4.03k, False: 570]
  ------------------
 6229|  4.03k|                        const auto after_dash = indent_probe + 1;
 6230|  4.03k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 284, False: 3.75k]
  ------------------
 6231|  3.78k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 3.50k, False: 249]
  ------------------
 6232|  3.78k|                           tagged_indentless_sequence =
 6233|  3.78k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 315, False: 3.47k]
  ------------------
 6234|  3.47k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 1.73k, False: 1.73k]
  |  Branch (6234:60): [True: 361, False: 1.37k]
  ------------------
 6235|  3.78k|                        }
 6236|  4.03k|                     }
 6237|       |
 6238|  32.5k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 16.0k, False: 16.4k]
  ------------------
 6239|  16.4k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 7.06k, False: 9.38k]
  |  Branch (6239:93): [True: 676, False: 8.70k]
  ------------------
 6240|  32.5k|                  }
 6241|       |
 6242|  36.2k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 23.8k, False: 12.4k]
  ------------------
 6243|  23.8k|                     it = content_token;
 6244|  23.8k|                  }
 6245|  12.4k|                  else {
 6246|  12.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 345, False: 12.0k]
  ------------------
 6247|    345|                        if constexpr (counts::n_str > 0) {
 6248|    345|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|    345|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|    345|                           value = StrType{};
 6251|    345|                           return;
 6252|    345|                        }
 6253|    345|                     }
 6254|  12.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 317, False: 12.1k]
  ------------------
 6255|    317|                        if constexpr (counts::n_null > 0) {
 6256|    317|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    317|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    317|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 317]
  ------------------
 6259|    317|                           return;
 6260|    317|                        }
 6261|    317|                     }
 6262|  12.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 9.52k, False: 2.90k]
  ------------------
 6263|  9.52k|                        if constexpr (counts::n_null > 0) {
 6264|  9.52k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  9.52k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  9.52k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 9.52k]
  ------------------
 6267|  9.52k|                           return;
 6268|  9.52k|                        }
 6269|  9.52k|                     }
 6270|  12.4k|                  }
 6271|  36.2k|               }
 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|   189k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 1.51k, False: 188k]
  ------------------
 6293|  1.51k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 394, False: 1.12k]
  ------------------
 6294|    394|                     if constexpr (counts::n_str > 0) {
 6295|    394|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|    394|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|    394|                        value = StrType{};
 6298|    394|                        return;
 6299|    394|                     }
 6300|    394|                  }
 6301|  1.51k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 1.11k, False: 405]
  ------------------
 6302|  1.11k|                     if constexpr (counts::n_null > 0) {
 6303|  1.11k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  1.11k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  1.11k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 1.11k]
  ------------------
 6306|  1.11k|                        return;
 6307|  1.11k|                     }
 6308|  1.11k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  1.51k|                  return;
 6311|  1.51k|               }
 6312|   188k|               switch (tag) {
 6313|    361|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 361, False: 188k]
  ------------------
 6314|    361|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|    361|                  return;
 6316|  2.14k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 2.14k, False: 186k]
  ------------------
 6317|  5.02k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 2.87k, False: 185k]
  ------------------
 6318|  5.02k|                  if constexpr (counts::n_num > 0) {
 6319|  5.02k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  5.02k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  19.4k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 14.4k, False: 174k]
  ------------------
 6327|  19.4k|                  if constexpr (counts::n_bool > 0) {
 6328|  19.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  19.4k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  19.8k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 413, False: 188k]
  ------------------
 6336|  19.8k|                  if constexpr (counts::n_null > 0) {
 6337|  19.8k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  19.8k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  19.8k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 19.8k]
  ------------------
 6340|  19.8k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  19.8k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  40.1k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 20.2k, False: 168k]
  ------------------
 6348|  40.1k|                  if constexpr (counts::n_object > 0) {
 6349|  40.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  40.1k|                                                                                                     end);
 6351|  40.1k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  53.4k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 13.3k, False: 175k]
  ------------------
 6358|  53.4k|                  if constexpr (counts::n_array > 0) {
 6359|  53.4k|                     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|  53.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  53.4k|                                                                                                    end);
 6367|  53.4k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  53.4k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   177k|               default: {
  ------------------
  |  Branch (6374:16): [True: 124k, False: 64.0k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   177k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 124k, False: 53.4k]
  |  Branch (6377:36): [True: 57.4k, False: 67.0k]
  ------------------
 6378|  57.4k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  57.4k|                     return;
 6380|  57.4k|                  }
 6381|       |
 6382|   120k|                  if constexpr (counts::n_array > 0) {
 6383|   120k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 67.0k, False: 53.4k]
  |  Branch (6383:39): [True: 859, False: 66.1k]
  ------------------
 6384|    859|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|    859|                                                                                                       end);
 6386|    859|                        return;
 6387|    859|                     }
 6388|   120k|                  }
 6389|   120k|                  if constexpr (counts::n_object > 0) {
 6390|   120k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 66.1k, False: 54.3k]
  |  Branch (6390:39): [True: 836, False: 65.3k]
  ------------------
 6391|    836|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|    836|                                                                                                        end);
 6393|    836|                        return;
 6394|    836|                     }
 6395|   120k|                  }
 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|   120k|                  if constexpr (counts::n_str > 0) {
 6426|   120k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   120k|                     return;
 6428|   120k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   120k|                  return;
 6433|   177k|               }
 6434|   188k|               }
 6435|      0|               return;
 6436|   188k|            }
 6437|   415k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 415k, False: 2.30M]
  ------------------
 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|   415k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|   415k|               return;
 6449|  43.8k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 43.8k, False: 2.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|  43.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  43.8k|               return;
 6461|   111k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 111k, False: 2.61M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   111k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 110k, False: 697]
  |  Branch (6463:39): [True: 6, False: 110k]
  ------------------
 6464|      6|                  ctx.error = error_code::syntax_error;
 6465|      6|                  return;
 6466|      6|               }
 6467|   111k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 110k, False: 697]
  |  Branch (6467:40): [True: 33.7k, False: 76.5k]
  |  Branch (6467:56): [True: 55.6k, False: 20.8k]
  |  Branch (6467:73): [True: 9.68k, False: 11.2k]
  ------------------
 6468|  99.1k|                  if constexpr (counts::n_object > 0) {
 6469|  99.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|  99.1k|                                                                                                     end);
 6471|  99.1k|                     return;
 6472|  99.1k|                  }
 6473|  99.1k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   111k|               return;
 6476|     12|            case '%':
  ------------------
  |  Branch (6476:13): [True: 12, False: 2.72M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     12|               ctx.error = error_code::syntax_error;
 6479|     12|               return;
 6480|  6.97k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 6.97k, False: 2.71M]
  ------------------
 6481|  9.44k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 2.47k, False: 2.72M]
  ------------------
 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|  9.44k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  9.44k|               return;
 6486|  11.8k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 11.8k, False: 2.71M]
  ------------------
 6487|  25.5k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 13.7k, False: 2.71M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  25.5k|               if constexpr (counts::n_bool > 0) {
 6490|  25.5k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 24.8k, False: 746]
  |  Branch (6490:44): [True: 16.2k, False: 8.57k]
  |  Branch (6490:60): [True: 15.4k, False: 846]
  |  Branch (6490:76): [True: 12.5k, False: 2.82k]
  ------------------
 6491|  13.4k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 1.95k, False: 10.2k]
  |  Branch (6491:60): [True: 1.19k, False: 761]
  |  Branch (6491:76): [True: 867, False: 331]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  13.4k|                     const auto after_true = it + 4;
 6494|  13.4k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  13.4k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 12.6k, False: 841]
  ------------------
 6497|  12.6k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 0, False: 12.6k]
  ------------------
 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|  12.6k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 12.2k, False: 348]
  |  Branch (6503:47): [True: 9.34k, False: 2.93k]
  ------------------
 6504|  9.34k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 252, False: 9.09k]
  |  Branch (6504:47): [True: 6.57k, False: 2.51k]
  |  Branch (6504:63): [True: 1.57k, False: 939]
  |  Branch (6504:80): [True: 233, False: 706]
  |  Branch (6504:97): [True: 706, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  9.34k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  9.34k|                           return;
 6508|  9.34k|                        }
 6509|  3.27k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  3.27k|                                                                                                      end);
 6511|  3.27k|                        return;
 6512|  12.6k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  13.4k|                  }
 6515|  25.5k|               }
 6516|  12.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  25.5k|               return;
 6518|  23.3k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 23.3k, False: 2.70M]
  ------------------
 6519|  32.0k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 8.70k, False: 2.71M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  32.0k|               if constexpr (counts::n_bool > 0) {
 6522|  32.0k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 31.5k, False: 537]
  |  Branch (6522:44): [True: 12.9k, False: 18.6k]
  |  Branch (6522:60): [True: 8.75k, False: 4.16k]
  |  Branch (6522:76): [True: 7.89k, False: 863]
  |  Branch (6522:92): [True: 7.44k, False: 445]
  ------------------
 6523|  24.0k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 1.99k, False: 22.0k]
  |  Branch (6523:60): [True: 1.54k, False: 446]
  |  Branch (6523:76): [True: 1.18k, False: 360]
  |  Branch (6523:92): [True: 329, False: 860]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  7.77k|                     const auto after_false = it + 5;
 6526|  7.77k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  7.77k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 6.50k, False: 1.27k]
  ------------------
 6529|  6.50k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 0, False: 6.50k]
  ------------------
 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.50k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 6.06k, False: 440]
  |  Branch (6535:47): [True: 4.74k, False: 1.31k]
  ------------------
 6536|  4.74k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 235, False: 4.51k]
  |  Branch (6536:47): [True: 553, False: 3.96k]
  |  Branch (6536:63): [True: 1.73k, False: 2.22k]
  |  Branch (6536:80): [True: 798, False: 1.42k]
  |  Branch (6536:97): [True: 1.42k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  4.74k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  4.74k|                           return;
 6540|  4.74k|                        }
 6541|  1.75k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  1.75k|                                                                                                      end);
 6543|  1.75k|                        return;
 6544|  6.50k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  7.77k|                  }
 6547|  32.0k|               }
 6548|  25.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  32.0k|               return;
 6550|  13.5k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 13.5k, False: 2.71M]
  ------------------
 6551|  22.3k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 8.78k, False: 2.71M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  22.3k|               if constexpr (counts::n_null > 0) {
 6554|  22.3k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 21.8k, False: 497]
  |  Branch (6554:44): [True: 12.3k, False: 9.48k]
  |  Branch (6554:60): [True: 10.4k, False: 1.96k]
  |  Branch (6554:76): [True: 9.62k, False: 784]
  ------------------
 6555|  12.2k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 2.46k, False: 9.78k]
  |  Branch (6555:60): [True: 1.82k, False: 637]
  |  Branch (6555:76): [True: 1.51k, False: 309]
  ------------------
 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: 9.01k, False: 2.12k]
  ------------------
 6561|  9.01k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 0, False: 9.01k]
  ------------------
 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|  9.01k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 8.65k, False: 367]
  |  Branch (6567:47): [True: 4.70k, False: 3.94k]
  ------------------
 6568|  4.70k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 364, False: 4.33k]
  |  Branch (6568:47): [True: 262, False: 4.07k]
  |  Branch (6568:63): [True: 3.34k, False: 731]
  |  Branch (6568:80): [True: 273, False: 458]
  |  Branch (6568:97): [True: 458, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  4.70k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  4.70k|                           return;
 6572|  4.70k|                        }
 6573|  4.31k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  4.31k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  4.31k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 4.31k]
  ------------------
 6576|  4.31k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  4.31k|                        return;
 6578|  9.01k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  11.1k|                  }
 6581|  22.3k|               }
 6582|  13.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  22.3k|               return;
 6584|  2.35k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 2.35k, False: 2.72M]
  ------------------
 6585|       |               // Null indicator
 6586|  2.35k|               if constexpr (counts::n_null > 0) {
 6587|  2.35k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  2.35k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  2.35k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 2.35k]
  ------------------
 6590|  2.35k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  2.35k|                  return;
 6592|  2.35k|               }
 6593|      0|               break; // Fall through to try other types
 6594|  83.8k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 83.8k, False: 2.64M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|  83.8k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 3.78k, False: 80.1k]
  |  Branch (6596:41): [True: 52.8k, False: 27.2k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|  56.6k|                  if constexpr (counts::n_array > 0) {
 6599|  56.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|  56.6k|                                                                                                    end);
 6601|  56.6k|                     return;
 6602|  56.6k|                  }
 6603|  56.6k|               }
 6604|  83.8k|               if constexpr (counts::n_num > 0) {
 6605|  83.8k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 27.2k, False: 56.6k]
  |  Branch (6605:43): [True: 1.92k, False: 25.3k]
  |  Branch (6605:94): [True: 1.05k, False: 24.2k]
  ------------------
 6606|  2.97k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  2.97k|                     return;
 6608|  2.97k|                  }
 6609|  83.8k|               }
 6610|  80.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|  83.8k|               return;
 6612|  8.83k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 8.83k, False: 2.71M]
  ------------------
 6613|  25.4k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 16.5k, False: 2.70M]
  ------------------
 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|  25.4k|               if constexpr (counts::n_num > 0) {
 6617|  25.4k|                  auto start_it = it;
 6618|  25.4k|                  auto temp_ctx = ctx.make_speculative();
 6619|  25.4k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  25.4k|                                                                                               end);
 6621|  25.4k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  25.4k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  25.4k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 2.48k, False: 22.9k]
  ------------------
 6624|  2.48k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  2.48k|                     return; // Successfully parsed as number
 6626|  2.48k|                  }
 6627|  22.9k|                  it = start_it; // Restore and fall through to string
 6628|  22.9k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  25.4k|               return;
 6631|  1.03M|            default:
  ------------------
  |  Branch (6631:13): [True: 1.03M, False: 1.68M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|  1.03M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 930k, False: 108k]
  |  Branch (6633:32): [True: 794k, False: 135k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|   794k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 6.18k, False: 788k]
  ------------------
 6636|  6.18k|                     return;
 6637|  6.18k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|   788k|                  if constexpr (counts::n_num > 0) {
 6640|   788k|                     auto start_it = it;
 6641|   788k|                     auto temp_ctx = ctx.make_speculative();
 6642|   788k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|   788k|                                                                                                  end);
 6644|   788k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|   788k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|   788k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 748k, False: 40.1k]
  ------------------
 6647|   748k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|   748k|                        return; // Successfully parsed as number
 6649|   748k|                     }
 6650|  40.1k|                     it = start_it; // Restore and fall through to string
 6651|  40.1k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|   788k|                  return;
 6655|   794k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   243k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   243k|               return;
 6659|  2.72M|            }
 6660|  2.72M|         }
 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.72M|         error_code expansion_error{};
 6670|  2.72M|         std::string_view expansion_message{};
 6671|       |
 6672|  2.72M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  2.72M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  2.72M|            auto start = it;
 6675|       |
 6676|  2.72M|            V v{};
 6677|  2.72M|            auto temp_ctx = ctx.make_speculative();
 6678|  2.72M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  2.72M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  2.72M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  2.72M|            if (!bool(temp_ctx.error)) {
 6683|  2.72M|               value = std::move(v);
 6684|  2.72M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  2.72M|               return true;
 6686|  2.72M|            }
 6687|       |
 6688|  2.72M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  2.72M|               expansion_error = temp_ctx.error;
 6690|  2.72M|               expansion_message = temp_ctx.custom_error_message;
 6691|  2.72M|            }
 6692|  2.72M|            it = start;
 6693|  2.72M|            return false;
 6694|  2.72M|         };
 6695|       |
 6696|  2.72M|         bool parsed = false;
 6697|  2.72M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  2.72M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  2.72M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  2.72M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 2.72M]
  ------------------
 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.72M|      }
_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|   524k|      {
 6718|   524k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|   524k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 11, False: 524k]
  ------------------
 6720|     11|            return;
 6721|   524k|         op<Opts>(value, ctx, it, end);
 6722|   524k|      }
_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|   236k|      {
  301|   236k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 236k]
  |  Branch (301:27): [True: 0, False: 236k]
  ------------------
  302|       |
  303|   236k|         ++it; // skip '*'
  304|   236k|         auto name = parse_anchor_name(it, end);
  305|   236k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 164, False: 236k]
  ------------------
  306|    164|            ctx.error = error_code::syntax_error;
  307|    164|            return true;
  308|    164|         }
  309|       |
  310|   236k|         auto anchor_it = ctx.anchors.find(name);
  311|   236k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 473, False: 236k]
  ------------------
  312|    473|            ctx.error = error_code::syntax_error; // undefined alias
  313|    473|            return true;
  314|    473|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   236k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   236k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 31.4k, False: 204k]
  ------------------
  322|  31.4k|            return true;
  323|  31.4k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   204k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 16, False: 204k]
  ------------------
  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|   204k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   204k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 204k]
  ------------------
  339|      2|            return true;
  340|       |
  341|   204k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 16, False: 204k]
  ------------------
  342|     16|            ctx.error = error_code::exceeded_max_expansion;
  343|     16|            ctx.custom_error_message = "alias expansion";
  344|     16|            return true;
  345|     16|         }
  346|       |
  347|   204k|         auto replay_it = span.begin;
  348|   204k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   204k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   204k|         ctx.indent_stack.clear();
  353|   204k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 13.4k, False: 191k]
  ------------------
  354|  13.4k|            ctx.push_indent(span.base_indent - 1);
  355|  13.4k|         }
  356|       |
  357|   204k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   204k|         using V = std::remove_cvref_t<T>;
  360|   204k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   204k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   204k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   204k|         return true;
  367|   204k|      }
_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|   342k|      {
 5311|   342k|         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|   342k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   342k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   342k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   342k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 342k, False: 0]
  ------------------
 5321|   342k|            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|   342k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   349k|      {
 1961|   349k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 5.51k, False: 343k]
  ------------------
 1962|  5.51k|            return;
 1963|       |
 1964|   343k|         yaml::node_preamble_state preamble{};
 1965|   343k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 8.50k, False: 335k]
  ------------------
 1966|   343k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  8.50k|            return;
 1968|       |
 1969|   335k|         std::string str;
 1970|   335k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   335k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 335k, False: 0]
  ------------------
 1973|  3.89k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 3.89k, False: 331k]
  ------------------
 1974|  3.89k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  3.89k|            break;
 1976|  1.40k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 1.40k, False: 333k]
  ------------------
 1977|  1.40k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  1.40k|            break;
 1979|    545|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 545, False: 334k]
  ------------------
 1980|  4.55k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 4.01k, False: 331k]
  ------------------
 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.55k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  4.55k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 1.16k, False: 3.39k]
  ------------------
 1986|  4.55k|            break;
 1987|   325k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 325k, False: 9.85k]
  ------------------
 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|   325k|            else {
 2000|   325k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|   325k|            }
 2002|   325k|            break;
 2003|   335k|         }
 2004|       |
 2005|   335k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 333k, False: 1.25k]
  ------------------
 2006|   333k|            value = std::move(str);
 2007|   333k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   333k|         }
 2009|   335k|      }
_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|   343k|      {
  466|   343k|         skip_inline_ws(it, end);
  467|       |
  468|   343k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 13, False: 343k]
  ------------------
  469|     13|            if constexpr (!AllowEmptyInput) {
  470|     13|               ctx.error = error_code::unexpected_end;
  471|     13|            }
  472|     13|            return true;
  473|     13|         }
  474|       |
  475|   343k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   343k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 16, False: 343k]
  ------------------
  477|     16|            ctx.error = error_code::syntax_error;
  478|     16|            return true;
  479|     16|         }
  480|   343k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 343k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   343k|         skip_inline_ws(it, end);
  486|       |
  487|   343k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 7, False: 343k]
  ------------------
  488|      7|            if constexpr (!AllowEmptyInput) {
  489|      7|               ctx.error = error_code::unexpected_end;
  490|      7|            }
  491|      7|            return true;
  492|      7|         }
  493|       |
  494|   343k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 8.46k, False: 335k]
  ------------------
  495|  8.46k|            return true;
  496|  8.46k|         }
  497|       |
  498|   335k|         return false;
  499|   343k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   343k|                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|   343k|      {
  409|   343k|         state.has_anchor = false;
  410|   343k|         state.anchor_name.clear();
  411|   343k|         state.anchor_start = nullptr;
  412|   343k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   343k|         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|   343k|            else {
  421|   343k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 8.42k, False: 335k]
  ------------------
  422|   343k|            }
  423|   343k|         }
  424|       |
  425|   343k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 335k, False: 8.42k]
  |  Branch (425:27): [True: 12.6k, False: 322k]
  ------------------
  426|  12.6k|            ++it;
  427|  12.6k|            auto name = parse_anchor_name(it, end);
  428|  12.6k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 12.5k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  12.5k|            skip_inline_ws(it, end);
  433|  12.5k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 25, False: 12.5k]
  ------------------
  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|  12.5k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  12.5k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 4, False: 12.5k]
  ------------------
  441|      4|                  ctx.error = error_code::syntax_error;
  442|      4|                  return true;
  443|      4|               }
  444|  12.5k|            }
  445|  12.5k|            state.has_anchor = true;
  446|  12.5k|            state.anchor_name = std::string(name);
  447|  12.5k|            state.anchor_start = &*it;
  448|  12.5k|         }
  449|       |
  450|   343k|         return false;
  451|   343k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   343k|      {
  301|   343k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 343k]
  |  Branch (301:27): [True: 335k, False: 8.42k]
  ------------------
  302|       |
  303|  8.42k|         ++it; // skip '*'
  304|  8.42k|         auto name = parse_anchor_name(it, end);
  305|  8.42k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 8.41k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  8.41k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.41k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 38, False: 8.38k]
  ------------------
  312|     38|            ctx.error = error_code::syntax_error; // undefined alias
  313|     38|            return true;
  314|     38|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  8.38k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.38k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.26k, False: 7.11k]
  ------------------
  322|  1.26k|            return true;
  323|  1.26k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  7.11k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 12, False: 7.10k]
  ------------------
  329|     12|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     12|            return true;
  331|     12|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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|  7.10k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  7.10k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 7.10k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  7.10k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 7.09k]
  ------------------
  342|      7|            ctx.error = error_code::exceeded_max_expansion;
  343|      7|            ctx.custom_error_message = "alias expansion";
  344|      7|            return true;
  345|      7|         }
  346|       |
  347|  7.09k|         auto replay_it = span.begin;
  348|  7.09k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  7.09k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  7.09k|         ctx.indent_stack.clear();
  353|  7.09k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 741, False: 6.35k]
  ------------------
  354|    741|            ctx.push_indent(span.base_indent - 1);
  355|    741|         }
  356|       |
  357|  7.09k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  7.09k|         using V = std::remove_cvref_t<T>;
  360|  7.09k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  7.09k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  7.09k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  7.09k|         return true;
  367|  7.10k|      }
_ZN3glz4yaml26parse_double_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  505|  1.68M|      {
  506|  1.68M|         static constexpr size_t string_padding_bytes = 8;
  507|       |
  508|  1.68M|         if (it == end || *it != '"') [[unlikely]] {
  ------------------
  |  Branch (508:14): [True: 0, False: 1.68M]
  |  Branch (508:27): [True: 0, False: 1.68M]
  ------------------
  509|      0|            ctx.error = error_code::expected_quote;
  510|      0|            return;
  511|      0|         }
  512|       |
  513|  1.68M|         ++it; // skip opening quote
  514|  1.68M|         auto start = it;
  515|       |
  516|       |         // Pass 1: Find closing quote byte-by-byte (need to handle newlines and escapes)
  517|  6.69M|         while (it != end && *it != '"') {
  ------------------
  |  Branch (517:17): [True: 6.69M, False: 424]
  |  Branch (517:30): [True: 5.00M, False: 1.68M]
  ------------------
  518|  5.00M|            if (*it == '\\') {
  ------------------
  |  Branch (518:17): [True: 56.3k, False: 4.95M]
  ------------------
  519|  56.3k|               ++it;
  520|  56.3k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (520:20): [True: 40, False: 56.3k]
  ------------------
  521|     40|                  ctx.error = error_code::unexpected_end;
  522|     40|                  return;
  523|     40|               }
  524|  56.3k|            }
  525|  4.95M|            else if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (525:22): [True: 486, False: 4.95M]
  ------------------
  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|    486|               ctx.error = error_code::invalid_control_character;
  529|    486|               return;
  530|    486|            }
  531|  5.00M|            ++it;
  532|  5.00M|         }
  533|       |
  534|  1.68M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (534:14): [True: 424, False: 1.68M]
  ------------------
  535|    424|            ctx.error = error_code::unexpected_end;
  536|    424|            return;
  537|    424|         }
  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.68M|         const auto input_len = static_cast<size_t>(it - start);
  542|  1.68M|         value.resize(input_len + (input_len / 2) + string_padding_bytes);
  543|  1.68M|         auto* dst = value.data();
  544|  1.68M|         auto* const dst_start = dst;
  545|       |
  546|       |         // Pass 2: Copy and process escapes and line folding
  547|  1.68M|         auto src = start;
  548|  1.68M|         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.68M|         auto* last_non_trimmable = dst;
  552|       |
  553|  6.51M|         while (src < src_end) {
  ------------------
  |  Branch (553:17): [True: 4.82M, False: 1.68M]
  ------------------
  554|       |            // Check for newline - needs line folding
  555|  4.82M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (555:17): [True: 16.0k, False: 4.81M]
  |  Branch (555:33): [True: 44.1k, False: 4.76M]
  ------------------
  556|       |               // Trim trailing LITERAL whitespace from output before processing newline.
  557|       |               // Escape-produced whitespace (e.g. from \t) is preserved.
  558|  60.2k|               dst = (std::max)(last_non_trimmable, dst_start);
  559|       |
  560|       |               // Skip the newline
  561|  60.2k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (561:20): [True: 44.1k, False: 16.0k]
  |  Branch (561:36): [True: 41.7k, False: 2.37k]
  |  Branch (561:59): [True: 1.28k, False: 40.4k]
  ------------------
  562|  1.28k|                  src += 2; // CRLF
  563|  1.28k|               }
  564|  58.9k|               else {
  565|  58.9k|                  ++src;
  566|  58.9k|               }
  567|       |
  568|       |               // Skip leading indentation on the next line.
  569|  60.2k|               int indent_count = 0;
  570|  60.2k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (570:20): [True: 66, False: 60.1k]
  ------------------
  571|  60.1k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (571:20): [True: 39.1k, False: 20.9k]
  |  Branch (571:41): [True: 68, False: 39.1k]
  ------------------
  572|     68|                  ctx.error = error_code::syntax_error;
  573|     68|                  return;
  574|     68|               }
  575|       |
  576|       |               // Check if this is a blank line (another newline follows)
  577|  60.0k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (577:20): [True: 55.7k, False: 4.34k]
  |  Branch (577:38): [True: 5.05k, False: 50.6k]
  |  Branch (577:54): [True: 7.72k, False: 42.9k]
  ------------------
  578|       |                  // Blank line(s) - output newlines for each blank line
  579|  56.8k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (579:26): [True: 54.2k, False: 2.55k]
  |  Branch (579:44): [True: 27.1k, False: 27.0k]
  |  Branch (579:60): [True: 16.9k, False: 10.1k]
  ------------------
  580|  44.1k|                     *dst++ = '\n';
  581|       |                     // Skip the newline
  582|  44.1k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (582:26): [True: 16.9k, False: 27.1k]
  |  Branch (582:42): [True: 16.5k, False: 440]
  |  Branch (582:65): [True: 2.16k, False: 14.3k]
  ------------------
  583|  2.16k|                        src += 2; // CRLF
  584|  2.16k|                     }
  585|  41.9k|                     else {
  586|  41.9k|                        ++src;
  587|  41.9k|                     }
  588|  44.1k|                     int blank_indent_count = 0;
  589|  44.1k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (589:26): [True: 44, False: 44.1k]
  ------------------
  590|  44.1k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (590:26): [True: 39.4k, False: 4.63k]
  |  Branch (590:53): [True: 70, False: 39.3k]
  ------------------
  591|     70|                        ctx.error = error_code::syntax_error;
  592|     70|                        return;
  593|     70|                     }
  594|  44.1k|                  }
  595|       |                  // Don't add space - we're now at content after blank line(s)
  596|  12.7k|               }
  597|  47.2k|               else {
  598|       |                  // Single newline - fold to space
  599|  47.2k|                  *dst++ = ' ';
  600|  47.2k|               }
  601|  59.9k|               last_non_trimmable = dst;
  602|  59.9k|               continue;
  603|  60.0k|            }
  604|       |
  605|  4.76M|            if (*src == '\\') {
  ------------------
  |  Branch (605:17): [True: 55.7k, False: 4.71M]
  ------------------
  606|  55.7k|               ++src;
  607|  55.7k|               if (src >= src_end) [[unlikely]] {
  ------------------
  |  Branch (607:20): [True: 0, False: 55.7k]
  ------------------
  608|       |                  // Shouldn't happen - we validated in pass 1
  609|      0|                  ctx.error = error_code::syntax_error;
  610|      0|                  return;
  611|      0|               }
  612|       |
  613|  55.7k|               const auto esc = uint8_t(*src);
  614|       |
  615|       |               // Check for escaped newline (line continuation - no space)
  616|  55.7k|               if (esc == '\n' || esc == '\r') {
  ------------------
  |  Branch (616:20): [True: 8.42k, False: 47.2k]
  |  Branch (616:35): [True: 10.8k, False: 36.4k]
  ------------------
  617|       |                  // Skip the newline
  618|  19.2k|                  if (esc == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (618:23): [True: 10.8k, False: 8.42k]
  |  Branch (618:38): [True: 3.14k, False: 7.68k]
  |  Branch (618:61): [True: 230, False: 2.91k]
  ------------------
  619|    230|                     src += 2; // CRLF
  620|    230|                  }
  621|  19.0k|                  else {
  622|  19.0k|                     ++src;
  623|  19.0k|                  }
  624|       |
  625|  19.2k|                  int indent_count = 0;
  626|  19.2k|                  if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (626:23): [True: 24, False: 19.2k]
  ------------------
  627|  19.2k|                  if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (627:23): [True: 16.9k, False: 2.23k]
  |  Branch (627:44): [True: 78, False: 16.9k]
  ------------------
  628|     78|                     ctx.error = error_code::syntax_error;
  629|     78|                     return;
  630|     78|                  }
  631|       |                  // No output - this is line continuation without space
  632|  19.1k|                  last_non_trimmable = dst;
  633|  19.1k|                  continue;
  634|  19.2k|               }
  635|       |
  636|       |               // Check simple escape table first
  637|  36.4k|               if (yaml_escape_is_simple[esc]) {
  ------------------
  |  Branch (637:20): [True: 19.5k, False: 16.9k]
  ------------------
  638|  19.5k|                  *dst++ = yaml_unescape_table[esc];
  639|  19.5k|                  ++src;
  640|  19.5k|               }
  641|       |               // Handle escapes requiring special processing
  642|  16.9k|               else if (yaml_escape_needs_special[esc]) {
  ------------------
  |  Branch (642:25): [True: 6.18k, False: 10.7k]
  ------------------
  643|  6.18k|                  ++src; // skip escape char
  644|  6.18k|                  switch (esc) {
  645|    424|                  case 'x': {
  ------------------
  |  Branch (645:19): [True: 424, False: 5.75k]
  ------------------
  646|       |                     // \xXX - 2 hex digits
  647|    424|                     if (static_cast<size_t>(src_end - src) < 2) [[unlikely]] {
  ------------------
  |  Branch (647:26): [True: 6, False: 418]
  ------------------
  648|      6|                        ctx.error = error_code::syntax_error;
  649|      6|                        return;
  650|      6|                     }
  651|    418|                     const uint32_t hi = digit_hex_table[uint8_t(src[0])];
  652|    418|                     const uint32_t lo = digit_hex_table[uint8_t(src[1])];
  653|    418|                     if ((hi | lo) & 0xF0) [[unlikely]] {
  ------------------
  |  Branch (653:26): [True: 18, False: 400]
  ------------------
  654|     18|                        ctx.error = error_code::syntax_error;
  655|     18|                        return;
  656|     18|                     }
  657|    400|                     const uint32_t codepoint = (hi << 4) | lo;
  658|    400|                     src += 2;
  659|    400|                     dst += code_point_to_utf8(codepoint, dst);
  660|    400|                     break;
  661|    418|                  }
  662|    854|                  case 'u': {
  ------------------
  |  Branch (662:19): [True: 854, False: 5.32k]
  ------------------
  663|       |                     // \uXXXX - 4 hex digits
  664|    854|                     if (static_cast<size_t>(src_end - src) < 4) [[unlikely]] {
  ------------------
  |  Branch (664:26): [True: 10, False: 844]
  ------------------
  665|     10|                        ctx.error = error_code::syntax_error;
  666|     10|                        return;
  667|     10|                     }
  668|    844|                     const uint32_t codepoint = hex_to_u32(src);
  669|    844|                     if (codepoint == 0xFFFFFFFFu || (codepoint >= 0xD800 && codepoint <= 0xDFFF)) [[unlikely]] {
  ------------------
  |  Branch (669:26): [True: 34, False: 810]
  |  Branch (669:55): [True: 256, False: 554]
  |  Branch (669:78): [True: 34, False: 222]
  ------------------
  670|     68|                        ctx.error = error_code::syntax_error;
  671|     68|                        return;
  672|     68|                     }
  673|    776|                     src += 4;
  674|    776|                     dst += code_point_to_utf8(codepoint, dst);
  675|    776|                     break;
  676|    844|                  }
  677|  1.96k|                  case 'U': {
  ------------------
  |  Branch (677:19): [True: 1.96k, False: 4.21k]
  ------------------
  678|       |                     // \UXXXXXXXX - 8 hex digits
  679|  1.96k|                     if (static_cast<size_t>(src_end - src) < 8) [[unlikely]] {
  ------------------
  |  Branch (679:26): [True: 10, False: 1.95k]
  ------------------
  680|     10|                        ctx.error = error_code::syntax_error;
  681|     10|                        return;
  682|     10|                     }
  683|  1.95k|                     const uint32_t hi = hex_to_u32(src);
  684|  1.95k|                     const uint32_t lo = hex_to_u32(src + 4);
  685|  1.95k|                     if ((hi | lo) == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (685:26): [True: 22, False: 1.93k]
  ------------------
  686|     22|                        ctx.error = error_code::syntax_error;
  687|     22|                        return;
  688|     22|                     }
  689|  1.93k|                     const uint32_t codepoint = (hi << 16) | lo;
  690|  1.93k|                     src += 8;
  691|  1.93k|                     if (codepoint >= 0xD800 && codepoint <= 0xDFFF) [[unlikely]] {
  ------------------
  |  Branch (691:26): [True: 1.12k, False: 810]
  |  Branch (691:49): [True: 10, False: 1.11k]
  ------------------
  692|     10|                        ctx.error = error_code::syntax_error;
  693|     10|                        return;
  694|     10|                     }
  695|  1.92k|                     if (codepoint <= 0x10FFFF) {
  ------------------
  |  Branch (695:26): [True: 1.02k, False: 892]
  ------------------
  696|  1.02k|                        dst += code_point_to_utf8(codepoint, dst);
  697|  1.02k|                     }
  698|  1.92k|                     break;
  699|  1.93k|                  }
  700|    270|                  case 'N': {
  ------------------
  |  Branch (700:19): [True: 270, False: 5.91k]
  ------------------
  701|       |                     // Next line U+0085
  702|    270|                     dst += code_point_to_utf8(0x0085, dst);
  703|    270|                     break;
  704|  1.93k|                  }
  705|    302|                  case '_': {
  ------------------
  |  Branch (705:19): [True: 302, False: 5.87k]
  ------------------
  706|       |                     // Non-breaking space U+00A0
  707|    302|                     dst += code_point_to_utf8(0x00A0, dst);
  708|    302|                     break;
  709|  1.93k|                  }
  710|    986|                  case 'L': {
  ------------------
  |  Branch (710:19): [True: 986, False: 5.19k]
  ------------------
  711|       |                     // Line separator U+2028
  712|    986|                     dst += code_point_to_utf8(0x2028, dst);
  713|    986|                     break;
  714|  1.93k|                  }
  715|  1.38k|                  case 'P': {
  ------------------
  |  Branch (715:19): [True: 1.38k, False: 4.79k]
  ------------------
  716|       |                     // Paragraph separator U+2029
  717|  1.38k|                     dst += code_point_to_utf8(0x2029, dst);
  718|  1.38k|                     break;
  719|  1.93k|                  }
  720|      0|                  default:
  ------------------
  |  Branch (720:19): [True: 0, False: 6.18k]
  ------------------
  721|      0|                     break;
  722|  6.18k|                  }
  723|  6.18k|               }
  724|  10.7k|               else {
  725|       |                  // Preserve unknown escapes for compatibility, but reject a subset that
  726|       |                  // YAML test-suite marks as malformed in double-quoted scalars.
  727|  10.7k|                  if (esc == '.' || esc == '\'') {
  ------------------
  |  Branch (727:23): [True: 20, False: 10.7k]
  |  Branch (727:37): [True: 8, False: 10.7k]
  ------------------
  728|     28|                     ctx.error = error_code::syntax_error;
  729|     28|                     return;
  730|     28|                  }
  731|  10.7k|                  *dst++ = '\\';
  732|  10.7k|                  *dst++ = static_cast<char>(esc);
  733|  10.7k|                  ++src;
  734|  10.7k|               }
  735|       |               // All escape-produced characters are content, not trimmable
  736|  36.2k|               last_non_trimmable = dst;
  737|  36.2k|            }
  738|  4.71M|            else {
  739|  4.71M|               const char ch = *src++;
  740|  4.71M|               *dst++ = ch;
  741|       |               // Only update non-trimmable for non-whitespace literal characters
  742|  4.71M|               if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (742:20): [True: 4.50M, False: 210k]
  |  Branch (742:33): [True: 4.47M, False: 21.9k]
  ------------------
  743|  4.47M|                  last_non_trimmable = dst;
  744|  4.47M|               }
  745|  4.71M|            }
  746|  4.76M|         }
  747|       |
  748|       |         // Resize to actual length
  749|  1.68M|         value.resize(static_cast<size_t>(dst - dst_start));
  750|  1.68M|         ++it; // skip closing quote
  751|  1.68M|      }
_ZN3glz4yaml26parse_single_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  758|  36.8k|      {
  759|  36.8k|         static constexpr size_t string_padding_bytes = 8;
  760|       |
  761|  36.8k|         if (it == end || *it != '\'') [[unlikely]] {
  ------------------
  |  Branch (761:14): [True: 0, False: 36.8k]
  |  Branch (761:27): [True: 0, False: 36.8k]
  ------------------
  762|      0|            ctx.error = error_code::expected_quote;
  763|      0|            return;
  764|      0|         }
  765|       |
  766|  36.8k|         ++it; // skip opening quote
  767|  36.8k|         auto start = it;
  768|       |
  769|       |         // Pass 1: Find closing quote (handling '' escapes)
  770|  15.7M|         while (it != end) {
  ------------------
  |  Branch (770:17): [True: 15.7M, False: 446]
  ------------------
  771|  15.7M|            if (*it == '\'') {
  ------------------
  |  Branch (771:17): [True: 46.6k, False: 15.7M]
  ------------------
  772|  46.6k|               if ((it + 1) != end && *(it + 1) == '\'') {
  ------------------
  |  Branch (772:20): [True: 42.8k, False: 3.78k]
  |  Branch (772:39): [True: 10.7k, False: 32.1k]
  ------------------
  773|  10.7k|                  it += 2; // Skip escaped quote
  774|  10.7k|               }
  775|  35.9k|               else {
  776|  35.9k|                  break; // Found closing quote
  777|  35.9k|               }
  778|  46.6k|            }
  779|  15.7M|            else {
  780|  15.7M|               if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (780:20): [True: 446, False: 15.7M]
  ------------------
  781|    446|                  ctx.error = error_code::invalid_control_character;
  782|    446|                  return;
  783|    446|               }
  784|  15.7M|               ++it;
  785|  15.7M|            }
  786|  15.7M|         }
  787|       |
  788|  36.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (788:14): [True: 446, False: 35.9k]
  ------------------
  789|    446|            ctx.error = error_code::unexpected_end;
  790|    446|            return;
  791|    446|         }
  792|       |
  793|  35.9k|         const auto input_len = static_cast<size_t>(it - start);
  794|  35.9k|         value.resize(input_len + string_padding_bytes);
  795|  35.9k|         auto* dst = value.data();
  796|  35.9k|         auto* const dst_start = dst;
  797|  35.9k|         auto src = start;
  798|  35.9k|         const auto* const src_end = &*it;
  799|       |
  800|       |         // Pass 2: Process content with line folding and '' escapes
  801|  15.0M|         while (src < src_end) {
  ------------------
  |  Branch (801:17): [True: 14.9M, False: 35.6k]
  ------------------
  802|       |            // Check for newline - needs line folding
  803|  14.9M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (803:17): [True: 463k, False: 14.5M]
  |  Branch (803:33): [True: 74.1k, False: 14.4M]
  ------------------
  804|       |               // Trim trailing whitespace from output before processing newline
  805|   556k|               while (dst > dst_start && (*(dst - 1) == ' ' || *(dst - 1) == '\t')) {
  ------------------
  |  Branch (805:23): [True: 551k, False: 5.27k]
  |  Branch (805:43): [True: 16.8k, False: 534k]
  |  Branch (805:64): [True: 2.01k, False: 532k]
  ------------------
  806|  18.8k|                  --dst;
  807|  18.8k|               }
  808|       |
  809|       |               // Skip the newline
  810|   537k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (810:20): [True: 74.1k, False: 463k]
  |  Branch (810:36): [True: 72.1k, False: 2.06k]
  |  Branch (810:59): [True: 692, False: 71.4k]
  ------------------
  811|    692|                  src += 2; // CRLF
  812|    692|               }
  813|   536k|               else {
  814|   536k|                  ++src;
  815|   536k|               }
  816|       |
  817|       |               // Skip leading indentation on the next line.
  818|   537k|               int indent_count = 0;
  819|   537k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (819:20): [True: 68, False: 537k]
  ------------------
  820|   537k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (820:20): [True: 529k, False: 7.89k]
  |  Branch (820:41): [True: 60, False: 529k]
  ------------------
  821|     60|                  ctx.error = error_code::syntax_error;
  822|     60|                  return;
  823|     60|               }
  824|       |
  825|       |               // Check if this is a blank line (another newline follows)
  826|   537k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (826:20): [True: 531k, False: 6.09k]
  |  Branch (826:38): [True: 283k, False: 247k]
  |  Branch (826:54): [True: 61.5k, False: 186k]
  ------------------
  827|       |                  // Blank line(s) - output newlines for each blank line
  828|   877k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (828:26): [True: 875k, False: 2.07k]
  |  Branch (828:44): [True: 459k, False: 415k]
  |  Branch (828:60): [True: 72.7k, False: 342k]
  ------------------
  829|   532k|                     *dst++ = '\n';
  830|       |                     // Skip the newline
  831|   532k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (831:26): [True: 72.7k, False: 459k]
  |  Branch (831:42): [True: 71.3k, False: 1.34k]
  |  Branch (831:65): [True: 366, False: 71.0k]
  ------------------
  832|    366|                        src += 2; // CRLF
  833|    366|                     }
  834|   532k|                     else {
  835|   532k|                        ++src;
  836|   532k|                     }
  837|   532k|                     int blank_indent_count = 0;
  838|   532k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (838:26): [True: 60, False: 532k]
  ------------------
  839|   532k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (839:26): [True: 531k, False: 1.45k]
  |  Branch (839:53): [True: 72, False: 531k]
  ------------------
  840|     72|                        ctx.error = error_code::syntax_error;
  841|     72|                        return;
  842|     72|                     }
  843|   532k|                  }
  844|       |                  // Don't add space - we're now at content after blank line(s)
  845|   345k|               }
  846|   192k|               else {
  847|       |                  // Single newline - fold to space
  848|   192k|                  *dst++ = ' ';
  849|   192k|               }
  850|   537k|               continue;
  851|   537k|            }
  852|       |
  853|  14.4M|            if (*src == '\'') {
  ------------------
  |  Branch (853:17): [True: 9.85k, False: 14.4M]
  ------------------
  854|       |               // Must be '' (escaped quote) - we validated this in pass 1
  855|  9.85k|               *dst++ = '\'';
  856|  9.85k|               src += 2;
  857|  9.85k|            }
  858|  14.4M|            else {
  859|  14.4M|               *dst++ = *src++;
  860|  14.4M|            }
  861|  14.4M|         }
  862|       |
  863|  35.6k|         value.resize(static_cast<size_t>(dst - dst_start));
  864|  35.6k|         ++it; // skip closing quote
  865|  35.6k|      }
_ZN3glz4yaml18parse_block_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1362|  49.8k|      {
 1363|  49.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1363:14): [True: 0, False: 49.8k]
  ------------------
 1364|      0|            ctx.error = error_code::unexpected_end;
 1365|      0|            return;
 1366|      0|         }
 1367|       |
 1368|  49.8k|         const char indicator = *it;
 1369|  49.8k|         ++it;
 1370|  49.8k|         const auto header_start = it;
 1371|       |
 1372|       |         // Chomping indicator: - (strip), + (keep), or none (clip)
 1373|  49.8k|         char chomping = ' '; // default: clip
 1374|  49.8k|         int explicit_indent = 0;
 1375|  49.8k|         bool seen_chomping = false;
 1376|  49.8k|         bool seen_indent = false;
 1377|       |
 1378|  79.7k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1378:17): [True: 78.8k, False: 838]
  |  Branch (1378:30): [True: 53.8k, False: 25.0k]
  |  Branch (1378:45): [True: 33.6k, False: 20.1k]
  ------------------
 1379|  33.6k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (1379:17): [True: 2.44k, False: 31.2k]
  |  Branch (1379:31): [True: 8.00k, False: 23.2k]
  ------------------
 1380|  10.4k|               if (seen_chomping) {
  ------------------
  |  Branch (1380:20): [True: 10, False: 10.4k]
  ------------------
 1381|     10|                  ctx.error = error_code::syntax_error;
 1382|     10|                  return;
 1383|     10|               }
 1384|  10.4k|               seen_chomping = true;
 1385|  10.4k|               chomping = *it;
 1386|  10.4k|            }
 1387|  23.2k|            else if (*it >= '1' && *it <= '9') {
  ------------------
  |  Branch (1387:22): [True: 3.45k, False: 19.7k]
  |  Branch (1387:36): [True: 3.31k, False: 140]
  ------------------
 1388|  3.31k|               if (seen_indent) {
  ------------------
  |  Branch (1388:20): [True: 6, False: 3.30k]
  ------------------
 1389|       |                  // YAML indentation indicator is a single digit [1-9].
 1390|      6|                  ctx.error = error_code::syntax_error;
 1391|      6|                  return;
 1392|      6|               }
 1393|  3.30k|               seen_indent = true;
 1394|  3.30k|               explicit_indent = *it - '0';
 1395|  3.30k|            }
 1396|  19.9k|            else if (*it == '0') {
  ------------------
  |  Branch (1396:22): [True: 22, False: 19.8k]
  ------------------
 1397|       |               // Indentation indicator 0 is invalid by spec.
 1398|     22|               ctx.error = error_code::syntax_error;
 1399|     22|               return;
 1400|     22|            }
 1401|  19.8k|            else if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (1401:22): [True: 12.8k, False: 7.02k]
  |  Branch (1401:36): [True: 3.21k, False: 3.81k]
  ------------------
 1402|       |               // Skip whitespace
 1403|  16.0k|            }
 1404|  3.81k|            else if (*it == '#') {
  ------------------
  |  Branch (1404:22): [True: 3.20k, False: 610]
  ------------------
 1405|       |               // Block scalar comments require separation whitespace.
 1406|  3.20k|               if (it == header_start || (*(it - 1) != ' ' && *(it - 1) != '\t')) {
  ------------------
  |  Branch (1406:20): [True: 8, False: 3.19k]
  |  Branch (1406:43): [True: 248, False: 2.94k]
  |  Branch (1406:63): [True: 6, False: 242]
  ------------------
 1407|     14|                  ctx.error = error_code::syntax_error;
 1408|     14|                  return;
 1409|     14|               }
 1410|       |               // Skip comment
 1411|  3.19M|               while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1411:23): [True: 3.19M, False: 276]
  |  Branch (1411:36): [True: 3.19M, False: 1.52k]
  |  Branch (1411:51): [True: 3.19M, False: 1.38k]
  ------------------
 1412|  3.19M|                  ++it;
 1413|  3.19M|               }
 1414|  3.18k|               break;
 1415|  3.20k|            }
 1416|    610|            else {
 1417|    610|               ctx.error = error_code::syntax_error;
 1418|    610|               return;
 1419|    610|            }
 1420|  29.8k|            ++it;
 1421|  29.8k|         }
 1422|       |
 1423|       |         // Skip newline after indicator
 1424|  49.2k|         if (!skip_newline(it, end)) {
  ------------------
  |  Branch (1424:14): [True: 1.11k, False: 48.1k]
  ------------------
 1425|       |            // Empty block scalar
 1426|  1.11k|            value.clear();
 1427|  1.11k|            return;
 1428|  1.11k|         }
 1429|       |
 1430|  48.1k|         value.clear();
 1431|       |
 1432|       |         // Determine content indentation
 1433|  48.1k|         int32_t content_indent = -1;
 1434|  48.1k|         int32_t leading_blank_indent_max = -1;
 1435|  48.1k|         bool first_line = true;
 1436|  48.1k|         bool previous_line_starts_with_tab = false;
 1437|  48.1k|         bool previous_line_more_indented = false;
 1438|  48.1k|         std::string trailing_newlines;
 1439|       |
 1440|  6.52M|         while (it != end) {
  ------------------
  |  Branch (1440:17): [True: 6.50M, False: 20.2k]
  ------------------
 1441|  6.50M|            auto line_start = it;
 1442|  6.50M|            int32_t line_indent = measure_indent<false>(it, end, ctx);
 1443|  6.50M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1443:17): [True: 10, False: 6.50M]
  ------------------
 1444|     10|               return;
 1445|       |
 1446|       |            // Check for blank line
 1447|  6.50M|            if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1447:17): [True: 266, False: 6.50M]
  |  Branch (1447:30): [True: 146k, False: 6.36M]
  |  Branch (1447:45): [True: 6.24M, False: 112k]
  ------------------
 1448|       |               // In literal mode, a line with more spaces than content_indent
 1449|       |               // has whitespace content that must be preserved.
 1450|  6.39M|               if (content_indent >= 0 && line_indent > content_indent && indicator == '|') {
  ------------------
  |  Branch (1450:20): [True: 6.13M, False: 259k]
  |  Branch (1450:43): [True: 2.46k, False: 6.13M]
  |  Branch (1450:75): [True: 1.22k, False: 1.23k]
  ------------------
 1451|  1.22k|                  it = line_start;
 1452|  1.87k|                  for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1452:39): [True: 646, False: 1.22k]
  |  Branch (1452:61): [True: 646, False: 0]
  |  Branch (1452:74): [True: 646, False: 0]
  ------------------
 1453|    646|                     ++it;
 1454|    646|                  }
 1455|       |                  // Fall through to content processing below
 1456|  1.22k|               }
 1457|  6.39M|               else {
 1458|  6.39M|                  if (content_indent < 0) {
  ------------------
  |  Branch (1458:23): [True: 259k, False: 6.13M]
  ------------------
 1459|   259k|                     leading_blank_indent_max = (std::max)(leading_blank_indent_max, line_indent);
 1460|   259k|                  }
 1461|  6.39M|                  trailing_newlines.push_back('\n');
 1462|  6.39M|                  skip_newline(it, end);
 1463|  6.39M|                  continue;
 1464|  6.39M|               }
 1465|  6.39M|            }
 1466|       |
 1467|       |            // Top-level zero-indented block scalars must stop at document boundary markers.
 1468|   114k|            if (base_indent < 0 && line_indent == 0 && (at_document_start(it, end) || at_document_end(it, end))) {
  ------------------
  |  Branch (1468:17): [True: 94.8k, False: 19.3k]
  |  Branch (1468:36): [True: 83.8k, False: 10.9k]
  |  Branch (1468:57): [True: 4.34k, False: 79.5k]
  |  Branch (1468:87): [True: 1.26k, False: 78.2k]
  ------------------
 1469|  5.60k|               it = line_start;
 1470|  5.60k|               break;
 1471|  5.60k|            }
 1472|       |
 1473|       |            // First content line determines indentation
 1474|   108k|            if (content_indent < 0) {
  ------------------
  |  Branch (1474:17): [True: 36.8k, False: 71.7k]
  ------------------
 1475|  36.8k|               if (explicit_indent > 0) {
  ------------------
  |  Branch (1475:20): [True: 1.85k, False: 34.9k]
  ------------------
 1476|  1.85k|                  content_indent = base_indent + explicit_indent;
 1477|  1.85k|               }
 1478|  34.9k|               else {
 1479|  34.9k|                  content_indent = line_indent;
 1480|  34.9k|               }
 1481|       |
 1482|  36.8k|               if (content_indent <= base_indent) {
  ------------------
  |  Branch (1482:20): [True: 16.6k, False: 20.1k]
  ------------------
 1483|  16.6k|                  it = line_start;
 1484|  16.6k|                  break;
 1485|  16.6k|               }
 1486|  20.1k|               if (leading_blank_indent_max > content_indent) {
  ------------------
  |  Branch (1486:20): [True: 50, False: 20.0k]
  ------------------
 1487|     50|                  ctx.error = error_code::syntax_error;
 1488|     50|                  return;
 1489|     50|               }
 1490|  20.1k|            }
 1491|       |
 1492|       |            // Check if we've dedented
 1493|  91.8k|            if (line_indent < content_indent) {
  ------------------
  |  Branch (1493:17): [True: 5.00k, False: 86.8k]
  ------------------
 1494|  5.00k|               it = line_start;
 1495|  5.00k|               break;
 1496|  5.00k|            }
 1497|       |
 1498|       |            // Skip to content_indent level
 1499|  86.8k|            it = line_start;
 1500|   772k|            for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1500:33): [True: 685k, False: 86.8k]
  |  Branch (1500:55): [True: 685k, False: 0]
  |  Branch (1500:68): [True: 685k, False: 0]
  ------------------
 1501|   685k|               ++it;
 1502|   685k|            }
 1503|       |
 1504|  86.8k|            const bool current_line_starts_with_tab = (it != end && *it == '\t');
  ------------------
  |  Branch (1504:56): [True: 86.8k, False: 0]
  |  Branch (1504:69): [True: 950, False: 85.8k]
  ------------------
 1505|  86.8k|            const bool current_line_more_indented = (line_indent > content_indent);
 1506|       |
 1507|       |            // Add previous newlines
 1508|  86.8k|            if (first_line) {
  ------------------
  |  Branch (1508:17): [True: 18.2k, False: 68.6k]
  ------------------
 1509|       |               // Leading blank lines are part of block scalar content
 1510|  18.2k|               value += trailing_newlines;
 1511|  18.2k|            }
 1512|  68.6k|            else {
 1513|  68.6k|               if (indicator == '|') {
  ------------------
  |  Branch (1513:20): [True: 15.6k, False: 52.9k]
  ------------------
 1514|       |                  // Literal: preserve newlines
 1515|  15.6k|                  value += trailing_newlines;
 1516|  15.6k|               }
 1517|  52.9k|               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|  52.9k|                  const size_t break_count = trailing_newlines.size();
 1521|  52.9k|                  const bool adjacent_special = previous_line_starts_with_tab || current_line_starts_with_tab ||
  ------------------
  |  Branch (1521:49): [True: 298, False: 52.6k]
  |  Branch (1521:82): [True: 378, False: 52.2k]
  ------------------
 1522|  52.2k|                                                previous_line_more_indented || current_line_more_indented;
  ------------------
  |  Branch (1522:49): [True: 3.06k, False: 49.2k]
  |  Branch (1522:80): [True: 3.47k, False: 45.7k]
  ------------------
 1523|  52.9k|                  if (break_count == 1) {
  ------------------
  |  Branch (1523:23): [True: 38.1k, False: 14.8k]
  ------------------
 1524|  38.1k|                     if (adjacent_special) {
  ------------------
  |  Branch (1524:26): [True: 6.30k, False: 31.8k]
  ------------------
 1525|  6.30k|                        value.push_back('\n');
 1526|  6.30k|                     }
 1527|  31.8k|                     else {
 1528|  31.8k|                        value.push_back(' ');
 1529|  31.8k|                     }
 1530|  38.1k|                  }
 1531|  14.8k|                  else if (break_count > 1) {
  ------------------
  |  Branch (1531:28): [True: 14.8k, False: 0]
  ------------------
 1532|  14.8k|                     const size_t preserve_count = adjacent_special ? break_count : (break_count - 1);
  ------------------
  |  Branch (1532:52): [True: 898, False: 13.9k]
  ------------------
 1533|  14.8k|                     value.append(preserve_count, '\n');
 1534|  14.8k|                  }
 1535|  52.9k|               }
 1536|  68.6k|            }
 1537|  86.8k|            trailing_newlines.clear();
 1538|  86.8k|            first_line = false;
 1539|  86.8k|            previous_line_starts_with_tab = current_line_starts_with_tab;
 1540|  86.8k|            previous_line_more_indented = current_line_more_indented;
 1541|       |
 1542|       |            // Read line content
 1543|  2.92M|            while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1543:20): [True: 2.92M, False: 2.62k]
  |  Branch (1543:33): [True: 2.86M, False: 56.5k]
  |  Branch (1543:48): [True: 2.84M, False: 27.1k]
  ------------------
 1544|  2.84M|               if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (1544:20): [True: 528, False: 2.84M]
  ------------------
 1545|       |                  // Block scalars have no escape mechanism, so the byte cannot be valid here.
 1546|    528|                  ctx.error = error_code::invalid_control_character;
 1547|    528|                  return;
 1548|    528|               }
 1549|  2.84M|               value.push_back(*it);
 1550|  2.84M|               ++it;
 1551|  2.84M|            }
 1552|       |
 1553|  86.3k|            trailing_newlines.push_back('\n');
 1554|  86.3k|            skip_newline(it, end);
 1555|  86.3k|         }
 1556|       |
 1557|       |         // Apply chomping
 1558|  47.5k|         if (chomping == '-') {
  ------------------
  |  Branch (1558:14): [True: 2.40k, False: 45.1k]
  ------------------
 1559|       |            // Strip: remove all trailing newlines
 1560|  2.40k|         }
 1561|  45.1k|         else if (chomping == '+') {
  ------------------
  |  Branch (1561:19): [True: 7.90k, False: 37.2k]
  ------------------
 1562|       |            // Keep: preserve all trailing newlines
 1563|  7.90k|            value += trailing_newlines;
 1564|  7.90k|         }
 1565|  37.2k|         else {
 1566|       |            // Clip: single trailing newline
 1567|  37.2k|            if (!value.empty()) {
  ------------------
  |  Branch (1567:17): [True: 9.62k, False: 27.5k]
  ------------------
 1568|  9.62k|               value.push_back('\n');
 1569|  9.62k|            }
 1570|  37.2k|         }
 1571|  47.5k|      }
_ZN3glz4yaml18parse_plain_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1019|  3.20M|      {
 1020|  3.20M|         value.clear();
 1021|       |
 1022|  34.1M|         while (it != end) {
  ------------------
  |  Branch (1022:17): [True: 33.9M, False: 201k]
  ------------------
 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|  33.9M|            {
 1027|  33.9M|               const auto run_start = it;
 1028|   213M|               while (it != end && !plain_scalar_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1028:23): [True: 213M, False: 287k]
  |  Branch (1028:36): [True: 179M, False: 33.6M]
  ------------------
 1029|   179M|                  ++it;
 1030|   179M|               }
 1031|  33.9M|               if (it != run_start) {
  ------------------
  |  Branch (1031:20): [True: 32.4M, False: 1.43M]
  ------------------
 1032|  32.4M|                  value.append(run_start, it);
 1033|  32.4M|               }
 1034|  33.9M|               if (it == end) break;
  ------------------
  |  Branch (1034:20): [True: 287k, False: 33.6M]
  ------------------
 1035|  33.9M|            }
 1036|       |
 1037|  33.6M|            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|  33.6M|            if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1041:17): [True: 11.2k, False: 33.6M]
  ------------------
 1042|  11.2k|               ctx.error = error_code::invalid_control_character;
 1043|  11.2k|               return;
 1044|  11.2k|            }
 1045|       |
 1046|       |            // End conditions
 1047|  33.6M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1047:17): [True: 589k, False: 33.0M]
  |  Branch (1047:30): [True: 1.90M, False: 31.1M]
  ------------------
 1048|  2.49M|               if (in_flow) {
  ------------------
  |  Branch (1048:20): [True: 2.41M, False: 83.1k]
  ------------------
 1049|  2.41M|                  auto continuation = it;
 1050|  2.41M|                  skip_newline(continuation, end);
 1051|  2.41M|                  bool continuation_is_comment = false;
 1052|       |
 1053|  2.41M|                  while (continuation != end) {
  ------------------
  |  Branch (1053:26): [True: 2.28M, False: 128k]
  ------------------
 1054|  6.00M|                     while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1054:29): [True: 5.99M, False: 9.95k]
  |  Branch (1054:53): [True: 3.67M, False: 2.32M]
  |  Branch (1054:77): [True: 47.6k, False: 2.27M]
  ------------------
 1055|  3.72M|                        ++continuation;
 1056|  3.72M|                     }
 1057|  2.28M|                     if (continuation != end && *continuation == '#') {
  ------------------
  |  Branch (1057:26): [True: 2.27M, False: 9.95k]
  |  Branch (1057:49): [True: 85.4k, False: 2.18M]
  ------------------
 1058|       |                        // Comment lines terminate plain flow scalars; the caller
 1059|       |                        // will consume comments/separators outside this scalar.
 1060|  85.4k|                        continuation_is_comment = true;
 1061|  85.4k|                        break;
 1062|  85.4k|                     }
 1063|  2.19M|                     break;
 1064|  2.28M|                  }
 1065|       |
 1066|  2.41M|                  if (continuation_is_comment || continuation == end || *continuation == ',' || *continuation == ']' ||
  ------------------
  |  Branch (1066:23): [True: 85.4k, False: 2.32M]
  |  Branch (1066:50): [True: 138k, False: 2.18M]
  |  Branch (1066:73): [True: 206k, False: 1.98M]
  |  Branch (1066:97): [True: 3.94k, False: 1.97M]
  ------------------
 1067|  1.97M|                      *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1067:23): [True: 20.9k, False: 1.95M]
  |  Branch (1067:47): [True: 37.4k, False: 1.91M]
  ------------------
 1068|   492k|                     break;
 1069|   492k|                  }
 1070|       |
 1071|  2.22M|                  while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1071:26): [True: 2.18M, False: 32.5k]
  |  Branch (1071:45): [True: 272k, False: 1.91M]
  |  Branch (1071:68): [True: 29.4k, False: 1.88M]
  ------------------
 1072|   302k|                     value.pop_back();
 1073|   302k|                  }
 1074|  1.91M|                  if (!value.empty()) {
  ------------------
  |  Branch (1074:23): [True: 1.88M, False: 32.5k]
  ------------------
 1075|  1.88M|                     value.push_back(' ');
 1076|  1.88M|                  }
 1077|  1.91M|                  it = continuation;
 1078|  1.91M|                  continue;
 1079|  2.41M|               }
 1080|  83.1k|               break;
 1081|  2.49M|            }
 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|  31.1M|            if (c == '#') {
  ------------------
  |  Branch (1085:17): [True: 1.19M, False: 29.9M]
  ------------------
 1086|       |               // Check if preceded by whitespace (comment indicator)
 1087|  1.19M|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1087:20): [True: 25.5k, False: 1.16M]
  |  Branch (1087:37): [True: 41.8k, False: 1.12M]
  |  Branch (1087:60): [True: 5.31k, False: 1.12M]
  ------------------
 1088|  72.6k|                  break; // This is a comment
 1089|  72.6k|               }
 1090|       |               // Otherwise # is part of the scalar value
 1091|  1.19M|            }
 1092|       |
 1093|       |            // Flow indicators end plain scalars in flow context
 1094|  31.0M|            if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1094:17): [True: 30.9M, False: 69.1k]
  |  Branch (1094:29): [True: 1.34M, False: 29.6M]
  |  Branch (1094:41): [True: 141k, False: 29.4M]
  |  Branch (1094:53): [True: 322k, False: 29.1M]
  ------------------
 1095|       |
 1096|       |            // Colon followed by space/newline ends plain scalar
 1097|  29.2M|            if (c == ':') {
  ------------------
  |  Branch (1097:17): [True: 28.1M, False: 1.13M]
  ------------------
 1098|  28.1M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1098:20): [True: 21.5k, False: 28.0M]
  |  Branch (1098:39): [True: 121k, False: 27.9M]
  |  Branch (1098:59): [True: 12.4k, False: 27.9M]
  |  Branch (1098:80): [True: 38.8k, False: 27.9M]
  |  Branch (1098:101): [True: 15.8k, False: 27.8M]
  ------------------
 1099|   210k|                  break;
 1100|   210k|               }
 1101|  27.8M|               if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1101:20): [True: 27.8M, False: 12.9k]
  |  Branch (1101:32): [True: 27.0k, False: 27.8M]
  |  Branch (1101:52): [True: 872, False: 27.8M]
  |  Branch (1101:72): [True: 6.26k, False: 27.8M]
  ------------------
 1102|  34.1k|                  break;
 1103|  34.1k|               }
 1104|  27.8M|            }
 1105|       |
 1106|  28.9M|            value.push_back(c);
 1107|  28.9M|            ++it;
 1108|  28.9M|         }
 1109|       |
 1110|       |         // Trim trailing whitespace
 1111|  5.37M|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1111:17): [True: 4.83M, False: 535k]
  |  Branch (1111:36): [True: 1.82M, False: 3.01M]
  |  Branch (1111:59): [True: 357k, False: 2.65M]
  ------------------
 1112|  2.18M|            value.pop_back();
 1113|  2.18M|         }
 1114|       |
 1115|  3.19M|         if (in_flow && (value == "---" || value == "..." || value == "-")) {
  ------------------
  |  Branch (1115:14): [True: 2.98M, False: 210k]
  |  Branch (1115:26): [True: 10, False: 2.98M]
  |  Branch (1115:44): [True: 14, False: 2.98M]
  |  Branch (1115:62): [True: 28, False: 2.98M]
  ------------------
 1116|     52|            ctx.error = error_code::syntax_error;
 1117|     52|         }
 1118|  3.19M|      }
_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|   821k|      {
 5311|   821k|         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|   821k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   821k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   821k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   821k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 821k, False: 0]
  ------------------
 5321|   821k|            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|   821k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   824k|      {
 2116|   824k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 824k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   824k|         yaml::node_preamble_state preamble{};
 2120|   824k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 6.30k, False: 818k]
  ------------------
 2121|   824k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   824k|                   return yaml::tag_valid_for_float(tag);
 2123|   824k|                }
 2124|   824k|                else {
 2125|   824k|                   return yaml::tag_valid_for_int(tag);
 2126|   824k|                }
 2127|   824k|             }))
 2128|  6.30k|            return;
 2129|       |
 2130|   818k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   818k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   818k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   818k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 17.6k, False: 800k]
  ------------------
 2138|  17.6k|               ++it;
 2139|  17.6k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 16.2k, False: 1.30k]
  |  Branch (2139:38): [True: 722, False: 15.5k]
  |  Branch (2139:74): [True: 247, False: 15.3k]
  ------------------
 2140|  15.3k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 430, False: 14.8k]
  ------------------
 2141|  1.39k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  1.39k|                  it += 3;
 2143|  1.39k|                  finalize();
 2144|  1.39k|                  return;
 2145|  1.39k|               }
 2146|  16.2k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 14.8k, False: 1.30k]
  |  Branch (2146:38): [True: 232, False: 14.6k]
  |  Branch (2146:74): [True: 256, False: 14.4k]
  ------------------
 2147|  14.4k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 786, False: 13.6k]
  ------------------
 2148|  1.27k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  1.27k|                  it += 3;
 2150|  1.27k|                  finalize();
 2151|  1.27k|                  return;
 2152|  1.27k|               }
 2153|  14.9k|               it = start;
 2154|  14.9k|            }
 2155|       |
 2156|   815k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 3.44k, False: 812k]
  |  Branch (2156:31): [True: 8.84k, False: 803k]
  ------------------
 2157|  12.2k|               const char sign = *it;
 2158|  12.2k|               ++it;
 2159|  12.2k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 11.7k, False: 495]
  |  Branch (2159:33): [True: 2.75k, False: 9.03k]
  ------------------
 2160|  2.75k|                  ++it;
 2161|  2.75k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 2.32k, False: 426]
  |  Branch (2161:41): [True: 533, False: 1.79k]
  |  Branch (2161:77): [True: 623, False: 1.17k]
  ------------------
 2162|  1.49k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 337, False: 833]
  ------------------
 2163|  1.49k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 1.17k, False: 320]
  ------------------
 2164|  1.17k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  1.17k|                     }
 2166|    320|                     else {
 2167|    320|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    320|                     }
 2169|  1.49k|                     it += 3;
 2170|  1.49k|                     finalize();
 2171|  1.49k|                     return;
 2172|  1.49k|                  }
 2173|  2.75k|               }
 2174|  10.7k|               it = start;
 2175|  10.7k|            }
 2176|   815k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   814k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  27.8M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 27.8M, False: 7.29k]
  ------------------
 2183|  27.8M|            const char c = *it;
 2184|  27.8M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 14.4k, False: 27.8M]
  |  Branch (2184:29): [True: 7.12k, False: 27.8M]
  |  Branch (2184:42): [True: 7.27k, False: 27.8M]
  |  Branch (2184:55): [True: 2.07k, False: 27.7M]
  |  Branch (2184:68): [True: 762k, False: 27.0M]
  |  Branch (2184:80): [True: 3.31k, False: 27.0M]
  |  Branch (2184:92): [True: 1.68k, False: 27.0M]
  |  Branch (2184:104): [True: 8.40k, False: 27.0M]
  ------------------
 2185|   806k|               break;
 2186|   806k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  27.0M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 469k, False: 26.5M]
  ------------------
 2189|   469k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 683, False: 469k]
  |  Branch (2189:39): [True: 2.00k, False: 467k]
  |  Branch (2189:59): [True: 585, False: 466k]
  |  Branch (2189:80): [True: 533, False: 465k]
  |  Branch (2189:101): [True: 741, False: 465k]
  ------------------
 2190|  4.54k|                  break;
 2191|  4.54k|               }
 2192|   469k|            }
 2193|  27.0M|            ++it;
 2194|  27.0M|         }
 2195|       |
 2196|   818k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   818k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 1.12k, False: 817k]
  ------------------
 2199|  1.12k|            ctx.error = error_code::parse_number_failure;
 2200|  1.12k|            return;
 2201|  1.12k|         }
 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|   817k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   817k|            bool negative = false;
 2254|   817k|            std::string_view digits = num_str;
 2255|       |
 2256|   817k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 813k, False: 4.16k]
  |  Branch (2256:37): [True: 8.52k, False: 804k]
  |  Branch (2256:62): [True: 2.27k, False: 802k]
  ------------------
 2257|  10.7k|               negative = (digits.front() == '-');
 2258|  10.7k|               digits.remove_prefix(1);
 2259|  10.7k|            }
 2260|       |
 2261|   817k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 132k, False: 685k]
  |  Branch (2261:38): [True: 17.8k, False: 114k]
  ------------------
 2262|  17.8k|               int base = 10;
 2263|  17.8k|               size_t offset = 0;
 2264|       |
 2265|  17.8k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 1.90k, False: 15.9k]
  |  Branch (2265:40): [True: 612, False: 15.3k]
  ------------------
 2266|  2.51k|                  base = 16;
 2267|  2.51k|                  offset = 2;
 2268|  2.51k|               }
 2269|  15.3k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 642, False: 14.6k]
  |  Branch (2269:45): [True: 471, False: 14.1k]
  ------------------
 2270|  1.11k|                  base = 8;
 2271|  1.11k|                  offset = 2;
 2272|  1.11k|               }
 2273|  14.1k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 460, False: 13.7k]
  |  Branch (2273:45): [True: 532, False: 13.2k]
  ------------------
 2274|    992|                  base = 2;
 2275|    992|                  offset = 2;
 2276|    992|               }
 2277|       |
 2278|  17.8k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 4.61k, False: 13.2k]
  ------------------
 2279|  4.61k|                  auto raw_digits = digits.substr(offset);
 2280|  4.61k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  4.61k|                  std::string clean_storage;
 2283|  4.61k|                  std::string_view clean_view;
 2284|  4.61k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 1.24k, False: 3.37k]
  ------------------
 2285|  1.24k|                     clean_storage.reserve(raw_digits.size());
 2286|  3.26M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 3.26M, False: 1.24k]
  ------------------
 2287|  3.26M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 3.26M, False: 2.79k]
  ------------------
 2288|  3.26M|                           clean_storage.push_back(c);
 2289|  3.26M|                        }
 2290|  3.26M|                     }
 2291|  1.24k|                     clean_view = clean_storage;
 2292|  1.24k|                  }
 2293|  3.37k|                  else {
 2294|  3.37k|                     clean_view = raw_digits;
 2295|  3.37k|                  }
 2296|       |
 2297|  4.61k|                  uint64_t parsed_int{};
 2298|  4.61k|                  auto [ptr, ec] =
 2299|  4.61k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  4.61k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 2.18k, False: 2.43k]
  |  Branch (2300:44): [True: 797, False: 1.63k]
  ------------------
 2301|  2.97k|                     ctx.error = error_code::parse_number_failure;
 2302|  2.97k|                     finalize();
 2303|  2.97k|                     return;
 2304|  2.97k|                  }
 2305|       |
 2306|  1.63k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  1.63k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 828, False: 811]
  ------------------
 2308|  1.63k|                  finalize();
 2309|  1.63k|                  return;
 2310|  4.61k|               }
 2311|  17.8k|            }
 2312|   817k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|   812k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|   817k|         std::string clean_storage;
 2318|   817k|         std::string_view clean_view;
 2319|       |
 2320|   817k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 1.85k, False: 815k]
  ------------------
 2321|  1.85k|            clean_storage.reserve(num_str.size());
 2322|  11.5M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 11.5M, False: 1.85k]
  ------------------
 2323|  11.5M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 11.5M, False: 9.71k]
  ------------------
 2324|  11.5M|                  clean_storage.push_back(c);
 2325|  11.5M|               }
 2326|  11.5M|            }
 2327|  1.85k|            clean_view = clean_storage;
 2328|  1.85k|         }
 2329|   815k|         else {
 2330|   815k|            clean_view = num_str;
 2331|   815k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   817k|         auto parse_view = clean_view;
 2336|   817k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 808k, False: 8.87k]
  |  Branch (2336:37): [True: 8.51k, False: 800k]
  ------------------
 2337|  8.51k|            parse_view.remove_prefix(1);
 2338|  8.51k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 3.33k, False: 5.18k]
  ------------------
 2339|  3.33k|               ctx.error = error_code::parse_number_failure;
 2340|  3.33k|               return;
 2341|  3.33k|            }
 2342|  8.51k|         }
 2343|       |
 2344|   814k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   814k|            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|   814k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 28.2k, False: 785k]
  |  Branch (2347:45): [True: 33.6k, False: 752k]
  ------------------
 2348|  53.1k|               ctx.error = error_code::parse_number_failure;
 2349|  53.1k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|   814k|         finalize();
 2360|   814k|      }
_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|   824k|      {
  466|   824k|         skip_inline_ws(it, end);
  467|       |
  468|   824k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 426, False: 824k]
  ------------------
  469|    426|            if constexpr (!AllowEmptyInput) {
  470|    426|               ctx.error = error_code::unexpected_end;
  471|    426|            }
  472|    426|            return true;
  473|    426|         }
  474|       |
  475|   824k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   824k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 157, False: 824k]
  ------------------
  477|    157|            ctx.error = error_code::syntax_error;
  478|    157|            return true;
  479|    157|         }
  480|   824k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 144, False: 824k]
  ------------------
  481|    144|            ctx.error = error_code::syntax_error;
  482|    144|            return true;
  483|    144|         }
  484|       |
  485|   824k|         skip_inline_ws(it, end);
  486|       |
  487|   824k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 159, False: 823k]
  ------------------
  488|    159|            if constexpr (!AllowEmptyInput) {
  489|    159|               ctx.error = error_code::unexpected_end;
  490|    159|            }
  491|    159|            return true;
  492|    159|         }
  493|       |
  494|   823k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.41k, False: 818k]
  ------------------
  495|  5.41k|            return true;
  496|  5.41k|         }
  497|       |
  498|   818k|         return false;
  499|   823k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   824k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   824k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   824k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   824k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   823k|      {
  409|   823k|         state.has_anchor = false;
  410|   823k|         state.anchor_name.clear();
  411|   823k|         state.anchor_start = nullptr;
  412|   823k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   823k|         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|   823k|            else {
  421|   823k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.98k, False: 819k]
  ------------------
  422|   823k|            }
  423|   823k|         }
  424|       |
  425|   823k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 819k, False: 4.98k]
  |  Branch (425:27): [True: 3.72k, False: 815k]
  ------------------
  426|  3.72k|            ++it;
  427|  3.72k|            auto name = parse_anchor_name(it, end);
  428|  3.72k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 246, False: 3.47k]
  ------------------
  429|    246|               ctx.error = error_code::syntax_error;
  430|    246|               return true;
  431|    246|            }
  432|  3.47k|            skip_inline_ws(it, end);
  433|  3.47k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 188, False: 3.28k]
  ------------------
  434|    188|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    188|                  ctx.error = error_code::unexpected_end;
  436|    188|               }
  437|    188|               return true;
  438|    188|            }
  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.28k|            state.has_anchor = true;
  446|  3.28k|            state.anchor_name = std::string(name);
  447|  3.28k|            state.anchor_start = &*it;
  448|  3.28k|         }
  449|       |
  450|   823k|         return false;
  451|   823k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   823k|      {
  301|   823k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 823k]
  |  Branch (301:27): [True: 819k, False: 4.98k]
  ------------------
  302|       |
  303|  4.98k|         ++it; // skip '*'
  304|  4.98k|         auto name = parse_anchor_name(it, end);
  305|  4.98k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 316, False: 4.66k]
  ------------------
  306|    316|            ctx.error = error_code::syntax_error;
  307|    316|            return true;
  308|    316|         }
  309|       |
  310|  4.66k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.66k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 881, False: 3.78k]
  ------------------
  312|    881|            ctx.error = error_code::syntax_error; // undefined alias
  313|    881|            return true;
  314|    881|         }
  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.78k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.78k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 744, False: 3.04k]
  ------------------
  322|    744|            return true;
  323|    744|         }
  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.04k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 80, False: 2.96k]
  ------------------
  329|     80|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     80|            return true;
  331|     80|         }
  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.96k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.96k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 2.95k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  2.95k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 10, False: 2.94k]
  ------------------
  342|     10|            ctx.error = error_code::exceeded_max_expansion;
  343|     10|            ctx.custom_error_message = "alias expansion";
  344|     10|            return true;
  345|     10|         }
  346|       |
  347|  2.94k|         auto replay_it = span.begin;
  348|  2.94k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.94k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.94k|         ctx.indent_stack.clear();
  353|  2.94k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 869, False: 2.08k]
  ------------------
  354|    869|            ctx.push_indent(span.base_indent - 1);
  355|    869|         }
  356|       |
  357|  2.94k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.94k|         using V = std::remove_cvref_t<T>;
  360|  2.94k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.94k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.94k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.94k|         return true;
  367|  2.95k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   814k|         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|  19.4k|      {
 5311|  19.4k|         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|  19.4k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  19.4k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  19.4k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  19.4k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 19.4k, False: 0]
  ------------------
 5321|  19.4k|            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|  19.4k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  23.7k|      {
 2081|  23.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 23.7k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  23.7k|         yaml::node_preamble_state preamble{};
 2085|  23.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 5.28k, False: 18.4k]
  ------------------
 2086|  23.7k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  5.28k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  18.4k|         std::string str;
 2091|  18.4k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  18.4k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 1.73k, False: 16.7k]
  |  Branch (2093:31): [True: 704, False: 16.0k]
  |  Branch (2093:48): [True: 838, False: 15.2k]
  |  Branch (2093:65): [True: 347, False: 14.8k]
  |  Branch (2093:81): [True: 563, False: 14.2k]
  |  Branch (2093:97): [True: 361, False: 13.9k]
  ------------------
 2094|  13.9k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 676, False: 13.2k]
  |  Branch (2094:29): [True: 271, False: 12.9k]
  |  Branch (2094:44): [True: 311, False: 12.6k]
  ------------------
 2095|  5.80k|            value = true;
 2096|  5.80k|         }
 2097|  12.6k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 3.56k, False: 9.11k]
  |  Branch (2097:37): [True: 691, False: 8.41k]
  |  Branch (2097:55): [True: 614, False: 7.80k]
  |  Branch (2097:73): [True: 565, False: 7.24k]
  |  Branch (2097:88): [True: 5.64k, False: 1.59k]
  |  Branch (2097:103): [True: 311, False: 1.28k]
  ------------------
 2098|  12.5k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 301, False: 979]
  |  Branch (2098:35): [True: 354, False: 625]
  |  Branch (2098:51): [True: 471, False: 154]
  ------------------
 2099|  12.5k|            value = false;
 2100|  12.5k|         }
 2101|    154|         else {
 2102|    154|            ctx.error = error_code::expected_true_or_false;
 2103|    154|         }
 2104|       |
 2105|  18.4k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  18.4k|      }
_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|  23.7k|      {
  466|  23.7k|         skip_inline_ws(it, end);
  467|       |
  468|  23.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 23.7k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  23.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  23.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 23.7k]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|  23.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 23.7k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  23.7k|         skip_inline_ws(it, end);
  486|       |
  487|  23.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 23.7k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  23.7k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.26k, False: 18.4k]
  ------------------
  495|  5.26k|            return true;
  496|  5.26k|         }
  497|       |
  498|  18.4k|         return false;
  499|  23.7k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  23.7k|                                             [](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|  23.7k|      {
  409|  23.7k|         state.has_anchor = false;
  410|  23.7k|         state.anchor_name.clear();
  411|  23.7k|         state.anchor_start = nullptr;
  412|  23.7k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  23.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|  23.7k|            else {
  421|  23.7k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.23k, False: 18.5k]
  ------------------
  422|  23.7k|            }
  423|  23.7k|         }
  424|       |
  425|  23.7k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 18.5k, False: 5.23k]
  |  Branch (425:27): [True: 3.63k, False: 14.8k]
  ------------------
  426|  3.63k|            ++it;
  427|  3.63k|            auto name = parse_anchor_name(it, end);
  428|  3.63k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 3.62k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  3.62k|            skip_inline_ws(it, end);
  433|  3.62k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 23, False: 3.60k]
  ------------------
  434|     23|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     23|                  ctx.error = error_code::unexpected_end;
  436|     23|               }
  437|     23|               return true;
  438|     23|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.60k|            state.has_anchor = true;
  446|  3.60k|            state.anchor_name = std::string(name);
  447|  3.60k|            state.anchor_start = &*it;
  448|  3.60k|         }
  449|       |
  450|  23.7k|         return false;
  451|  23.7k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  23.7k|      {
  301|  23.7k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 23.7k]
  |  Branch (301:27): [True: 18.5k, False: 5.23k]
  ------------------
  302|       |
  303|  5.23k|         ++it; // skip '*'
  304|  5.23k|         auto name = parse_anchor_name(it, end);
  305|  5.23k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 5.22k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  5.22k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.22k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 30, False: 5.19k]
  ------------------
  312|     30|            ctx.error = error_code::syntax_error; // undefined alias
  313|     30|            return true;
  314|     30|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  5.19k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.19k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 856, False: 4.34k]
  ------------------
  322|    856|            return true;
  323|    856|         }
  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.34k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 4.33k]
  ------------------
  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.33k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.33k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.33k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.33k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.33k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.33k|         auto replay_it = span.begin;
  348|  4.33k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.33k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.33k|         ctx.indent_stack.clear();
  353|  4.33k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.06k, False: 3.27k]
  ------------------
  354|  1.06k|            ctx.push_indent(span.base_indent - 1);
  355|  1.06k|         }
  356|       |
  357|  4.33k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.33k|         using V = std::remove_cvref_t<T>;
  360|  4.33k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.33k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.33k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.33k|         return true;
  367|  4.33k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  7.08k|      {
 2467|  7.08k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 7.08k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  7.08k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  7.08k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 12, False: 7.06k]
  ------------------
 2473|     12|            ctx.error = error_code::unexpected_end;
 2474|     12|            return;
 2475|     12|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  7.06k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 2.35k, False: 4.71k]
  ------------------
 2479|  2.35k|            ++it;
 2480|  2.35k|            return;
 2481|  2.35k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  4.71k|         auto start = it;
 2485|  22.1k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 21.8k, False: 375]
  |  Branch (2485:30): [True: 17.4k, False: 4.34k]
  ------------------
 2486|  17.4k|            ++it;
 2487|  17.4k|         }
 2488|       |
 2489|  4.71k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  4.71k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 25, False: 4.69k]
  ------------------
 2491|     25|            ctx.error = error_code::syntax_error;
 2492|     25|         }
 2493|  4.71k|      }
_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|   694k|      {
 5311|   694k|         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|   694k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   694k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   694k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   694k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 694k, False: 0]
  ------------------
 5321|   694k|            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|   694k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|   706k|      {
 4617|   706k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 706k]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|   706k|         yaml::node_preamble_state preamble{};
 4621|   706k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 13.8k, False: 692k]
  ------------------
 4622|   706k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  13.8k|            return;
 4624|       |
 4625|   692k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|   692k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 11, False: 692k]
  ------------------
 4627|     11|            return;
 4628|       |
 4629|   692k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|   692k|         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|   692k|         std::remove_cvref_t<T> preexisting_entries;
 4643|   692k|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 692k]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|   692k|         struct merge_restore_guard
 4648|   692k|         {
 4649|   692k|            std::remove_cvref_t<T>& target;
 4650|   692k|            std::remove_cvref_t<T>& saved;
 4651|   692k|            ~merge_restore_guard()
 4652|   692k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   692k|               for (auto& entry : saved) {
 4656|   692k|                  target.emplace(entry.first, std::move(entry.second));
 4657|   692k|               }
 4658|   692k|            }
 4659|   692k|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|   692k|         const bool treat_as_block_mapping =
 4662|   692k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [Folded, False: 692k]
  |  Branch (4662:48): [True: 0, False: 0]
  |  Branch (4662:62): [True: 0, False: 0]
  ------------------
 4663|       |
 4664|   692k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 425k, False: 267k]
  |  Branch (4664:28): [True: 0, Folded]
  ------------------
 4665|       |            // Flow mapping
 4666|   425k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|   425k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|   425k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 423k, False: 1.49k]
  |  Branch (4670:30): [True: 8.48k, False: 415k]
  ------------------
 4671|  8.48k|               ++it;
 4672|  8.48k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  8.48k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 11, False: 8.47k]
  ------------------
 4674|     11|                  return;
 4675|  8.47k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  8.47k|               return;
 4677|  8.48k|            }
 4678|       |
 4679|  1.43M|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 1.42M, False: 4.05k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  1.42M|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  1.42M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 1.42M, False: 0]
  |  Branch (4683:33): [True: 10.5k, False: 1.41M]
  ------------------
 4684|  10.5k|                  ++it;
 4685|  10.5k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  10.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 12, False: 10.5k]
  ------------------
 4687|     12|                     return;
 4688|  10.5k|                  break;
 4689|  10.5k|               }
 4690|       |
 4691|  1.41M|               bool explicit_flow_key = false;
 4692|  1.41M|               auto explicit_probe = it;
 4693|  1.41M|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  1.41M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 1.41M, False: 0]
  |  Branch (4694:45): [True: 22.1k, False: 1.39M]
  ------------------
 4695|  22.1k|                  const auto after_q = explicit_probe + 1;
 4696|  22.1k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 9, False: 22.1k]
  |  Branch (4696:41): [True: 13.5k, False: 8.67k]
  ------------------
 4697|  14.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 972, False: 7.70k]
  |  Branch (4697:42): [True: 358, False: 7.34k]
  ------------------
 4698|  14.8k|                     explicit_flow_key = true;
 4699|  14.8k|                     it = explicit_probe + 1;
 4700|  14.8k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  14.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 3, False: 14.8k]
  ------------------
 4702|      3|                        return;
 4703|  14.8k|                  }
 4704|  22.1k|               }
 4705|       |               // Parse key
 4706|  1.41M|               key_t key{};
 4707|  1.41M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  1.41M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 14.8k, False: 1.40M]
  |  Branch (4708:44): [True: 14.8k, False: 13]
  |  Branch (4708:58): [True: 875, False: 13.9k]
  |  Branch (4708:72): [True: 5.52k, False: 8.43k]
  |  Branch (4708:86): [True: 608, False: 7.82k]
  ------------------
 4709|  7.00k|                     key.clear();
 4710|  7.00k|                  }
 4711|  1.40M|                  else {
 4712|  1.40M|                     auto key_probe = it;
 4713|  1.40M|                     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.40M|                     bool parse_complex_flow_key = false;
 4718|  1.40M|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 1.40M, False: 13]
  ------------------
 4719|  1.40M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 8.02k, False: 1.40M]
  |  Branch (4719:50): [True: 23.7k, False: 1.37M]
  ------------------
 4720|  31.8k|                           parse_complex_flow_key = true;
 4721|  31.8k|                        }
 4722|  1.37M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 372k, False: 1.00M]
  ------------------
 4723|   372k|                           ++key_probe;
 4724|   372k|                           yaml::parse_anchor_name(key_probe, end);
 4725|   372k|                           yaml::skip_inline_ws(key_probe, end);
 4726|   372k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 372k, False: 73]
  |  Branch (4726:53): [True: 3.12k, False: 368k]
  |  Branch (4726:74): [True: 206k, False: 162k]
  ------------------
 4727|   209k|                              parse_complex_flow_key = true;
 4728|   209k|                           }
 4729|   372k|                        }
 4730|  1.40M|                     }
 4731|       |
 4732|  1.40M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 241k, False: 1.16M]
  ------------------
 4733|   241k|                        glz::generic key_node{};
 4734|   241k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|   241k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 9.41k, False: 232k]
  ------------------
 4736|  9.41k|                           return;
 4737|   232k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 21, False: 232k]
  ------------------
 4738|     21|                           return;
 4739|   232k|                     }
 4740|  1.16M|                     else {
 4741|  1.16M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 4.57k, False: 1.16M]
  ------------------
 4742|  4.57k|                           return;
 4743|  4.57k|                        }
 4744|  1.16M|                     }
 4745|  1.40M|                  }
 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.40M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  1.41M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 17, False: 1.41M]
  ------------------
 4761|     17|                  return;
 4762|       |
 4763|  1.41M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  1.41M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  1.41M|                     val = {};
 4766|  1.41M|                     return true;
 4767|  1.41M|                  }
 4768|  1.41M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  1.41M|                     val = glz::generic{};
 4770|  1.41M|                     return true;
 4771|  1.41M|                  }
 4772|  1.41M|                  else {
 4773|  1.41M|                     static constexpr std::string_view null_value{"null"};
 4774|  1.41M|                     auto null_it = null_value.data();
 4775|  1.41M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  1.41M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  1.41M|                     return !bool(ctx.error);
 4778|  1.41M|                  }
 4779|  1.41M|               };
 4780|       |
 4781|  1.41M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 1.40M, False: 15.7k]
  |  Branch (4781:34): [True: 577k, False: 822k]
  |  Branch (4781:48): [True: 139k, False: 682k]
  ------------------
 4782|   717k|                  val_t val{};
 4783|   717k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 717k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|   717k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|   717k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 139k, False: 577k]
  ------------------
 4789|   139k|                     ++it;
 4790|   139k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|   139k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 182, False: 139k]
  ------------------
 4792|    182|                        return;
 4793|   139k|                     break;
 4794|   139k|                  }
 4795|       |
 4796|   577k|                  ++it; // skip comma
 4797|   577k|                  yaml::skip_ws_and_newlines(it, end);
 4798|   577k|                  continue;
 4799|   717k|               }
 4800|       |
 4801|   698k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 15.7k, False: 682k]
  |  Branch (4801:33): [True: 689, False: 681k]
  ------------------
 4802|  2.45k|                  ctx.error = error_code::syntax_error;
 4803|  2.45k|                  return;
 4804|  2.45k|               }
 4805|   695k|               ++it;
 4806|       |
 4807|   695k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|   695k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 4, False: 695k]
  ------------------
 4809|      4|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|   695k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 681k, False: 14.1k]
  |  Branch (4812:34): [True: 37.5k, False: 643k]
  |  Branch (4812:48): [True: 15.1k, False: 628k]
  ------------------
 4813|  52.6k|                  val_t val{};
 4814|  52.6k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 52.6k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  52.6k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  52.6k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 15.1k, False: 37.5k]
  ------------------
 4820|  15.1k|                     ++it;
 4821|  15.1k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  15.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 5, False: 15.1k]
  ------------------
 4823|      5|                        return;
 4824|  15.1k|                     break;
 4825|  15.1k|                  }
 4826|       |
 4827|  37.5k|                  ++it; // skip comma
 4828|  37.5k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  37.5k|                  continue;
 4830|  52.6k|               }
 4831|       |
 4832|       |               // Parse value
 4833|   642k|               val_t val{};
 4834|   642k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|   642k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 3.02k, False: 639k]
  ------------------
 4836|  3.02k|                  return;
 4837|       |
 4838|   639k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|   639k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|   639k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 625k, False: 14.4k]
  |  Branch (4842:33): [True: 222k, False: 402k]
  ------------------
 4843|   222k|                  ++it;
 4844|   222k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|   222k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 221, False: 222k]
  ------------------
 4846|    221|                     return;
 4847|   222k|                  break;
 4848|   222k|               }
 4849|   417k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 402k, False: 14.4k]
  |  Branch (4849:38): [True: 382k, False: 19.8k]
  ------------------
 4850|   382k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|   382k|                  yaml::skip_ws_and_newlines(it, end);
 4853|   382k|               }
 4854|  34.2k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 19.8k, False: 14.4k]
  |  Branch (4854:39): [True: 9.07k, False: 10.7k]
  |  Branch (4854:54): [True: 10.4k, False: 310]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  19.5k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  19.5k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 19.4k, False: 47]
  |  Branch (4858:36): [True: 4.05k, False: 15.4k]
  ------------------
 4859|  4.05k|                     ++it;
 4860|  4.05k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  4.05k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 3, False: 4.05k]
  ------------------
 4862|      3|                        return;
 4863|  4.05k|                     break;
 4864|  4.05k|                  }
 4865|  15.4k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 15.4k, False: 47]
  |  Branch (4865:36): [True: 15.3k, False: 68]
  ------------------
 4866|  15.3k|                     ++it;
 4867|  15.3k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  15.3k|                     continue;
 4869|  15.3k|                  }
 4870|    115|                  ctx.error = error_code::syntax_error;
 4871|    115|                  return;
 4872|  15.4k|               }
 4873|  14.7k|               else {
 4874|  14.7k|                  ctx.error = error_code::syntax_error;
 4875|  14.7k|                  return;
 4876|  14.7k|               }
 4877|   639k|            }
 4878|   416k|         }
 4879|   267k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   267k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   267k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   267k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   267k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   267k|                        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|   267k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   267k|                           if (ctx.stream_begin) {
 4893|   267k|                              auto is_line_content_start = [&](auto pos) {
 4894|   267k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   267k|                              };
 4896|       |
 4897|   267k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   267k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   267k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   267k|                                 return line != end && *line == ':';
 4901|   267k|                              };
 4902|       |
 4903|   267k|                              if (!is_line_content_start(it) &&
 4904|   267k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   267k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   267k|                                 ctx.error = error_code::syntax_error;
 4907|   267k|                                 return false;
 4908|   267k|                              }
 4909|   267k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   267k|                           }
 4911|   267k|                        }
 4912|       |
 4913|   267k|                        if (*it == '-' &&
 4914|   267k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   267k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   267k|                           ctx.error = error_code::syntax_error;
 4918|   267k|                           return false;
 4919|   267k|                        }
 4920|       |
 4921|   267k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   267k|                           return false;
 4923|   267k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   267k|                        ctx.pop_indent();
 4925|   267k|                     }
 4926|   267k|                     else {
 4927|   267k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   267k|                        if (nested_indent >= 0) {
 4929|   267k|                           yaml::skip_to_content(it, end);
 4930|   267k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   267k|                              ctx.error = error_code::syntax_error;
 4932|   267k|                              return false;
 4933|   267k|                           }
 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|   267k|                           const int32_t value_indent =
 4937|   267k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   267k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   267k|                              return false;
 4940|   267k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   267k|                           ctx.pop_indent();
 4942|   267k|                        }
 4943|   267k|                     }
 4944|   267k|                     return !bool(ctx.error);
 4945|   267k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   267k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   267k|                     ctx.error = error_code::syntax_error;
 4952|   267k|                     return false;
 4953|   267k|                  }
 4954|   267k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   267k|                     ++it; // skip '?'
 4956|   267k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   267k|                     const int32_t explicit_value_indicator_indent =
 4959|   267k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   267k|                     key_t key{};
 4962|   267k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   267k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   267k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   267k|                        };
 4966|       |
 4967|   267k|                        auto key_it = it;
 4968|   267k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   267k|                        auto content = key_it;
 4971|   267k|                        yaml::skip_to_content(content, end);
 4972|   267k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   267k|                        if (content != end && *content == '&') {
 4978|   267k|                           auto anchor_probe = content + 1;
 4979|   267k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   267k|                           if (!anchor_name.empty()) {
 4981|   267k|                              auto after_anchor = anchor_probe;
 4982|   267k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   267k|                              auto value_indicator = after_anchor;
 4985|   267k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   267k|                                 key.clear();
 4987|   267k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   267k|                                 it = value_indicator;
 4989|   267k|                                 handled_anchor_only_empty_key = true;
 4990|   267k|                              }
 4991|   267k|                              else {
 4992|   267k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   267k|                                    yaml::skip_comment(value_indicator, end);
 4994|   267k|                                 }
 4995|   267k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   267k|                                    yaml::skip_newline(value_indicator, end);
 4997|   267k|                                    auto value_line = value_indicator;
 4998|   267k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   267k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   267k|                                       return false;
 5001|   267k|                                    if (value_line != end && *value_line == ':' &&
 5002|   267k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   267k|                                       key.clear();
 5004|   267k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   267k|                                       it = value_line;
 5006|   267k|                                       handled_anchor_only_empty_key = true;
 5007|   267k|                                    }
 5008|   267k|                                    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|   267k|                                       ctx.error = error_code::syntax_error;
 5013|   267k|                                       return false;
 5014|   267k|                                    }
 5015|   267k|                                 }
 5016|   267k|                              }
 5017|   267k|                           }
 5018|   267k|                        }
 5019|       |
 5020|   267k|                        const bool key_content_spans_lines = [&] {
 5021|   267k|                           auto scan = key_it;
 5022|   267k|                           while (scan != content && scan != end) {
 5023|   267k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   267k|                              ++scan;
 5025|   267k|                           }
 5026|   267k|                           return false;
 5027|   267k|                        }();
 5028|       |
 5029|   267k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   267k|                        }
 5032|   267k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   267k|                           key.clear();
 5034|   267k|                           it = content;
 5035|   267k|                        }
 5036|   267k|                        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|   267k|                           auto key_node_it = content;
 5042|   267k|                           auto key_node_end = end;
 5043|   267k|                           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|   267k|                              auto scan = content;
 5048|   267k|                              while (scan != end) {
 5049|   267k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   267k|                                    ++scan;
 5051|   267k|                                 }
 5052|   267k|                                 if (scan == end) {
 5053|   267k|                                    break;
 5054|   267k|                                 }
 5055|       |
 5056|   267k|                                 yaml::skip_newline(scan, end);
 5057|   267k|                                 auto line_start = scan;
 5058|       |
 5059|   267k|                                 int32_t indicator_indent = 0;
 5060|   267k|                                 while (scan != end && *scan == ' ') {
 5061|   267k|                                    ++indicator_indent;
 5062|   267k|                                    ++scan;
 5063|   267k|                                 }
 5064|       |
 5065|   267k|                                 if (scan != end && *scan == ':') {
 5066|   267k|                                    const auto after_colon = scan + 1;
 5067|   267k|                                    if ((after_colon == end ||
 5068|   267k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   267k|                                        indicator_indent <= line_indent) {
 5070|   267k|                                       key_node_end = line_start;
 5071|   267k|                                       break;
 5072|   267k|                                    }
 5073|   267k|                                 }
 5074|   267k|                              }
 5075|   267k|                           }
 5076|       |
 5077|   267k|                           glz::generic key_node{};
 5078|   267k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   267k|                           ctx.explicit_mapping_key_context = true;
 5080|   267k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   267k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   267k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   267k|                              return false;
 5084|   267k|                           it = key_node_it;
 5085|   267k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   267k|                              return false;
 5087|   267k|                        }
 5088|   267k|                     }
 5089|   267k|                     else {
 5090|   267k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   267k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   267k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   267k|                              return false;
 5094|   267k|                        }
 5095|   267k|                     }
 5096|       |
 5097|   267k|                     yaml::skip_inline_ws(it, end);
 5098|   267k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   267k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   267k|                        auto probe = it;
 5103|   267k|                        bool found_value_indicator = false;
 5104|       |
 5105|   267k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   267k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   267k|                           auto value_line = probe;
 5109|   267k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   267k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   267k|                              return false;
 5112|       |
 5113|   267k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   267k|                              probe = value_line;
 5115|   267k|                              continue; // blank line
 5116|   267k|                           }
 5117|   267k|                           if (*value_line == '#') {
 5118|   267k|                              yaml::skip_comment(value_line, end);
 5119|   267k|                              probe = value_line;
 5120|   267k|                              continue; // comment-only line
 5121|   267k|                           }
 5122|   267k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   267k|                              it = value_line;
 5124|   267k|                              found_value_indicator = true;
 5125|   267k|                           }
 5126|   267k|                           break;
 5127|   267k|                        }
 5128|       |
 5129|   267k|                        if (found_value_indicator) {
 5130|   267k|                           yaml::skip_inline_ws(it, end);
 5131|   267k|                        }
 5132|   267k|                     }
 5133|       |
 5134|   267k|                     val_t val{};
 5135|   267k|                     if (it != end && *it == ':') {
 5136|   267k|                        ++it;
 5137|   267k|                        if (it != end && *it == '\t') {
 5138|   267k|                           ctx.error = error_code::syntax_error;
 5139|   267k|                           return false;
 5140|   267k|                        }
 5141|   267k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   267k|                           auto probe = it;
 5143|   267k|                           yaml::skip_newline(probe, end);
 5144|   267k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   267k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   267k|                              ctx.error = error_code::syntax_error;
 5147|   267k|                              return false;
 5148|   267k|                           }
 5149|   267k|                        }
 5150|   267k|                        yaml::skip_inline_ws(it, end);
 5151|   267k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   267k|                           return false;
 5153|   267k|                     }
 5154|       |
 5155|   267k|                     value.emplace(std::move(key), std::move(val));
 5156|   267k|                     return true;
 5157|   267k|                  }
 5158|       |
 5159|   267k|                  key_t key{};
 5160|   267k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   267k|                     auto key_probe = it;
 5162|   267k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   267k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   267k|                     if (complex_flow_key) {
 5165|   267k|                        glz::generic key_node{};
 5166|   267k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   267k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   267k|                           return false;
 5169|   267k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   267k|                           return false;
 5171|   267k|                     }
 5172|   267k|                     else {
 5173|   267k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   267k|                           return false;
 5175|   267k|                        }
 5176|   267k|                     }
 5177|   267k|                  }
 5178|   267k|                  else {
 5179|   267k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   267k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   267k|                        return false;
 5182|   267k|                  }
 5183|       |
 5184|   267k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   267k|                  if (it == end || *it != ':') {
 5187|   267k|                     ctx.error = error_code::syntax_error;
 5188|   267k|                     return false;
 5189|   267k|                  }
 5190|   267k|                  ++it;
 5191|   267k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   267k|                  val_t val{};
 5194|   267k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   267k|                     return false;
 5196|       |
 5197|   267k|                  value.emplace(std::move(key), std::move(val));
 5198|   267k|                  return true;
 5199|   267k|               });
 5200|   267k|         }
 5201|       |
 5202|   663k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|   663k|      }
_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|   706k|      {
  466|   706k|         skip_inline_ws(it, end);
  467|       |
  468|   706k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 706k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|   706k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   706k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 4, False: 706k]
  ------------------
  477|      4|            ctx.error = error_code::syntax_error;
  478|      4|            return true;
  479|      4|         }
  480|   706k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 4, False: 706k]
  ------------------
  481|      4|            ctx.error = error_code::syntax_error;
  482|      4|            return true;
  483|      4|         }
  484|       |
  485|   706k|         skip_inline_ws(it, end);
  486|       |
  487|   706k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 5, False: 706k]
  ------------------
  488|      5|            if constexpr (!AllowEmptyInput) {
  489|      5|               ctx.error = error_code::unexpected_end;
  490|      5|            }
  491|      5|            return true;
  492|      5|         }
  493|       |
  494|   706k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.8k, False: 692k]
  ------------------
  495|  13.8k|            return true;
  496|  13.8k|         }
  497|       |
  498|   692k|         return false;
  499|   706k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|   706k|                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|   706k|      {
  409|   706k|         state.has_anchor = false;
  410|   706k|         state.anchor_name.clear();
  411|   706k|         state.anchor_start = nullptr;
  412|   706k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   706k|         if constexpr (Policy.allow_alias) {
  415|   706k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   706k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 705k, False: 526]
  ------------------
  417|   705k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 13.8k, False: 692k]
  ------------------
  418|   705k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   706k|         }
  424|       |
  425|   706k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 692k, False: 13.8k]
  |  Branch (425:27): [True: 9.03k, False: 683k]
  ------------------
  426|  9.03k|            ++it;
  427|  9.03k|            auto name = parse_anchor_name(it, end);
  428|  9.03k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 9.03k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  9.03k|            skip_inline_ws(it, end);
  433|  9.03k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 9.01k]
  ------------------
  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.01k|            state.has_anchor = true;
  446|  9.01k|            state.anchor_name = std::string(name);
  447|  9.01k|            state.anchor_start = &*it;
  448|  9.01k|         }
  449|       |
  450|   706k|         return false;
  451|   706k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   705k|      {
  301|   705k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 705k]
  |  Branch (301:27): [True: 692k, False: 13.8k]
  ------------------
  302|       |
  303|  13.8k|         ++it; // skip '*'
  304|  13.8k|         auto name = parse_anchor_name(it, end);
  305|  13.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 13.8k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  13.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  13.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 46, False: 13.7k]
  ------------------
  312|     46|            ctx.error = error_code::syntax_error; // undefined alias
  313|     46|            return true;
  314|     46|         }
  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.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  13.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.48k, False: 12.3k]
  ------------------
  322|  1.48k|            return true;
  323|  1.48k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  12.3k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 12.3k]
  ------------------
  329|      8|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      8|            return true;
  331|      8|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 12.3k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  12.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 12.2k]
  ------------------
  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|  12.2k|         auto replay_it = span.begin;
  348|  12.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  12.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  12.2k|         ctx.indent_stack.clear();
  353|  12.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 830, False: 11.4k]
  ------------------
  354|    830|            ctx.push_indent(span.base_indent - 1);
  355|    830|         }
  356|       |
  357|  12.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  12.2k|         using V = std::remove_cvref_t<T>;
  360|  12.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  12.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  12.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  12.2k|         return true;
  367|  12.3k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|   770k|               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|   770k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   770k|                     val = glz::generic{};
 4770|   770k|                     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|   770k|               };
_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|   267k|      {
 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|   267k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 267k]
  ------------------
 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|   267k|         const int32_t parent_indent = ctx.current_indent();
 3722|   267k|         const bool discover_indent = (mapping_indent < 0);
 3723|   267k|         bool first_key = !discover_indent;
 3724|   267k|         bool discovered_first_key_mid_line = false;
 3725|   267k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|   652k|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 418k, False: 233k]
  ------------------
 3728|   418k|            auto line_start = it;
 3729|   418k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 418k]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|   604k|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 598k, False: 6.11k]
  ------------------
 3733|   598k|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 13.1k, False: 585k]
  ------------------
 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|   585k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 26.8k, False: 558k]
  |  Branch (3739:40): [True: 125k, False: 432k]
  ------------------
 3740|   152k|                  skip_newline(it, end);
 3741|   152k|                  first_key = false;
 3742|   152k|                  line_indent = 0;
 3743|   152k|               }
 3744|   432k|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 74.0k, False: 358k]
  ------------------
 3745|  74.0k|                  line_start = it;
 3746|  74.0k|                  line_indent = 0;
 3747|   345k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 343k, False: 2.51k]
  |  Branch (3747:39): [True: 271k, False: 71.5k]
  ------------------
 3748|   271k|                     ++line_indent;
 3749|   271k|                     ++it;
 3750|   271k|                  }
 3751|       |
 3752|  74.0k|                  bool saw_tab = false;
 3753|  76.0k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 72.9k, False: 3.04k]
  |  Branch (3753:40): [True: 484, False: 72.5k]
  |  Branch (3753:54): [True: 1.50k, False: 70.9k]
  ------------------
 3754|  1.99k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 1.08k, False: 911]
  |  Branch (3754:43): [True: 911, False: 0]
  ------------------
 3755|  1.99k|                     ++it;
 3756|  1.99k|                  }
 3757|       |
 3758|  74.0k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 3.04k, False: 70.9k]
  |  Branch (3758:36): [True: 2.78k, False: 68.2k]
  |  Branch (3758:51): [True: 1.41k, False: 66.8k]
  |  Branch (3758:66): [True: 2.61k, False: 64.1k]
  ------------------
 3759|  9.85k|                     first_key = false;
 3760|  9.85k|                     line_indent = 0;
 3761|  9.85k|                     continue; // Blank or comment line
 3762|  9.85k|                  }
 3763|       |
 3764|  64.1k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 26, False: 64.1k]
  ------------------
 3765|     26|                     ctx.error = error_code::syntax_error;
 3766|     26|                     return;
 3767|     26|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|  64.1k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 62.5k, False: 1.57k]
  |  Branch (3770:46): [True: 383, False: 62.2k]
  ------------------
 3771|    383|                     it = line_start;
 3772|    383|                     return;
 3773|    383|                  }
 3774|       |
 3775|  63.7k|                  first_key = false;
 3776|  63.7k|                  break; // Found content
 3777|  64.1k|               }
 3778|   358k|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 10.6k, False: 348k]
  ------------------
 3779|  10.6k|                  line_start = it;
 3780|  24.2k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 23.7k, False: 513]
  |  Branch (3780:40): [True: 1.28k, False: 22.4k]
  |  Branch (3780:54): [True: 12.3k, False: 10.1k]
  ------------------
 3781|  10.6k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 513, False: 10.1k]
  |  Branch (3781:36): [True: 1.07k, False: 9.04k]
  |  Branch (3781:51): [True: 8.69k, False: 351]
  |  Branch (3781:66): [True: 314, False: 37]
  ------------------
 3782|  10.5k|                     first_key = false;
 3783|  10.5k|                     line_indent = 0;
 3784|  10.5k|                     continue; // Blank or comment-only line with tab indentation
 3785|  10.5k|                  }
 3786|     37|                  ctx.error = error_code::syntax_error;
 3787|     37|                  return;
 3788|  10.6k|               }
 3789|   348k|               else {
 3790|   348k|                  line_start = it;
 3791|   348k|                  break; // Content at column 0
 3792|   348k|               }
 3793|   598k|            }
 3794|       |
 3795|   418k|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 6.11k, False: 412k]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|   412k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 1.64k, False: 410k]
  |  Branch (3799:45): [True: 1.21k, False: 409k]
  ------------------
 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|   409k|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 409k, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|   409k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 409k, False: 0]
  |  Branch (3806:39): [True: 142k, False: 266k]
  |  Branch (3806:62): [True: 17.7k, False: 124k]
  |  Branch (3806:84): [True: 10.9k, False: 6.77k]
  ------------------
 3807|  10.9k|                  it = line_start;
 3808|  10.9k|                  return;
 3809|  10.9k|               }
 3810|   398k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 131k, False: 266k]
  |  Branch (3810:43): [True: 263, False: 131k]
  ------------------
 3811|    263|                  it = line_start;
 3812|    263|                  return;
 3813|    263|               }
 3814|   398k|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|   398k|            bool established_mapping_indent_this_line = false;
 3818|   398k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 266k, False: 131k]
  ------------------
 3819|   266k|               mapping_indent = line_indent;
 3820|   266k|               established_mapping_indent_this_line = true;
 3821|   266k|               discovered_first_key_visual_indent = line_indent;
 3822|   266k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   266k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 266k, False: 0]
  |  Branch (3823:43): [True: 266k, False: 0]
  ------------------
 3824|   266k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   266k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 103, False: 266k]
  ------------------
 3826|    103|                        ctx.error = error_code::syntax_error;
 3827|    103|                        return;
 3828|    103|                     }
 3829|       |
 3830|   266k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   266k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 265k, False: 1.57k]
  |  Branch (3831:49): [True: 211k, False: 53.7k]
  ------------------
 3832|   211k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   211k|                     }
 3834|   266k|                  }
 3835|   266k|               }
 3836|   266k|            }
 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|   398k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 397k, False: 103]
  |  Branch (3840:36): [True: 397k, False: 0]
  |  Branch (3840:59): [True: 131k, False: 266k]
  ------------------
 3841|   131k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 73.2k, False: 57.8k]
  ------------------
 3842|  73.2k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 72.9k, False: 242]
  |  Branch (3842:43): [True: 31.3k, False: 41.6k]
  ------------------
 3843|  31.3k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 27, False: 31.3k]
  ------------------
 3844|     27|                     ctx.error = error_code::syntax_error;
 3845|     27|                     return;
 3846|     27|                  }
 3847|  31.3k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 957, False: 30.3k]
  ------------------
 3848|    957|                     it = line_start;
 3849|    957|                     return;
 3850|    957|                  }
 3851|  31.3k|               }
 3852|  41.8k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 270, False: 41.5k]
  ------------------
 3853|    270|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 20, 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: 2, False: 246]
  ------------------
 3855|     24|                  ctx.error = error_code::syntax_error;
 3856|     24|                  return;
 3857|     24|               }
 3858|  73.2k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|   397k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 397k]
  |  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|   397k|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 397k]
  ------------------
 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|   397k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 103, False: 396k]
  |  Branch (3876:32): [True: 0, False: 396k]
  ------------------
 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|   397k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 127k, False: 269k]
  |  Branch (3885:53): [True: 40.6k, False: 87.0k]
  |  Branch (3885:94): [True: 14.7k, False: 25.8k]
  ------------------
 3886|  14.7k|               const auto after_colon = it + 1;
 3887|  14.7k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 13.2k, False: 1.46k]
  ------------------
 3888|  14.7k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 360, False: 14.3k]
  |  Branch (3888:43): [True: 13.6k, False: 724]
  ------------------
 3889|  14.0k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 840, False: 13.1k]
  ------------------
 3890|    840|                  it = line_start;
 3891|    840|                  return;
 3892|    840|               }
 3893|  14.7k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|   396k|            int32_t effective_line_indent = line_indent;
 3897|   396k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 396k, False: 103]
  |  Branch (3897:36): [True: 266k, False: 129k]
  ------------------
 3898|   266k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 211k, False: 55.2k]
  ------------------
 3899|   211k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 151k, False: 60.4k]
  |  Branch (3899:52): [True: 92.6k, 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|   118k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   118k|            }
 3912|       |
 3913|   396k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 11.0k, False: 385k]
  ------------------
 3914|  11.0k|               return;
 3915|  11.0k|            }
 3916|   385k|            first_key = false;
 3917|       |
 3918|   385k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 385k]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|   385k|            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|   385k|               auto flow_end = it;
 3925|   385k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|   385k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 23, False: 385k]
  ------------------
 3927|     23|                  return;
 3928|   385k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 319k, False: 65.5k]
  |  Branch (3928:40): [True: 129k, False: 190k]
  |  Branch (3928:60): [True: 4.58k, False: 185k]
  |  Branch (3928:80): [True: 39.8k, False: 145k]
  ------------------
 3929|   173k|                  it = flow_end;
 3930|   173k|                  return;
 3931|   173k|               }
 3932|   385k|            }
 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|   385k|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 157k, False: 227k]
  ------------------
 3938|   157k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 34.5k, False: 123k]
  |  Branch (3938:34): [True: 1.30k, False: 121k]
  ------------------
 3939|  35.8k|                  auto peek = it;
 3940|  35.8k|                  skip_inline_ws(peek, end);
 3941|  35.8k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 34.0k, False: 1.86k]
  |  Branch (3941:38): [True: 32.5k, False: 1.46k]
  |  Branch (3941:55): [True: 31.5k, False: 971]
  |  Branch (3941:72): [True: 29.9k, False: 1.59k]
  ------------------
 3942|  29.9k|                     continue; // At leading indent of new line
 3943|  29.9k|                  }
 3944|  35.8k|               }
 3945|   127k|               skip_inline_ws(it, end);
 3946|   127k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 125k, False: 1.86k]
  |  Branch (3946:33): [True: 6.68k, False: 119k]
  ------------------
 3947|  6.68k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  6.68k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 6.68k, False: 0]
  ------------------
 3949|  6.68k|                        const char prev = *(it - 1);
 3950|  6.68k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 2.74k, False: 3.94k]
  |  Branch (3950:44): [True: 1.75k, False: 985]
  |  Branch (3950:60): [True: 824, False: 933]
  |  Branch (3950:76): [True: 6, False: 818]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  6.68k|                     }
 3955|  6.68k|                  }
 3956|  6.68k|               }
 3957|  6.67k|               skip_comment(it, end);
 3958|   127k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 125k, False: 2.14k]
  |  Branch (3958:34): [True: 25.0k, False: 100k]
  |  Branch (3958:49): [True: 42.4k, False: 58.1k]
  ------------------
 3959|  67.4k|                  skip_newline(it, end);
 3960|  67.4k|               }
 3961|  60.3k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 58.1k, False: 2.14k]
  ------------------
 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|  58.1k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|  58.1k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 112, False: 58.0k]
  ------------------
 3968|    112|                        ctx.error = error_code::syntax_error;
 3969|    112|                        return;
 3970|    112|                     }
 3971|  58.1k|                  }
 3972|  58.1k|               }
 3973|   127k|            }
 3974|   385k|         }
 3975|   267k|      }
_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|   396k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   396k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   396k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   396k|                        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|   396k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   396k|                           if (ctx.stream_begin) {
 4893|   396k|                              auto is_line_content_start = [&](auto pos) {
 4894|   396k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   396k|                              };
 4896|       |
 4897|   396k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   396k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   396k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   396k|                                 return line != end && *line == ':';
 4901|   396k|                              };
 4902|       |
 4903|   396k|                              if (!is_line_content_start(it) &&
 4904|   396k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   396k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   396k|                                 ctx.error = error_code::syntax_error;
 4907|   396k|                                 return false;
 4908|   396k|                              }
 4909|   396k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   396k|                           }
 4911|   396k|                        }
 4912|       |
 4913|   396k|                        if (*it == '-' &&
 4914|   396k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   396k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   396k|                           ctx.error = error_code::syntax_error;
 4918|   396k|                           return false;
 4919|   396k|                        }
 4920|       |
 4921|   396k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   396k|                           return false;
 4923|   396k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   396k|                        ctx.pop_indent();
 4925|   396k|                     }
 4926|   396k|                     else {
 4927|   396k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   396k|                        if (nested_indent >= 0) {
 4929|   396k|                           yaml::skip_to_content(it, end);
 4930|   396k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   396k|                              ctx.error = error_code::syntax_error;
 4932|   396k|                              return false;
 4933|   396k|                           }
 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|   396k|                           const int32_t value_indent =
 4937|   396k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   396k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   396k|                              return false;
 4940|   396k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   396k|                           ctx.pop_indent();
 4942|   396k|                        }
 4943|   396k|                     }
 4944|   396k|                     return !bool(ctx.error);
 4945|   396k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   396k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 158k, False: 237k]
  |  Branch (4950:37): [True: 157k, False: 437]
  |  Branch (4950:58): [True: 2, False: 157k]
  ------------------
 4951|      2|                     ctx.error = error_code::syntax_error;
 4952|      2|                     return false;
 4953|      2|                  }
 4954|   396k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 158k, False: 237k]
  |  Branch (4954:38): [True: 437, False: 157k]
  |  Branch (4954:57): [True: 43.7k, False: 114k]
  |  Branch (4954:77): [True: 64.6k, False: 49.3k]
  |  Branch (4954:98): [True: 41.7k, False: 7.66k]
  ------------------
 4955|   150k|                     ++it; // skip '?'
 4956|   150k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   150k|                     const int32_t explicit_value_indicator_indent =
 4959|   150k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 109k, False: 41.0k]
  ------------------
 4960|       |
 4961|   150k|                     key_t key{};
 4962|   150k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   150k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   150k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   150k|                        };
 4966|       |
 4967|   150k|                        auto key_it = it;
 4968|   150k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   150k|                        auto content = key_it;
 4971|   150k|                        yaml::skip_to_content(content, end);
 4972|   150k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   150k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 147k, False: 3.40k]
  |  Branch (4977:47): [True: 41.9k, False: 105k]
  ------------------
 4978|  41.9k|                           auto anchor_probe = content + 1;
 4979|  41.9k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  41.9k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 41.9k, False: 15]
  ------------------
 4981|  41.9k|                              auto after_anchor = anchor_probe;
 4982|  41.9k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  41.9k|                              auto value_indicator = after_anchor;
 4985|  41.9k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 38.5k, False: 3.38k]
  |  Branch (4985:61): [True: 2.50k, False: 36.0k]
  ------------------
 4986|  2.50k|                                 key.clear();
 4987|  2.50k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  2.50k|                                 it = value_indicator;
 4989|  2.50k|                                 handled_anchor_only_empty_key = true;
 4990|  2.50k|                              }
 4991|  39.4k|                              else {
 4992|  39.4k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 36.0k, False: 3.38k]
  |  Branch (4992:64): [True: 2.08k, False: 33.9k]
  ------------------
 4993|  2.08k|                                    yaml::skip_comment(value_indicator, end);
 4994|  2.08k|                                 }
 4995|  39.4k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 35.8k, False: 3.56k]
  |  Branch (4995:65): [True: 4.84k, False: 30.9k]
  |  Branch (4995:93): [True: 13.8k, False: 17.1k]
  ------------------
 4996|  18.6k|                                    yaml::skip_newline(value_indicator, end);
 4997|  18.6k|                                    auto value_line = value_indicator;
 4998|  18.6k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  18.6k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 4, False: 18.6k]
  ------------------
 5000|      4|                                       return false;
 5001|  18.6k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 17.5k, False: 1.10k]
  |  Branch (5001:62): [True: 1.65k, False: 15.9k]
  ------------------
 5002|  1.65k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 1.64k, False: 7]
  ------------------
 5003|  1.64k|                                       key.clear();
 5004|  1.64k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  1.64k|                                       it = value_line;
 5006|  1.64k|                                       handled_anchor_only_empty_key = true;
 5007|  1.64k|                                    }
 5008|  17.0k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 15.9k, False: 1.10k]
  |  Branch (5008:67): [True: 7, False: 15.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|      7|                                       ctx.error = error_code::syntax_error;
 5013|      7|                                       return false;
 5014|      7|                                    }
 5015|  18.6k|                                 }
 5016|  39.4k|                              }
 5017|  41.9k|                           }
 5018|  41.9k|                        }
 5019|       |
 5020|   150k|                        const bool key_content_spans_lines = [&] {
 5021|   150k|                           auto scan = key_it;
 5022|   150k|                           while (scan != content && scan != end) {
 5023|   150k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   150k|                              ++scan;
 5025|   150k|                           }
 5026|   150k|                           return false;
 5027|   150k|                        }();
 5028|       |
 5029|   150k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 4.14k, False: 146k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  4.14k|                        }
 5032|   146k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 3.40k, False: 142k]
  |  Branch (5032:53): [True: 14.1k, False: 128k]
  |  Branch (5032:72): [True: 13.2k, False: 915]
  ------------------
 5033|  16.6k|                           key.clear();
 5034|  16.6k|                           it = content;
 5035|  16.6k|                        }
 5036|   129k|                        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|   129k|                           auto key_node_it = content;
 5042|   129k|                           auto key_node_end = end;
 5043|   129k|                           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|   129k|                              auto scan = content;
 5048|  1.10M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 1.09M, False: 16.0k]
  ------------------
 5049|  71.5M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 71.4M, False: 76.4k]
  |  Branch (5049:56): [True: 71.0M, False: 402k]
  |  Branch (5049:73): [True: 70.4M, False: 614k]
  ------------------
 5050|  70.4M|                                    ++scan;
 5051|  70.4M|                                 }
 5052|  1.09M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 76.4k, False: 1.01M]
  ------------------
 5053|  76.4k|                                    break;
 5054|  76.4k|                                 }
 5055|       |
 5056|  1.01M|                                 yaml::skip_newline(scan, end);
 5057|  1.01M|                                 auto line_start = scan;
 5058|       |
 5059|  1.01M|                                 int32_t indicator_indent = 0;
 5060|  1.71M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 1.70M, False: 16.0k]
  |  Branch (5060:56): [True: 700k, False: 1.00M]
  ------------------
 5061|   700k|                                    ++indicator_indent;
 5062|   700k|                                    ++scan;
 5063|   700k|                                 }
 5064|       |
 5065|  1.01M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 1.00M, False: 16.0k]
  |  Branch (5065:53): [True: 82.9k, False: 917k]
  ------------------
 5066|  82.9k|                                    const auto after_colon = scan + 1;
 5067|  82.9k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 1.03k, False: 81.9k]
  ------------------
 5068|  81.9k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 69.0k, False: 12.8k]
  ------------------
 5069|  70.0k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 37.1k, False: 32.8k]
  ------------------
 5070|  37.1k|                                       key_node_end = line_start;
 5071|  37.1k|                                       break;
 5072|  37.1k|                                    }
 5073|  82.9k|                                 }
 5074|  1.01M|                              }
 5075|   129k|                           }
 5076|       |
 5077|   129k|                           glz::generic key_node{};
 5078|   129k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   129k|                           ctx.explicit_mapping_key_context = true;
 5080|   129k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   129k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   129k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 1.25k, False: 128k]
  ------------------
 5083|  1.25k|                              return false;
 5084|   128k|                           it = key_node_it;
 5085|   128k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 7, False: 128k]
  ------------------
 5086|      7|                              return false;
 5087|   128k|                        }
 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|   149k|                     yaml::skip_inline_ws(it, end);
 5098|   150k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   150k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 126k, False: 23.6k]
  |  Branch (5101:40): [True: 10.1k, False: 116k]
  |  Branch (5101:55): [True: 24.3k, False: 92.3k]
  ------------------
 5102|  34.5k|                        auto probe = it;
 5103|  34.5k|                        bool found_value_indicator = false;
 5104|       |
 5105|  47.3k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 43.1k, False: 4.22k]
  |  Branch (5105:49): [True: 13.6k, False: 29.5k]
  |  Branch (5105:67): [True: 29.5k, False: 1]
  ------------------
 5106|  43.1k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|  43.1k|                           auto value_line = probe;
 5109|  43.1k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|  43.1k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 2, False: 43.1k]
  ------------------
 5111|      2|                              return false;
 5112|       |
 5113|  43.1k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 3.87k, False: 39.2k]
  |  Branch (5113:53): [True: 1.68k, False: 37.5k]
  |  Branch (5113:76): [True: 3.50k, False: 34.0k]
  ------------------
 5114|  9.06k|                              probe = value_line;
 5115|  9.06k|                              continue; // blank line
 5116|  9.06k|                           }
 5117|  34.0k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 3.75k, False: 30.3k]
  ------------------
 5118|  3.75k|                              yaml::skip_comment(value_line, end);
 5119|  3.75k|                              probe = value_line;
 5120|  3.75k|                              continue; // comment-only line
 5121|  3.75k|                           }
 5122|  30.3k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 15.2k, False: 15.0k]
  |  Branch (5122:54): [True: 4.74k, False: 10.4k]
  ------------------
 5123|  4.74k|                              it = value_line;
 5124|  4.74k|                              found_value_indicator = true;
 5125|  4.74k|                           }
 5126|  30.3k|                           break;
 5127|  34.0k|                        }
 5128|       |
 5129|  34.5k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 4.74k, False: 29.7k]
  ------------------
 5130|  4.74k|                           yaml::skip_inline_ws(it, end);
 5131|  4.74k|                        }
 5132|  34.5k|                     }
 5133|       |
 5134|   150k|                     val_t val{};
 5135|   150k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 126k, False: 23.6k]
  |  Branch (5135:39): [True: 51.2k, False: 75.6k]
  ------------------
 5136|  51.2k|                        ++it;
 5137|  51.2k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 50.0k, False: 1.23k]
  |  Branch (5137:42): [True: 3, False: 50.0k]
  ------------------
 5138|      3|                           ctx.error = error_code::syntax_error;
 5139|      3|                           return false;
 5140|      3|                        }
 5141|  51.2k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 50.0k, False: 1.23k]
  |  Branch (5141:43): [True: 3.56k, False: 46.4k]
  |  Branch (5141:58): [True: 21.0k, False: 25.3k]
  ------------------
 5142|  24.6k|                           auto probe = it;
 5143|  24.6k|                           yaml::skip_newline(probe, end);
 5144|  37.9k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 36.0k, False: 1.82k]
  |  Branch (5144:51): [True: 13.2k, False: 22.8k]
  ------------------
 5145|  24.6k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 22.8k, False: 1.82k]
  |  Branch (5145:48): [True: 7.43k, False: 15.3k]
  |  Branch (5145:65): [True: 7.15k, False: 287]
  |  Branch (5145:89): [True: 2, False: 7.14k]
  ------------------
 5146|      2|                              ctx.error = error_code::syntax_error;
 5147|      2|                              return false;
 5148|      2|                           }
 5149|  24.6k|                        }
 5150|  51.2k|                        yaml::skip_inline_ws(it, end);
 5151|  51.2k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 239, False: 51.0k]
  ------------------
 5152|    239|                           return false;
 5153|  51.2k|                     }
 5154|       |
 5155|   150k|                     value.emplace(std::move(key), std::move(val));
 5156|   150k|                     return true;
 5157|   150k|                  }
 5158|       |
 5159|   245k|                  key_t key{};
 5160|   245k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   245k|                     auto key_probe = it;
 5162|   245k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   245k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 245k, False: 0]
  |  Branch (5163:74): [True: 1.16k, False: 244k]
  |  Branch (5163:95): [True: 824, False: 243k]
  ------------------
 5164|   245k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 1.99k, False: 243k]
  ------------------
 5165|  1.99k|                        glz::generic key_node{};
 5166|  1.99k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  1.99k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 730, False: 1.26k]
  ------------------
 5168|    730|                           return false;
 5169|  1.26k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 2, False: 1.25k]
  ------------------
 5170|      2|                           return false;
 5171|  1.26k|                     }
 5172|   243k|                     else {
 5173|   243k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 400, False: 243k]
  ------------------
 5174|    400|                           return false;
 5175|    400|                        }
 5176|   243k|                     }
 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|   244k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   245k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 1.31k, False: 244k]
  |  Branch (5186:36): [True: 187, False: 244k]
  ------------------
 5187|    369|                     ctx.error = error_code::syntax_error;
 5188|    369|                     return false;
 5189|    369|                  }
 5190|   245k|                  ++it;
 5191|   245k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   245k|                  val_t val{};
 5194|   245k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 8.01k, False: 237k]
  ------------------
 5195|  8.01k|                     return false;
 5196|       |
 5197|   237k|                  value.emplace(std::move(key), std::move(val));
 5198|   237k|                  return true;
 5199|   245k|               });
_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|   150k|                        const bool key_content_spans_lines = [&] {
 5021|   150k|                           auto scan = key_it;
 5022|   159k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 118k, False: 41.1k]
  |  Branch (5022:54): [True: 118k, False: 0]
  ------------------
 5023|   118k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 66.3k, False: 52.3k]
  |  Branch (5023:52): [True: 43.0k, False: 9.28k]
  ------------------
 5024|  9.28k|                              ++scan;
 5025|  9.28k|                           }
 5026|  41.1k|                           return false;
 5027|   150k|                        }();
_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|   128k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   128k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   128k|                        };
_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|   295k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   295k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 290k, False: 5.21k]
  |  Branch (4884:39): [True: 207k, False: 82.4k]
  ------------------
 4885|   207k|                        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|   207k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   207k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 207k, False: 0]
  ------------------
 4893|   207k|                              auto is_line_content_start = [&](auto pos) {
 4894|   207k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   207k|                              };
 4896|       |
 4897|   207k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   207k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   207k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   207k|                                 return line != end && *line == ':';
 4901|   207k|                              };
 4902|       |
 4903|   207k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 207k, False: 0]
  ------------------
 4904|   207k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 14.3k, False: 193k]
  ------------------
 4905|  14.3k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 581, False: 13.7k]
  ------------------
 4906|    581|                                 ctx.error = error_code::syntax_error;
 4907|    581|                                 return false;
 4908|    581|                              }
 4909|   207k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   207k|                           }
 4911|   207k|                        }
 4912|       |
 4913|   207k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 4.76k, False: 202k]
  ------------------
 4914|  4.76k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 285, False: 4.48k]
  |  Branch (4914:49): [True: 799, False: 3.68k]
  ------------------
 4915|  1.08k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 13, False: 1.07k]
  ------------------
 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|   207k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 207k]
  ------------------
 4922|      0|                           return false;
 4923|   207k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   207k|                        ctx.pop_indent();
 4925|   207k|                     }
 4926|  87.6k|                     else {
 4927|  87.6k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  87.6k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 22.6k, False: 65.0k]
  ------------------
 4929|  22.6k|                           yaml::skip_to_content(it, end);
 4930|  22.6k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 22.6k, False: 0]
  |  Branch (4930:45): [True: 0, False: 22.6k]
  |  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|  22.6k|                           const int32_t value_indent =
 4937|  22.6k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 22.6k]
  ------------------
 4938|  22.6k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 22.6k]
  ------------------
 4939|      0|                              return false;
 4940|  22.6k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  22.6k|                           ctx.pop_indent();
 4942|  22.6k|                        }
 4943|  87.6k|                     }
 4944|   295k|                     return !bool(ctx.error);
 4945|   295k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4893|   207k|                              auto is_line_content_start = [&](auto pos) {
 4894|   207k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   207k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4897|   221k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   221k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   422k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 422k, False: 0]
  |  Branch (4899:57): [True: 201k, False: 221k]
  |  Branch (4899:73): [True: 509, False: 221k]
  ------------------
 4900|   221k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 221k, False: 0]
  |  Branch (4900:56): [True: 133k, False: 88.1k]
  ------------------
 4901|   221k|                              };
_ZN3glz4yaml26detect_nested_value_indentINS0_12yaml_contextEPKcS4_EEiRT_RT0_T1_i:
 3496|  1.99M|      {
 3497|  1.99M|         skip_ws_and_comment(it, end);
 3498|  1.99M|         if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3498:14): [True: 122k, False: 1.87M]
  |  Branch (3498:28): [True: 1.38M, False: 493k]
  |  Branch (3498:43): [True: 170, False: 1.38M]
  ------------------
 3499|   122k|            return -1;
 3500|   122k|         }
 3501|  1.87M|         skip_newline(it, end);
 3502|  1.87M|         auto content_start = it;
 3503|       |
 3504|       |         // Peek ahead to find the first content line (skip blank/comment lines)
 3505|  1.87M|         auto peek = it;
 3506|  2.33M|         while (peek != end) {
  ------------------
  |  Branch (3506:17): [True: 2.22M, False: 111k]
  ------------------
 3507|  2.22M|            if (*peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3507:17): [True: 75.1k, False: 2.15M]
  |  Branch (3507:34): [True: 167k, False: 1.98M]
  ------------------
 3508|   242k|               skip_newline(peek, end);
 3509|   242k|            }
 3510|  1.98M|            else if (*peek == '#') {
  ------------------
  |  Branch (3510:22): [True: 81.4k, False: 1.90M]
  ------------------
 3511|  81.4k|               skip_comment(peek, end);
 3512|  81.4k|            }
 3513|  1.90M|            else if (*peek == ' ') {
  ------------------
  |  Branch (3513:22): [True: 667k, False: 1.23M]
  ------------------
 3514|   667k|               auto line_start = peek;
 3515|  3.87M|               while (peek != end && *peek == ' ') ++peek;
  ------------------
  |  Branch (3515:23): [True: 3.86M, False: 16.1k]
  |  Branch (3515:38): [True: 3.21M, False: 650k]
  ------------------
 3516|   667k|               if (peek == end || *peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3516:20): [True: 16.1k, False: 650k]
  |  Branch (3516:35): [True: 16.3k, False: 634k]
  |  Branch (3516:52): [True: 14.4k, False: 620k]
  ------------------
 3517|  47.0k|                  continue; // blank line with trailing spaces
 3518|  47.0k|               }
 3519|   620k|               if (*peek == '#') {
  ------------------
  |  Branch (3519:20): [True: 17.8k, False: 602k]
  ------------------
 3520|  17.8k|                  skip_comment(peek, end);
 3521|  17.8k|                  continue; // comment-only line
 3522|  17.8k|               }
 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|   602k|               {
 3533|   602k|                  auto prop = peek;
 3534|   602k|                  bool saw_property = false;
 3535|   814k|                  while (prop != end) {
  ------------------
  |  Branch (3535:26): [True: 813k, False: 1.10k]
  ------------------
 3536|   813k|                     if (*prop == '!') {
  ------------------
  |  Branch (3536:26): [True: 19.4k, False: 793k]
  ------------------
 3537|  19.4k|                        const auto tag = parse_yaml_tag(prop, end, ctx);
 3538|  19.4k|                        if (tag == yaml_tag::unknown) break;
  ------------------
  |  Branch (3538:29): [True: 314, False: 19.1k]
  ------------------
 3539|  19.1k|                        saw_property = true;
 3540|  19.1k|                        skip_inline_ws(prop, end);
 3541|  19.1k|                        continue;
 3542|  19.4k|                     }
 3543|   793k|                     if (*prop == '&') {
  ------------------
  |  Branch (3543:26): [True: 193k, False: 600k]
  ------------------
 3544|   193k|                        ++prop;
 3545|   193k|                        auto aname = parse_anchor_name(prop, end);
 3546|   193k|                        if (aname.empty()) break;
  ------------------
  |  Branch (3546:29): [True: 830, False: 192k]
  ------------------
 3547|   192k|                        saw_property = true;
 3548|   192k|                        skip_inline_ws(prop, end);
 3549|   192k|                        continue;
 3550|   193k|                     }
 3551|   600k|                     break;
 3552|   793k|                  }
 3553|   602k|                  if (saw_property) {
  ------------------
  |  Branch (3553:23): [True: 96.2k, False: 506k]
  ------------------
 3554|  96.2k|                     auto tail = prop;
 3555|  96.2k|                     skip_inline_ws(tail, end);
 3556|  96.2k|                     if (tail == end || *tail == '\n' || *tail == '\r' || *tail == '#') {
  ------------------
  |  Branch (3556:26): [True: 1.33k, False: 94.9k]
  |  Branch (3556:41): [True: 15.6k, False: 79.2k]
  |  Branch (3556:58): [True: 57.7k, False: 21.4k]
  |  Branch (3556:75): [True: 1.69k, False: 19.7k]
  ------------------
 3557|  76.4k|                        if (tail != end && *tail == '#') {
  ------------------
  |  Branch (3557:29): [True: 75.1k, False: 1.33k]
  |  Branch (3557:44): [True: 1.69k, False: 73.4k]
  ------------------
 3558|  1.69k|                           skip_comment(tail, end);
 3559|  1.69k|                        }
 3560|  76.4k|                        if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (3560:29): [True: 74.8k, False: 1.56k]
  |  Branch (3560:45): [True: 15.9k, False: 58.9k]
  |  Branch (3560:62): [True: 58.4k, False: 418]
  ------------------
 3561|  74.4k|                           skip_newline(tail, end);
 3562|  74.4k|                        }
 3563|  76.4k|                        peek = tail;
 3564|  76.4k|                        continue;
 3565|  76.4k|                     }
 3566|  96.2k|                  }
 3567|   602k|               }
 3568|   525k|               peek = line_start; // content found, restore to measure properly
 3569|   525k|               break;
 3570|   602k|            }
 3571|  1.23M|            else {
 3572|  1.23M|               break; // content at column 0
 3573|  1.23M|            }
 3574|  2.22M|         }
 3575|       |
 3576|       |         // Measure indent of the content line
 3577|  1.87M|         int32_t content_indent = measure_indent<false>(peek, end, ctx);
 3578|  1.87M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3578:14): [True: 234, False: 1.87M]
  ------------------
 3579|    234|            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.87M|         if (peek != end && *peek == '\t') {
  ------------------
  |  Branch (3583:14): [True: 1.76M, False: 111k]
  |  Branch (3583:29): [True: 15.6k, False: 1.74M]
  ------------------
 3584|  15.6k|            auto probe = peek;
 3585|  53.2k|            while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (3585:20): [True: 52.9k, False: 282]
  |  Branch (3585:37): [True: 4.80k, False: 48.1k]
  |  Branch (3585:54): [True: 32.7k, False: 15.4k]
  ------------------
 3586|  15.6k|            if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (3586:17): [True: 15.4k, False: 282]
  |  Branch (3586:33): [True: 14.1k, False: 1.23k]
  |  Branch (3586:51): [True: 13.2k, False: 922]
  |  Branch (3586:69): [True: 8.28k, False: 4.98k]
  ------------------
 3587|  8.28k|               const bool looks_sequence_entry =
 3588|  8.28k|                  (*probe == '-') &&
  ------------------
  |  Branch (3588:19): [True: 314, False: 7.96k]
  ------------------
 3589|    314|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3589:20): [True: 6, False: 308]
  |  Branch (3589:42): [True: 4, False: 304]
  ------------------
 3590|  8.28k|               const bool looks_explicit_entry =
 3591|  8.28k|                  (*probe == '?' || *probe == ':') &&
  ------------------
  |  Branch (3591:20): [True: 1.87k, False: 6.41k]
  |  Branch (3591:37): [True: 506, False: 5.90k]
  ------------------
 3592|  2.37k|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3592:20): [True: 24, False: 2.35k]
  |  Branch (3592:42): [True: 8, False: 2.34k]
  ------------------
 3593|  8.28k|               bool looks_mapping_key = false;
 3594|  8.28k|               auto scan = probe;
 3595|   513k|               while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (3595:23): [True: 509k, False: 3.77k]
  |  Branch (3595:38): [True: 508k, False: 1.70k]
  |  Branch (3595:55): [True: 505k, False: 2.69k]
  ------------------
 3596|   505k|                  if (*scan == ':') {
  ------------------
  |  Branch (3596:23): [True: 1.00k, False: 504k]
  ------------------
 3597|  1.00k|                     const auto after = scan + 1;
 3598|  1.00k|                     if (after == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after)]) {
  ------------------
  |  Branch (3598:26): [True: 82, False: 924]
  |  Branch (3598:42): [True: 20, False: 904]
  ------------------
 3599|    102|                        looks_mapping_key = true;
 3600|    102|                        break;
 3601|    102|                     }
 3602|  1.00k|                  }
 3603|   505k|                  ++scan;
 3604|   505k|               }
 3605|  8.28k|               if (looks_sequence_entry || looks_explicit_entry || looks_mapping_key) {
  ------------------
  |  Branch (3605:20): [True: 10, False: 8.27k]
  |  Branch (3605:44): [True: 32, False: 8.24k]
  |  Branch (3605:68): [True: 68, False: 8.17k]
  ------------------
 3606|    110|                  ctx.error = error_code::syntax_error;
 3607|    110|                  return -1;
 3608|    110|               }
 3609|  8.28k|            }
 3610|  15.6k|         }
 3611|       |
 3612|  1.87M|         const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3612:48): [True: 0, False: 1.87M]
  ------------------
 3613|  1.87M|         if (content_indent > effective_line_indent && peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (3613:14): [True: 366k, False: 1.50M]
  |  Branch (3613:56): [True: 366k, False: 0]
  |  Branch (3613:71): [True: 366k, False: 0]
  |  Branch (3613:88): [True: 366k, False: 0]
  ------------------
 3614|   366k|            it = content_start;
 3615|   366k|            return content_indent;
 3616|   366k|         }
 3617|       |
 3618|       |         // YAML allows "indentless sequences" as mapping values:
 3619|       |         // key:
 3620|       |         // - item
 3621|  1.50M|         if (content_indent == effective_line_indent && peek != end && *peek == '-') {
  ------------------
  |  Branch (3621:14): [True: 1.24M, False: 267k]
  |  Branch (3621:57): [True: 1.18M, False: 57.0k]
  |  Branch (3621:72): [True: 16.1k, False: 1.16M]
  ------------------
 3622|  16.1k|            const auto after_dash = peek + 1;
 3623|  16.1k|            if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3623:17): [True: 192, False: 15.9k]
  |  Branch (3623:38): [True: 12.8k, False: 3.17k]
  ------------------
 3624|  13.0k|               it = content_start;
 3625|  13.0k|               return content_indent;
 3626|  13.0k|            }
 3627|  16.1k|         }
 3628|       |
 3629|  1.49M|         it = content_start;
 3630|  1.49M|         return -1;
 3631|  1.50M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|   692k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   692k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 692k]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|   692k|            }
_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|   114k|      {
 5311|   114k|         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|   114k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   114k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   114k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   114k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 114k, False: 0]
  ------------------
 5321|   114k|            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|   114k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|   119k|      {
 4183|   119k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 119k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   119k|         auto peek = it;
 4188|   119k|         yaml::node_preamble_state preamble{};
 4189|   119k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 6.73k, False: 113k]
  ------------------
 4190|   119k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  6.73k|            it = peek;
 4192|  6.73k|            return;
 4193|  6.73k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   113k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   113k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 9, False: 113k]
  ------------------
 4198|      9|            return;
 4199|       |
 4200|   113k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 46.3k, False: 66.6k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  46.3k|            it = peek;
 4203|  46.3k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  46.3k|         }
 4205|  66.6k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 66.5k, 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|  66.5k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 356, False: 66.2k]
  |  Branch (4208:57): [True: 1.97k, False: 64.2k]
  ------------------
 4209|  2.33k|               it = peek;
 4210|  2.33k|            }
 4211|  66.5k|            int32_t seq_indent = ctx.current_indent();
 4212|  66.5k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 66.3k, False: 233]
  |  Branch (4212:31): [True: 37.7k, False: 28.5k]
  ------------------
 4213|  37.7k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 11.0k, False: 26.6k]
  |  Branch (4213:62): [True: 10.2k, False: 794]
  ------------------
 4214|  37.7k|                                                          : (ctx.current_indent() + 1);
 4215|  37.7k|            }
 4216|  66.5k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|  66.5k|         }
 4218|     80|         else {
 4219|     80|            ctx.error = error_code::syntax_error;
 4220|     80|         }
 4221|       |
 4222|   113k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   113k|      }
_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|   119k|      {
  466|   119k|         skip_inline_ws(it, end);
  467|       |
  468|   119k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 119k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|   119k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   119k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 119k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   119k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 119k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   119k|         skip_inline_ws(it, end);
  486|       |
  487|   119k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 119k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   119k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 6.71k, False: 113k]
  ------------------
  495|  6.71k|            return true;
  496|  6.71k|         }
  497|       |
  498|   113k|         return false;
  499|   119k|      }
_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|   119k|                                             [](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|   119k|      {
  409|   119k|         state.has_anchor = false;
  410|   119k|         state.anchor_name.clear();
  411|   119k|         state.anchor_start = nullptr;
  412|   119k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   119k|         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|   119k|            else {
  421|   119k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 6.68k, False: 113k]
  ------------------
  422|   119k|            }
  423|   119k|         }
  424|       |
  425|   119k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 113k, False: 6.68k]
  |  Branch (425:27): [True: 2.91k, False: 110k]
  ------------------
  426|  2.91k|            ++it;
  427|  2.91k|            auto name = parse_anchor_name(it, end);
  428|  2.91k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 7, False: 2.90k]
  ------------------
  429|      7|               ctx.error = error_code::syntax_error;
  430|      7|               return true;
  431|      7|            }
  432|  2.90k|            skip_inline_ws(it, end);
  433|  2.90k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 26, False: 2.88k]
  ------------------
  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|  2.88k|            state.has_anchor = true;
  446|  2.88k|            state.anchor_name = std::string(name);
  447|  2.88k|            state.anchor_start = &*it;
  448|  2.88k|         }
  449|       |
  450|   119k|         return false;
  451|   119k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   119k|      {
  301|   119k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 119k]
  |  Branch (301:27): [True: 113k, False: 6.68k]
  ------------------
  302|       |
  303|  6.68k|         ++it; // skip '*'
  304|  6.68k|         auto name = parse_anchor_name(it, end);
  305|  6.68k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 6.67k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  6.67k|         auto anchor_it = ctx.anchors.find(name);
  311|  6.67k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 22, False: 6.64k]
  ------------------
  312|     22|            ctx.error = error_code::syntax_error; // undefined alias
  313|     22|            return true;
  314|     22|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  6.64k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  6.64k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.56k, False: 5.08k]
  ------------------
  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|  5.08k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 5.07k]
  ------------------
  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|  5.07k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  5.07k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 5.06k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  5.06k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 5.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|  5.06k|         auto replay_it = span.begin;
  348|  5.06k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  5.06k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  5.06k|         ctx.indent_stack.clear();
  353|  5.06k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.52k, False: 3.54k]
  ------------------
  354|  1.52k|            ctx.push_indent(span.base_indent - 1);
  355|  1.52k|         }
  356|       |
  357|  5.06k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  5.06k|         using V = std::remove_cvref_t<T>;
  360|  5.06k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  5.06k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  5.06k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  5.06k|         return true;
  367|  5.06k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  46.3k|      {
 2665|  46.3k|         using V = std::remove_cvref_t<T>;
 2666|  46.3k|         using value_type = typename V::value_type;
 2667|       |
 2668|  46.3k|         struct sequence_container_adapter
 2669|  46.3k|         {
 2670|  46.3k|            size_t index = 0;
 2671|       |
 2672|  46.3k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  46.3k|            {
 2674|  46.3k|               if constexpr (!resizable<V>) {
 2675|  46.3k|                  return index >= container.size();
 2676|  46.3k|               }
 2677|  46.3k|               else {
 2678|  46.3k|                  (void)container;
 2679|  46.3k|                  return false;
 2680|  46.3k|               }
 2681|  46.3k|            }
 2682|       |
 2683|  46.3k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  46.3k|            inline void append(V& container, value_type&& element) noexcept
 2686|  46.3k|            {
 2687|  46.3k|               if constexpr (emplace_backable<V>) {
 2688|  46.3k|                  container.emplace_back(std::move(element));
 2689|  46.3k|               }
 2690|  46.3k|               else if constexpr (emplaceable<V>) {
 2691|  46.3k|                  container.emplace(std::move(element));
 2692|  46.3k|               }
 2693|  46.3k|            }
 2694|  46.3k|         };
 2695|       |
 2696|  46.3k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 46.3k]
  |  Branch (2696:27): [True: 0, False: 46.3k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  46.3k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  46.3k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  46.3k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  46.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 12, False: 46.3k]
  ------------------
 2709|     12|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  46.3k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 45.2k, False: 1.09k]
  |  Branch (2712:27): [True: 8.82k, False: 36.4k]
  ------------------
 2713|  8.82k|            ++it;
 2714|  8.82k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  8.82k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 24, False: 8.80k]
  ------------------
 2716|     24|               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.80k|            return;
 2723|  8.82k|         }
 2724|       |
 2725|  37.5k|         bool just_saw_comma = false;
 2726|  37.5k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  37.5k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  86.9k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 85.6k, False: 1.21k]
  ------------------
 2731|  85.6k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  85.6k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 85.6k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  85.6k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 85.6k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  85.6k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 6.97k, False: 78.7k]
  ------------------
 2741|  6.97k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 6.97k, False: 0]
  ------------------
 2742|  6.97k|                     ++it;
 2743|  6.97k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  6.97k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 4, False: 6.96k]
  ------------------
 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.96k|                     return;
 2752|  6.97k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  6.97k|               }
 2756|       |
 2757|  78.7k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 36, False: 78.6k]
  |  Branch (2757:34): [True: 17, False: 78.6k]
  ------------------
 2758|     53|                  ctx.error = error_code::syntax_error;
 2759|     53|                  return;
 2760|     53|               }
 2761|  78.6k|               just_saw_comma = false;
 2762|       |
 2763|  78.6k|               value_type element{};
 2764|  78.6k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  78.6k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 7.69k, False: 70.9k]
  ------------------
 2767|  7.69k|                  return;
 2768|       |
 2769|  70.9k|               bool saw_line_break_before_separator = false;
 2770|  70.9k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  70.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 16, False: 70.9k]
  ------------------
 2772|     16|                  return;
 2773|       |
 2774|  70.9k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 70.0k, False: 927]
  |  Branch (2774:33): [True: 9.10k, False: 60.9k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  9.10k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 11, False: 9.08k]
  ------------------
 2777|     11|                     ctx.error = error_code::syntax_error;
 2778|     11|                     return;
 2779|     11|                  }
 2780|  9.08k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  9.08k|                     glz::generic key_node = std::move(element);
 2782|  9.08k|                     ++it;
 2783|  9.08k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  9.08k|                     glz::generic mapped{};
 2786|  9.08k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  9.08k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 620, False: 8.46k]
  ------------------
 2788|    620|                        return;
 2789|       |
 2790|  8.46k|                     std::string key;
 2791|  8.46k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 2, False: 8.46k]
  ------------------
 2792|      2|                        return;
 2793|       |
 2794|  8.46k|                     glz::generic pair{};
 2795|  8.46k|                     pair[key] = std::move(mapped);
 2796|  8.46k|                     element = std::move(pair);
 2797|       |
 2798|  8.46k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  8.46k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 0, False: 8.46k]
  ------------------
 2800|      0|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  9.08k|               }
 2807|       |
 2808|  70.9k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  70.9k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 963, False: 69.9k]
  ------------------
 2811|    963|                  ctx.error = error_code::unexpected_end;
 2812|    963|                  return;
 2813|    963|               }
 2814|       |
 2815|  69.9k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 19.5k, False: 50.4k]
  ------------------
 2816|  19.5k|                  ++it;
 2817|  19.5k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  19.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 18, False: 19.5k]
  ------------------
 2819|     18|                     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|  19.5k|                  return;
 2826|  19.5k|               }
 2827|  50.4k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 49.3k, False: 1.06k]
  ------------------
 2828|  49.3k|                  ++it;
 2829|  49.3k|                  just_saw_comma = true;
 2830|  49.3k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  49.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 9, False: 49.3k]
  ------------------
 2832|      9|                     return;
 2833|  49.3k|               }
 2834|  1.06k|               else {
 2835|  1.06k|                  ctx.error = error_code::syntax_error;
 2836|  1.06k|                  return;
 2837|  1.06k|               }
 2838|  69.9k|            }
 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|  37.5k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   112k|      {
 2649|   112k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   112k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   112k|               value.clear();
 2653|   112k|            }
 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|   112k|      }
_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|  70.3k|            {
 2687|  70.3k|               if constexpr (emplace_backable<V>) {
 2688|  70.3k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  70.3k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|  66.5k|      {
 3160|  66.5k|         using V = std::remove_cvref_t<T>;
 3161|  66.5k|         using value_type = typename V::value_type;
 3162|       |
 3163|  66.5k|         struct sequence_container_adapter
 3164|  66.5k|         {
 3165|  66.5k|            size_t index = 0;
 3166|       |
 3167|  66.5k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|  66.5k|            {
 3169|  66.5k|               if constexpr (!resizable<V>) {
 3170|  66.5k|                  return index >= container.size();
 3171|  66.5k|               }
 3172|  66.5k|               else {
 3173|  66.5k|                  (void)container;
 3174|  66.5k|                  return false;
 3175|  66.5k|               }
 3176|  66.5k|            }
 3177|       |
 3178|  66.5k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|  66.5k|            inline void append(V& container, value_type&& element) noexcept
 3181|  66.5k|            {
 3182|  66.5k|               if constexpr (emplace_backable<V>) {
 3183|  66.5k|                  container.emplace_back(std::move(element));
 3184|  66.5k|               }
 3185|  66.5k|               else if constexpr (emplaceable<V>) {
 3186|  66.5k|                  container.emplace(std::move(element));
 3187|  66.5k|               }
 3188|  66.5k|            }
 3189|  66.5k|         };
 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|  66.5k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|  66.5k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|  66.5k|         bool first_item = true;
 3200|  66.5k|         bool has_pending_item_anchor = false;
 3201|  66.5k|         std::string pending_item_anchor_name{};
 3202|  66.5k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   176k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 158k, False: 18.5k]
  ------------------
 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|   158k|            int32_t line_indent = 0;
 3215|   158k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   158k|            auto line_start = it;
 3217|       |
 3218|   210k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 202k, False: 7.84k]
  ------------------
 3219|   202k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 9.95k, False: 192k]
  ------------------
 3220|  9.95k|                  skip_comment(it, end);
 3221|  9.95k|                  skip_newline(it, end);
 3222|  9.95k|                  line_start = it;
 3223|  9.95k|                  line_indent = 0;
 3224|  9.95k|               }
 3225|   192k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 9.66k, False: 183k]
  |  Branch (3225:40): [True: 24.1k, False: 158k]
  ------------------
 3226|  33.7k|                  skip_newline(it, end);
 3227|  33.7k|                  line_start = it;
 3228|  33.7k|                  line_indent = 0;
 3229|  33.7k|               }
 3230|   158k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 13.9k, False: 145k]
  ------------------
 3231|  13.9k|                  line_start = it;
 3232|  13.9k|                  line_indent = 0;
 3233|   208k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 206k, False: 1.61k]
  |  Branch (3233:39): [True: 194k, False: 12.3k]
  ------------------
 3234|   194k|                     ++line_indent;
 3235|   194k|                     ++it;
 3236|   194k|                  }
 3237|       |
 3238|  13.9k|                  bool saw_tab = false;
 3239|  16.2k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 14.3k, False: 1.94k]
  |  Branch (3239:40): [True: 1.01k, False: 13.2k]
  |  Branch (3239:54): [True: 1.29k, False: 11.9k]
  ------------------
 3240|  2.31k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 1.31k, False: 1.00k]
  |  Branch (3240:43): [True: 1.00k, False: 0]
  ------------------
 3241|  2.31k|                     ++it;
 3242|  2.31k|                  }
 3243|       |
 3244|  13.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 1.94k, False: 11.9k]
  |  Branch (3244:36): [True: 897, False: 11.0k]
  |  Branch (3244:51): [True: 1.08k, False: 10.0k]
  |  Branch (3244:66): [True: 1.56k, False: 8.44k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  5.49k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 3.54k, False: 1.94k]
  |  Branch (3246:39): [True: 1.56k, False: 1.98k]
  ------------------
 3247|  1.56k|                        skip_comment(it, end);
 3248|  1.56k|                     }
 3249|  5.49k|                     line_indent = 0;
 3250|  5.49k|                     continue;
 3251|  5.49k|                  }
 3252|       |
 3253|  8.44k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 12, False: 8.43k]
  ------------------
 3254|     12|                     ctx.error = error_code::syntax_error;
 3255|     12|                     return;
 3256|     12|                  }
 3257|  8.43k|                  break; // Found content
 3258|  8.44k|               }
 3259|   145k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 2.93k, False: 142k]
  ------------------
 3260|  2.93k|                  line_start = it;
 3261|  8.28k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 7.98k, False: 297]
  |  Branch (3261:40): [True: 1.15k, False: 6.83k]
  |  Branch (3261:54): [True: 4.19k, False: 2.63k]
  ------------------
 3262|  2.93k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 297, False: 2.63k]
  |  Branch (3262:36): [True: 860, False: 1.77k]
  |  Branch (3262:51): [True: 446, False: 1.32k]
  |  Branch (3262:66): [True: 1.31k, False: 12]
  ------------------
 3263|  2.91k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 2.62k, False: 297]
  |  Branch (3263:39): [True: 1.31k, False: 1.30k]
  ------------------
 3264|  1.31k|                        skip_comment(it, end);
 3265|  1.31k|                     }
 3266|  2.91k|                     line_indent = 0;
 3267|  2.91k|                     continue;
 3268|  2.91k|                  }
 3269|     12|                  ctx.error = error_code::syntax_error;
 3270|     12|                  return;
 3271|  2.93k|               }
 3272|   142k|               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|   142k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 66.5k, False: 75.5k]
  |  Branch (3276:37): [True: 66.3k, False: 232]
  ------------------
 3277|  66.3k|                     line_indent = sequence_indent;
 3278|  66.3k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  66.3k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 66.3k, False: 0]
  |  Branch (3279:49): [True: 66.3k, False: 0]
  ------------------
 3280|  66.3k|                           auto probe = it;
 3281|  66.3k|                           int32_t leading_ws = 0;
 3282|  66.3k|                           bool saw_tab = false;
 3283|   163k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 163k, False: 0]
  |  Branch (3283:64): [True: 90.9k, False: 72.6k]
  |  Branch (3283:87): [True: 6.30k, False: 66.3k]
  ------------------
 3284|  97.2k|                              --probe;
 3285|  97.2k|                              ++leading_ws;
 3286|  97.2k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 2.04k, False: 95.1k]
  |  Branch (3286:52): [True: 5.04k, False: 90.1k]
  ------------------
 3287|  97.2k|                           }
 3288|  66.3k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 66.3k]
  |  Branch (3288:61): [True: 2.93k, False: 63.3k]
  |  Branch (3288:85): [True: 19.3k, False: 44.0k]
  ------------------
 3289|  22.3k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 2, False: 22.3k]
  ------------------
 3290|      2|                                 ctx.error = error_code::syntax_error;
 3291|      2|                                 return;
 3292|      2|                              }
 3293|  22.3k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  22.3k|                           }
 3295|  66.3k|                        }
 3296|  66.3k|                     }
 3297|  66.3k|                  }
 3298|  66.3k|                  break;
 3299|   142k|               }
 3300|   202k|            }
 3301|       |
 3302|   158k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 7.84k, False: 150k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   150k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 2.79k, False: 147k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   147k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 15.4k, False: 132k]
  ------------------
 3309|  15.4k|               it = line_start;
 3310|  15.4k|               return;
 3311|  15.4k|            }
 3312|       |
 3313|   132k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 5.74k, 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.74k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 2, False: 5.74k]
  ------------------
 3318|      2|                  ctx.error = error_code::syntax_error;
 3319|      2|                  return;
 3320|      2|               }
 3321|       |
 3322|  5.74k|               ++it;
 3323|  5.74k|               auto pending_name = parse_anchor_name(it, end);
 3324|  5.74k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 9, False: 5.73k]
  ------------------
 3325|      9|                  ctx.error = error_code::syntax_error;
 3326|      9|                  return;
 3327|      9|               }
 3328|  5.73k|               skip_inline_ws(it, end);
 3329|  5.73k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 5.70k, False: 32]
  |  Branch (3329:33): [True: 795, False: 4.90k]
  ------------------
 3330|    795|                  skip_comment(it, end);
 3331|    795|               }
 3332|       |
 3333|  5.73k|               has_pending_item_anchor = true;
 3334|  5.73k|               pending_item_anchor_name = std::string(pending_name);
 3335|  5.73k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  5.73k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 41, False: 5.69k]
  |  Branch (3337:34): [True: 3.80k, False: 1.88k]
  |  Branch (3337:49): [True: 38, False: 3.77k]
  ------------------
 3338|     79|                  ctx.error = error_code::syntax_error;
 3339|     79|                  return;
 3340|     79|               }
 3341|       |
 3342|  5.65k|               skip_newline(it, end);
 3343|  5.65k|               continue;
 3344|  5.73k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   126k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 17.8k, False: 108k]
  ------------------
 3348|  17.8k|               it = line_start;
 3349|  17.8k|               return;
 3350|  17.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|   108k|            dash_col = line_indent;
 3356|   108k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   108k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 108k, False: 2]
  ------------------
 3358|   108k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   108k|               }
 3360|   108k|            }
 3361|       |
 3362|   108k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   108k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 104k, False: 4.28k]
  |  Branch (3365:30): [True: 3.38k, False: 101k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  3.38k|               it = line_start;
 3368|  3.38k|               return;
 3369|  3.38k|            }
 3370|       |
 3371|   105k|            bool saw_tab_after_dash = false;
 3372|   180k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 175k, False: 5.15k]
  |  Branch (3372:34): [True: 56.7k, False: 119k]
  |  Branch (3372:48): [True: 18.9k, False: 100k]
  ------------------
 3373|  75.6k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 1.28k, False: 74.3k]
  |  Branch (3373:59): [True: 18.4k, False: 55.9k]
  ------------------
 3374|  75.6k|               ++it;
 3375|  75.6k|            }
 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: 18.4k, False: 86.8k]
  |  Branch (3377:39): [True: 18.1k, False: 335]
  |  Branch (3377:52): [True: 310, False: 17.7k]
  ------------------
 3378|    310|               const auto after_dash = it + 1;
 3379|    310|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 3, False: 307]
  |  Branch (3379:41): [True: 2, False: 305]
  ------------------
 3380|      5|                  ctx.error = error_code::syntax_error;
 3381|      5|                  return;
 3382|      5|               }
 3383|    310|            }
 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: 590, False: 104k]
  ------------------
 3474|    590|               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|  66.5k|      }
_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: 100k, False: 5.14k]
  ------------------
 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: 100k, False: 5.14k]
  |  Branch (3390:33): [True: 51.7k, False: 48.4k]
  ------------------
 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|  51.7k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 51.7k]
  ------------------
 3396|      0|                     return;
 3397|  51.7k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|  51.7k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|  51.7k|                  ctx.sequence_item_value_context = true;
 3400|  51.7k|                  ctx.sequence_dash_indent = dash_col;
 3401|  51.7k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|  51.7k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|  51.7k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|  51.7k|                  ctx.pop_indent();
 3405|  51.7k|               }
 3406|  53.5k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  53.5k|                  skip_ws_and_comment(it, end);
 3409|  53.5k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  53.5k|                  auto nested_start = it;
 3413|  53.5k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  53.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 6, False: 53.5k]
  ------------------
 3415|      6|                     return;
 3416|  53.5k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|  53.5k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 4.32k, False: 49.2k]
  ------------------
 3422|  53.5k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 4.96k, False: 48.5k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  4.96k|                     const int32_t element_indent =
 3428|  4.96k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 4.96k]
  ------------------
 3429|  4.96k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 4.96k]
  ------------------
 3430|      0|                        return;
 3431|  4.96k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  4.96k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  4.96k|                     ctx.sequence_item_value_context = true;
 3434|  4.96k|                     ctx.sequence_dash_indent = dash_col;
 3435|  4.96k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  4.96k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  4.96k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  4.96k|                     ctx.pop_indent();
 3439|  4.96k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  53.5k|               }
 3442|       |
 3443|   105k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 2.09k, False: 103k]
  |  Branch (3443:47): [True: 1.96k, False: 134]
  ------------------
 3444|  1.96k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 1.64k, False: 325]
  ------------------
 3445|  1.96k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  1.96k|                                                                      pending_item_anchor_indent};
 3447|  1.96k|                  has_pending_item_anchor = false;
 3448|  1.96k|               }
 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|   382k|   {
 5531|   382k|      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|   382k|         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|   382k|            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|   382k|            bool at_node_start = true;
 5542|   382k|            int depth = 0;
 5543|   382k|            while (pos != stop) {
 5544|   382k|               const char c = *pos;
 5545|   382k|               if (c == ' ' || c == '\t') {
 5546|   382k|                  ++pos;
 5547|   382k|                  continue;
 5548|   382k|               }
 5549|   382k|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|   382k|               if ((c == '"' || c == '\'') && node_start) {
 5552|   382k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|   382k|                  continue;
 5554|   382k|               }
 5555|   382k|               if (c == '[' || c == '{') {
 5556|   382k|                  ++depth;
 5557|   382k|                  at_node_start = true;
 5558|   382k|                  ++pos;
 5559|   382k|                  continue;
 5560|   382k|               }
 5561|   382k|               if (c == ']' || c == '}') {
 5562|   382k|                  if (depth == 0) return false;
 5563|   382k|                  --depth;
 5564|   382k|                  ++pos;
 5565|   382k|                  continue;
 5566|   382k|               }
 5567|   382k|               if (c == ',' && depth == 0) return false;
 5568|   382k|               if (c == ':' && depth == 0) {
 5569|   382k|                  auto next = pos + 1;
 5570|   382k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|   382k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|   382k|               if (c == ',' || c == ':') {
 5574|   382k|                  at_node_start = true;
 5575|   382k|                  ++pos;
 5576|   382k|                  continue;
 5577|   382k|               }
 5578|   382k|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|   382k|                  at_node_start = true;
 5580|   382k|                  continue;
 5581|   382k|               }
 5582|   382k|               ++pos;
 5583|   382k|            }
 5584|   382k|            return false;
 5585|   382k|         };
 5586|       |
 5587|   382k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5587:14): [True: 157k, False: 225k]
  |  Branch (5587:49): [True: 5.62k, False: 219k]
  ------------------
 5588|   163k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5588:17): [True: 142k, False: 20.6k]
  ------------------
 5589|   142k|               return;
 5590|   142k|            }
 5591|  20.6k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5591:17): [True: 3.79k, False: 16.8k]
  ------------------
 5592|  3.79k|               return;
 5593|  3.79k|            }
 5594|  20.6k|         }
 5595|       |
 5596|   236k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|   236k|         return;
 5598|   382k|      }
 5599|       |
 5600|   382k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 0, False: 382k]
  ------------------
 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|   382k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 0, False: 382k]
  ------------------
 5605|      0|         return;
 5606|      0|      }
 5607|   382k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   382k|   }
_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|   382k|         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|   382k|            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|   382k|            bool at_node_start = true;
 5542|   382k|            int depth = 0;
 5543|  6.20M|            while (pos != stop) {
  ------------------
  |  Branch (5543:20): [True: 6.15M, False: 42.5k]
  ------------------
 5544|  6.15M|               const char c = *pos;
 5545|  6.15M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5545:20): [True: 686k, False: 5.47M]
  |  Branch (5545:32): [True: 95.4k, False: 5.37M]
  ------------------
 5546|   781k|                  ++pos;
 5547|   781k|                  continue;
 5548|   781k|               }
 5549|  5.37M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  5.37M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5551:21): [True: 69.1k, False: 5.30M]
  |  Branch (5551:33): [True: 24.5k, False: 5.28M]
  |  Branch (5551:47): [True: 58.7k, False: 34.8k]
  ------------------
 5552|  58.7k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5552:23): [True: 6.37k, False: 52.4k]
  ------------------
 5553|  52.4k|                  continue;
 5554|  58.7k|               }
 5555|  5.31M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5555:20): [True: 299k, False: 5.02M]
  |  Branch (5555:32): [True: 57.1k, False: 4.96M]
  ------------------
 5556|   356k|                  ++depth;
 5557|   356k|                  at_node_start = true;
 5558|   356k|                  ++pos;
 5559|   356k|                  continue;
 5560|   356k|               }
 5561|  4.96M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5561:20): [True: 49.2k, False: 4.91M]
  |  Branch (5561:32): [True: 48.5k, False: 4.86M]
  ------------------
 5562|  97.8k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5562:23): [True: 39.8k, False: 57.9k]
  ------------------
 5563|  57.9k|                  --depth;
 5564|  57.9k|                  ++pos;
 5565|  57.9k|                  continue;
 5566|  97.8k|               }
 5567|  4.86M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5567:20): [True: 338k, False: 4.52M]
  |  Branch (5567:32): [True: 101k, False: 237k]
  ------------------
 5568|  4.76M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5568:20): [True: 317k, False: 4.44M]
  |  Branch (5568:32): [True: 192k, False: 124k]
  ------------------
 5569|   192k|                  auto next = pos + 1;
 5570|   192k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5570:26): [True: 2.18k, False: 190k]
  |  Branch (5570:41): [True: 115k, False: 74.8k]
  |  Branch (5570:57): [True: 10.7k, False: 64.1k]
  |  Branch (5570:74): [True: 9.49k, False: 54.6k]
  |  Branch (5570:91): [True: 20.0k, False: 34.6k]
  ------------------
 5571|   192k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  4.57M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5573:20): [True: 237k, False: 4.33M]
  |  Branch (5573:32): [True: 124k, False: 4.20M]
  ------------------
 5574|   361k|                  at_node_start = true;
 5575|   361k|                  ++pos;
 5576|   361k|                  continue;
 5577|   361k|               }
 5578|  4.20M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5578:20): [True: 739k, False: 3.46M]
  |  Branch (5578:34): [True: 60.5k, False: 678k]
  ------------------
 5579|  60.5k|                  at_node_start = true;
 5580|  60.5k|                  continue;
 5581|  60.5k|               }
 5582|  4.14M|               ++pos;
 5583|  4.14M|            }
 5584|  42.5k|            return false;
 5585|   382k|         };
_ZN3glz26line_could_be_flow_mappingIPKcS2_EEbT_T0_:
 5398|  7.49M|   {
 5399|  7.49M|      const auto stop = yaml::implicit_key_scan_end(it, end);
 5400|  7.49M|      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.49M|      bool at_node_start = true;
 5404|  7.49M|      bool prev_was_whitespace = true;
 5405|  7.49M|      bool key_supports_adjacent_value = false;
 5406|       |
 5407|  55.0M|      while (it != stop) {
  ------------------
  |  Branch (5407:14): [True: 54.7M, False: 226k]
  ------------------
 5408|  54.7M|         const char c = *it;
 5409|  54.7M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (5409:14): [True: 382k, False: 54.3M]
  |  Branch (5409:27): [True: 297k, False: 54.0M]
  ------------------
 5410|   680k|            return false;
 5411|   680k|         }
 5412|  54.0M|         if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5412:14): [True: 2.63M, False: 51.4M]
  |  Branch (5412:26): [True: 311k, False: 51.1M]
  ------------------
 5413|  2.94M|            prev_was_whitespace = true;
 5414|  2.94M|            key_supports_adjacent_value = false; // "Adjacent" admits no separation at all
 5415|  2.94M|            ++it;
 5416|  2.94M|            continue;
 5417|  2.94M|         }
 5418|  51.1M|         if (flow_depth == 0 && (c == ',' || c == ']' || c == '}')) {
  ------------------
  |  Branch (5418:14): [True: 40.2M, False: 10.8M]
  |  Branch (5418:34): [True: 4.47M, False: 35.7M]
  |  Branch (5418:46): [True: 133k, False: 35.6M]
  |  Branch (5418:58): [True: 196k, False: 35.4M]
  ------------------
 5419|  4.80M|            return false;
 5420|  4.80M|         }
 5421|       |         // As in `line_could_be_block_mapping`, content clears both flags and a branch opts back in.
 5422|  46.3M|         const bool after_whitespace = std::exchange(prev_was_whitespace, false);
 5423|  46.3M|         const bool node_start = std::exchange(at_node_start, false);
 5424|  46.3M|         const bool adjacent_value_ok = std::exchange(key_supports_adjacent_value, false);
 5425|       |
 5426|  46.3M|         if (c == '#' && flow_depth == 0 && after_whitespace) {
  ------------------
  |  Branch (5426:14): [True: 626k, False: 45.7M]
  |  Branch (5426:26): [True: 576k, False: 50.1k]
  |  Branch (5426:45): [True: 47.7k, False: 528k]
  ------------------
 5427|  47.7k|            return false;
 5428|  47.7k|         }
 5429|  46.2M|         if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5429:15): [True: 1.86M, False: 44.4M]
  |  Branch (5429:27): [True: 110k, False: 44.3M]
  |  Branch (5429:41): [True: 1.51M, False: 460k]
  ------------------
 5430|  1.51M|            if (not yaml::skip_probe_quoted_scalar(it, stop)) {
  ------------------
  |  Branch (5430:17): [True: 47.9k, False: 1.46M]
  ------------------
 5431|  47.9k|               return false;
 5432|  47.9k|            }
 5433|  1.46M|            key_supports_adjacent_value = true;
 5434|  1.46M|            continue;
 5435|  1.51M|         }
 5436|  44.7M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (5436:14): [True: 805k, False: 43.9M]
  |  Branch (5436:26): [True: 257k, False: 43.7M]
  ------------------
 5437|  1.06M|            ++flow_depth;
 5438|  1.06M|            at_node_start = true;
 5439|  1.06M|            ++it;
 5440|  1.06M|            continue;
 5441|  1.06M|         }
 5442|  43.7M|         if (c == ']' || c == '}') {
  ------------------
  |  Branch (5442:14): [True: 73.4k, False: 43.6M]
  |  Branch (5442:26): [True: 42.2k, False: 43.6M]
  ------------------
 5443|   115k|            --flow_depth; // Depth zero returned above, so this closes a collection we opened
 5444|   115k|            if (flow_depth == 0) {
  ------------------
  |  Branch (5444:17): [True: 67.5k, False: 48.1k]
  ------------------
 5445|  67.5k|               key_supports_adjacent_value = true;
 5446|  67.5k|            }
 5447|   115k|            ++it;
 5448|   115k|            continue;
 5449|   115k|         }
 5450|  43.6M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (5450:14): [True: 3.27M, False: 40.3M]
  |  Branch (5450:26): [True: 1.68M, False: 1.58M]
  ------------------
 5451|  1.68M|            const auto next = it + 1;
 5452|  1.68M|            if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (5452:17): [True: 13.5k, False: 1.67M]
  |  Branch (5452:32): [True: 1.05M, False: 618k]
  |  Branch (5452:48): [True: 87.8k, False: 530k]
  |  Branch (5452:65): [True: 64.8k, False: 465k]
  |  Branch (5452:82): [True: 116k, False: 349k]
  ------------------
 5453|  1.33M|               return true;
 5454|  1.33M|            }
 5455|       |            // A ':' run together with its key is a separator only after a JSON-like key.
 5456|   349k|            return adjacent_value_ok;
 5457|  1.68M|         }
 5458|       |         // Inside a flow collection ',' separates entries and ':' ends a key, so a node begins
 5459|       |         // after either.
 5460|  41.9M|         if (c == ',' || c == ':') {
  ------------------
  |  Branch (5460:14): [True: 1.67M, False: 40.2M]
  |  Branch (5460:26): [True: 1.58M, False: 38.6M]
  ------------------
 5461|  3.26M|            at_node_start = true;
 5462|  3.26M|            ++it;
 5463|  3.26M|            continue;
 5464|  3.26M|         }
 5465|  38.6M|         if (node_start && yaml::skip_probe_node_property(it, stop)) {
  ------------------
  |  Branch (5465:14): [True: 8.62M, False: 30.0M]
  |  Branch (5465:28): [True: 221k, False: 8.40M]
  ------------------
 5466|   221k|            at_node_start = true;
 5467|   221k|            continue;
 5468|   221k|         }
 5469|  38.4M|         ++it;
 5470|  38.4M|      }
 5471|       |
 5472|   226k|      return false;
 5473|  7.49M|   }
_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|  32.3k|            auto is_word_boundary = [&](const auto ptr) {
 5963|  32.3k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 1.15k, False: 31.2k]
  ------------------
 5964|  1.15k|                  return true;
 5965|  1.15k|               }
 5966|  31.2k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 19.7k, False: 11.4k]
  ------------------
 5967|  19.7k|                  auto next = ptr + 1;
 5968|  19.7k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 851, False: 18.9k]
  |  Branch (5968:43): [True: 7.39k, False: 11.5k]
  |  Branch (5968:59): [True: 6.65k, False: 4.88k]
  |  Branch (5968:76): [True: 1.30k, False: 3.57k]
  |  Branch (5968:93): [True: 2.59k, False: 987]
  ------------------
 5969|  19.7k|               }
 5970|  11.4k|               return is_plain_scalar_boundary(*ptr);
 5971|  31.2k|            };
_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|  11.4k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  11.4k|               switch (ch) {
 5890|    835|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 835, False: 10.6k]
  ------------------
 5891|  1.81k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 984, False: 10.4k]
  ------------------
 5892|  2.40k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 587, False: 10.8k]
  ------------------
 5893|  4.37k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 1.96k, False: 9.47k]
  ------------------
 5894|  6.78k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 2.41k, False: 9.02k]
  ------------------
 5895|  7.34k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 562, False: 10.8k]
  ------------------
 5896|  8.19k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 845, False: 10.5k]
  ------------------
 5897|  8.19k|                  return true;
 5898|  3.25k|               default:
  ------------------
  |  Branch (5898:16): [True: 3.25k, False: 8.19k]
  ------------------
 5899|  3.25k|                  return false;
 5900|  11.4k|               }
 5901|  11.4k|            };
_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|  28.1k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  28.1k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  28.1k|                  return false;
 5906|  28.1k|               }
 5907|  28.1k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 0, False: 28.1k]
  ------------------
 5908|      0|                  return false;
 5909|      0|               }
 5910|  28.1k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 28.1k, False: 0]
  |  Branch (5910:40): [True: 0, False: 0]
  |  Branch (5910:61): [True: 0, False: 0]
  ------------------
 5911|      0|                  return false;
 5912|      0|               }
 5913|       |
 5914|  28.1k|               auto look = word_end;
 5915|  28.1k|               yaml::skip_newline(look, end);
 5916|  28.1k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 0, False: 28.1k]
  ------------------
 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|  28.1k|               return false;
 5961|  28.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_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5484|   958k|   {
 5485|   958k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   958k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   958k|         const bool could_be_mapping = [&] {
 5493|   958k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   958k|               return line_could_be_flow_mapping(it, end);
 5495|   958k|            }
 5496|   958k|            else {
 5497|   958k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   958k|            }
 5499|   958k|         }();
 5500|   958k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 799k, False: 158k]
  ------------------
 5501|   799k|            return false;
 5502|   799k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   158k|         auto temp_ctx = ctx.make_speculative();
 5505|   158k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   158k|                                                                                               end);
 5507|   158k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   158k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   158k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 149k, False: 9.38k]
  ------------------
 5510|   149k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   149k|            return true;
 5512|   149k|         }
 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.38k|         ctx.error = temp_ctx.error;
 5517|  9.38k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  9.38k|         return false;
 5519|   158k|      }
 5520|   958k|   }
_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|   958k|         const bool could_be_mapping = [&] {
 5493|   958k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   958k|               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|       |            else {
 5497|       |               return yaml::line_could_be_block_mapping(it, end);
 5498|       |            }
 5499|   958k|         }();
_ZN3glz4yaml15materialize_keyILb1ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  4.44M|   {
   39|  4.44M|      if constexpr (empty_on_null) {
   40|  4.44M|         if (key_node.is_null()) {
  ------------------
  |  Branch (40:14): [True: 191k, False: 4.25M]
  ------------------
   41|   191k|            key.clear();
   42|   191k|            return true;
   43|   191k|         }
   44|  4.44M|      }
   45|  4.44M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 866k, False: 3.57M]
  ------------------
   46|   866k|         key = *s;
   47|   866k|         return true;
   48|   866k|      }
   49|  3.57M|      key.clear();
   50|  3.57M|      (void)glz::write_json(key_node, key);
   51|  3.57M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  3.57M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 334, False: 3.57M]
  ------------------
   53|    334|            ctx.error = error_code::exceeded_max_expansion;
   54|    334|            ctx.custom_error_message = "complex key expansion";
   55|    334|            return false;
   56|    334|         }
   57|  3.57M|      }
   58|  3.57M|      return true;
   59|  4.44M|   }
_ZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1576|  16.1M|      {
 1577|  16.1M|         key.clear();
 1578|  16.1M|         skip_inline_ws(it, end);
 1579|       |
 1580|  16.1M|         if (it == end) {
  ------------------
  |  Branch (1580:14): [True: 86, False: 16.1M]
  ------------------
 1581|     86|            ctx.error = error_code::unexpected_end;
 1582|     86|            return false;
 1583|     86|         }
 1584|       |
 1585|  16.1M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1586|  16.1M|            if (tag == yaml_tag::unknown) {
 1587|  16.1M|               ctx.error = error_code::syntax_error;
 1588|  16.1M|               return false;
 1589|  16.1M|            }
 1590|  16.1M|            if (!tag_valid_for_string(tag)) {
 1591|  16.1M|               ctx.error = error_code::syntax_error;
 1592|  16.1M|               return false;
 1593|  16.1M|            }
 1594|  16.1M|            return true;
 1595|  16.1M|         };
 1596|       |
 1597|       |         // Tags on keys (e.g. "!!str : value")
 1598|  16.1M|         auto key_tag = parse_yaml_tag(it, end, ctx);
 1599|  16.1M|         if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1599:14): [True: 154, False: 16.1M]
  ------------------
 1600|    154|            return false;
 1601|    154|         }
 1602|  16.1M|         skip_inline_ws(it, end);
 1603|  16.1M|         if (it == end) {
  ------------------
  |  Branch (1603:14): [True: 172, False: 16.1M]
  ------------------
 1604|    172|            ctx.error = error_code::unexpected_end;
 1605|    172|            return false;
 1606|    172|         }
 1607|       |
 1608|       |         // Handle alias as key (*name resolves to anchor value)
 1609|  16.1M|         if (*it == '*') {
  ------------------
  |  Branch (1609:14): [True: 2.00M, False: 14.1M]
  ------------------
 1610|  2.00M|            ++it;
 1611|  2.00M|            auto name = parse_anchor_name(it, end);
 1612|  2.00M|            if (name.empty()) {
  ------------------
  |  Branch (1612:17): [True: 596, False: 2.00M]
  ------------------
 1613|    596|               ctx.error = error_code::syntax_error;
 1614|    596|               return false;
 1615|    596|            }
 1616|  2.00M|            auto anchor_it = ctx.anchors.find(name);
 1617|  2.00M|            if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (1617:17): [True: 9.10k, False: 1.99M]
  ------------------
 1618|  9.10k|               ctx.error = error_code::syntax_error; // undefined alias
 1619|  9.10k|               return false;
 1620|  9.10k|            }
 1621|  1.99M|            auto& span = anchor_it->second;
 1622|  1.99M|            if (span.begin == span.end) {
  ------------------
  |  Branch (1622:17): [True: 108k, False: 1.88M]
  ------------------
 1623|   108k|               key.clear(); // empty anchor
 1624|   108k|            }
 1625|  1.88M|            else if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (1625:22): [True: 86, False: 1.88M]
  ------------------
 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|     86|               ctx.error = error_code::exceeded_max_expansion;
 1629|     86|               ctx.custom_error_message = "alias expansion";
 1630|     86|               return false;
 1631|     86|            }
 1632|  1.88M|            else {
 1633|       |               // Replay the anchor span to extract the key string
 1634|  1.88M|               auto replay_it = span.begin;
 1635|  1.88M|               auto replay_end = span.end;
 1636|  1.88M|               if (*replay_it == '"') {
  ------------------
  |  Branch (1636:20): [True: 1.44k, False: 1.88M]
  ------------------
 1637|  1.44k|                  parse_double_quoted_string(key, ctx, replay_it, replay_end);
 1638|  1.44k|               }
 1639|  1.88M|               else if (*replay_it == '\'') {
  ------------------
  |  Branch (1639:25): [True: 568, False: 1.88M]
  ------------------
 1640|    568|                  parse_single_quoted_string(key, ctx, replay_it, replay_end);
 1641|    568|               }
 1642|  1.88M|               else if (*replay_it == '[' || *replay_it == '{') {
  ------------------
  |  Branch (1642:25): [True: 17.0k, False: 1.86M]
  |  Branch (1642:46): [True: 991k, False: 873k]
  ------------------
 1643|       |                  // Canonicalize complex alias keys (flow seq/map) to a stable string form.
 1644|  1.00M|                  glz::generic key_node{};
 1645|  1.00M|                  auto temp_ctx = ctx.make_speculative();
 1646|  1.00M|                  from<YAML, glz::generic>::template op<flow_context_on<opts{.error_on_unknown_keys = false}>()>(
 1647|  1.00M|                     key_node, temp_ctx, replay_it, replay_end);
 1648|  1.00M|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1649|  1.00M|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1650|  1.00M|                  if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1650:23): [True: 82.7k, False: 925k]
  ------------------
 1651|  82.7k|                     ctx.error = temp_ctx.error;
 1652|  82.7k|                     ctx.custom_error_message = temp_ctx.custom_error_message;
 1653|  82.7k|                     return false;
 1654|  82.7k|                  }
 1655|   925k|                  ctx.anchors = std::move(temp_ctx.anchors);
 1656|       |
 1657|   925k|                  if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1657:23): [True: 38, False: 925k]
  ------------------
 1658|     38|                     return false;
 1659|     38|                  }
 1660|   925k|               }
 1661|   873k|               else {
 1662|   873k|                  bool parse_structured_alias_key = false;
 1663|   873k|                  if (*replay_it == '-' &&
  ------------------
  |  Branch (1663:23): [True: 183k, False: 690k]
  ------------------
 1664|   183k|                      ((replay_it + 1) == replay_end ||
  ------------------
  |  Branch (1664:24): [True: 14.1k, False: 169k]
  ------------------
 1665|   169k|                       yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(replay_it + 1))])) {
  ------------------
  |  Branch (1665:24): [True: 62.3k, False: 106k]
  ------------------
 1666|  76.5k|                     parse_structured_alias_key = true;
 1667|  76.5k|                  }
 1668|   796k|                  else {
 1669|   796k|                     auto scan = replay_it;
 1670|   578M|                     while (scan != replay_end) {
  ------------------
  |  Branch (1670:29): [True: 578M, False: 80.2k]
  ------------------
 1671|   578M|                        if (*scan == ':') {
  ------------------
  |  Branch (1671:29): [True: 438k, False: 578M]
  ------------------
 1672|   438k|                           const auto after_colon = scan + 1;
 1673|   438k|                           if (after_colon == replay_end ||
  ------------------
  |  Branch (1673:32): [True: 53.5k, False: 385k]
  ------------------
 1674|   385k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) {
  ------------------
  |  Branch (1674:32): [True: 197k, False: 188k]
  ------------------
 1675|   250k|                              parse_structured_alias_key = true;
 1676|   250k|                              break;
 1677|   250k|                           }
 1678|   438k|                        }
 1679|   578M|                        if (*scan == '\n' || *scan == '\r') {
  ------------------
  |  Branch (1679:29): [True: 194k, False: 578M]
  |  Branch (1679:46): [True: 271k, False: 577M]
  ------------------
 1680|   465k|                           break;
 1681|   465k|                        }
 1682|   577M|                        ++scan;
 1683|   577M|                     }
 1684|   796k|                  }
 1685|   873k|                  if (!parse_structured_alias_key) {
  ------------------
  |  Branch (1685:23): [True: 545k, False: 327k]
  ------------------
 1686|   434M|                     for (auto p = replay_it; p != replay_end; ++p) {
  ------------------
  |  Branch (1686:47): [True: 434M, False: 80.2k]
  ------------------
 1687|   434M|                        if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1687:29): [True: 194k, False: 433M]
  |  Branch (1687:43): [True: 271k, False: 433M]
  ------------------
 1688|   465k|                           parse_structured_alias_key = true;
 1689|   465k|                           break;
 1690|   465k|                        }
 1691|   434M|                     }
 1692|   545k|                  }
 1693|       |
 1694|   873k|                  if (parse_structured_alias_key) {
  ------------------
  |  Branch (1694:23): [True: 793k, False: 80.2k]
  ------------------
 1695|   793k|                     glz::generic key_node{};
 1696|   793k|                     auto temp_ctx = ctx.make_speculative();
 1697|   793k|                     from<YAML, glz::generic>::template op<opts{.error_on_unknown_keys = false}>(key_node, temp_ctx,
 1698|   793k|                                                                                                 replay_it, replay_end);
 1699|   793k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1700|   793k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1701|   793k|                     if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1701:26): [True: 205k, False: 587k]
  ------------------
 1702|   205k|                        ctx.error = temp_ctx.error;
 1703|   205k|                        ctx.custom_error_message = temp_ctx.custom_error_message;
 1704|   205k|                        return false;
 1705|   205k|                     }
 1706|   587k|                     ctx.anchors = std::move(temp_ctx.anchors);
 1707|       |
 1708|   587k|                     if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1708:26): [True: 24, False: 587k]
  ------------------
 1709|     24|                        return false;
 1710|     24|                     }
 1711|   587k|                  }
 1712|  80.2k|                  else {
 1713|  80.2k|                     parse_plain_scalar(key, ctx, replay_it, replay_end, false);
 1714|  80.2k|                  }
 1715|   873k|               }
 1716|  1.88M|            }
 1717|  1.70M|            return !bool(ctx.error);
 1718|  1.99M|         }
 1719|       |
 1720|       |         // Handle anchor on key (&name before key text)
 1721|  14.1M|         bool has_key_anchor = false;
 1722|  14.1M|         std::string key_anchor_name;
 1723|  14.1M|         if (*it == '&') {
  ------------------
  |  Branch (1723:14): [True: 2.15M, False: 11.9M]
  ------------------
 1724|  2.15M|            ++it;
 1725|  2.15M|            auto name = parse_anchor_name(it, end);
 1726|  2.15M|            if (name.empty()) {
  ------------------
  |  Branch (1726:17): [True: 566, False: 2.14M]
  ------------------
 1727|    566|               ctx.error = error_code::syntax_error;
 1728|    566|               return false;
 1729|    566|            }
 1730|  2.14M|            skip_inline_ws(it, end);
 1731|  2.14M|            if (it == end) {
  ------------------
  |  Branch (1731:17): [True: 548, False: 2.14M]
  ------------------
 1732|    548|               ctx.error = error_code::unexpected_end;
 1733|    548|               return false;
 1734|    548|            }
 1735|       |            // Anchor on alias is invalid per YAML spec
 1736|  2.14M|            if (*it == '*') {
  ------------------
  |  Branch (1736:17): [True: 82, False: 2.14M]
  ------------------
 1737|     82|               ctx.error = error_code::syntax_error;
 1738|     82|               return false;
 1739|     82|            }
 1740|  2.14M|            has_key_anchor = true;
 1741|  2.14M|            key_anchor_name = std::string(name);
 1742|  2.14M|         }
 1743|       |
 1744|       |         // Allow node-property order "&anchor !!str key: value" for mapping keys.
 1745|  14.1M|         if (*it == '!') {
  ------------------
  |  Branch (1745:14): [True: 7.22k, False: 14.1M]
  ------------------
 1746|  7.22k|            if (key_tag != yaml_tag::none) {
  ------------------
  |  Branch (1746:17): [True: 6, False: 7.21k]
  ------------------
 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.21k|            key_tag = parse_yaml_tag(it, end, ctx);
 1752|  7.21k|            if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1752:17): [True: 62, False: 7.15k]
  ------------------
 1753|     62|               return false;
 1754|     62|            }
 1755|  7.15k|            skip_inline_ws(it, end);
 1756|  7.15k|            if (it == end) {
  ------------------
  |  Branch (1756:17): [True: 22, False: 7.13k]
  ------------------
 1757|     22|               ctx.error = error_code::unexpected_end;
 1758|     22|               return false;
 1759|     22|            }
 1760|  7.15k|         }
 1761|       |
 1762|  14.1M|         const char* key_start = &*it;
 1763|  14.1M|         bool quoted_key_spans_lines = false;
 1764|       |
 1765|  14.1M|         if (*it == '"') {
  ------------------
  |  Branch (1765:14): [True: 1.63M, False: 12.5M]
  ------------------
 1766|  1.63M|            auto quoted_start = it;
 1767|  1.63M|            parse_double_quoted_string(key, ctx, it, end);
 1768|  1.63M|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1768:17): [True: 1.63M, False: 450]
  ------------------
 1769|  9.17M|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1769:44): [True: 7.55M, False: 1.62M]
  ------------------
 1770|  7.55M|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1770:23): [True: 3.60k, False: 7.55M]
  |  Branch (1770:37): [True: 10.0k, False: 7.54M]
  ------------------
 1771|  13.7k|                     quoted_key_spans_lines = true;
 1772|  13.7k|                     break;
 1773|  13.7k|                  }
 1774|  7.55M|               }
 1775|  1.63M|            }
 1776|  1.63M|         }
 1777|  12.5M|         else if (*it == '\'') {
  ------------------
  |  Branch (1777:19): [True: 20.9k, False: 12.4M]
  ------------------
 1778|  20.9k|            auto quoted_start = it;
 1779|  20.9k|            parse_single_quoted_string(key, ctx, it, end);
 1780|  20.9k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1780:17): [True: 20.6k, False: 252]
  ------------------
 1781|   122k|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1781:44): [True: 104k, False: 17.9k]
  ------------------
 1782|   104k|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1782:23): [True: 990, False: 103k]
  |  Branch (1782:37): [True: 1.76k, False: 101k]
  ------------------
 1783|  2.75k|                     quoted_key_spans_lines = true;
 1784|  2.75k|                     break;
 1785|  2.75k|                  }
 1786|   104k|               }
 1787|  20.6k|            }
 1788|  20.9k|         }
 1789|  12.4M|         else {
 1790|       |            // Plain key - read until colon
 1791|  48.9M|            while (it != end) {
  ------------------
  |  Branch (1791:20): [True: 48.9M, False: 458]
  ------------------
 1792|       |               // Bulk-copy the ordinary run; only dispatch bytes need the checks below.
 1793|  48.9M|               {
 1794|  48.9M|                  const auto run_start = it;
 1795|   156M|                  while (it != end && !plain_scalar_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1795:26): [True: 156M, False: 2.83k]
  |  Branch (1795:39): [True: 107M, False: 48.9M]
  ------------------
 1796|   107M|                     ++it;
 1797|   107M|                  }
 1798|  48.9M|                  if (it != run_start) {
  ------------------
  |  Branch (1798:23): [True: 38.5M, False: 10.3M]
  ------------------
 1799|  38.5M|                     key.append(run_start, it);
 1800|  38.5M|                  }
 1801|  48.9M|                  if (it == end) break;
  ------------------
  |  Branch (1801:23): [True: 2.83k, False: 48.9M]
  ------------------
 1802|  48.9M|               }
 1803|       |
 1804|  48.9M|               const char c = *it;
 1805|  48.9M|               if (c == ':') {
  ------------------
  |  Branch (1805:20): [True: 37.7M, False: 11.1M]
  ------------------
 1806|       |                  // Check if this ends the key
 1807|  37.7M|                  if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' ||
  ------------------
  |  Branch (1807:23): [True: 81.1k, False: 37.6M]
  |  Branch (1807:42): [True: 4.27M, False: 33.3M]
  |  Branch (1807:62): [True: 249k, False: 33.1M]
  |  Branch (1807:83): [True: 349k, False: 32.7M]
  ------------------
 1808|  32.7M|                      *(it + 1) == '\r') {
  ------------------
  |  Branch (1808:23): [True: 2.22M, False: 30.5M]
  ------------------
 1809|  7.17M|                     break;
 1810|  7.17M|                  }
 1811|  30.5M|                  if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1811:23): [True: 29.6M, False: 867k]
  |  Branch (1811:35): [True: 242k, False: 29.4M]
  |  Branch (1811:55): [True: 74, False: 29.4M]
  |  Branch (1811:75): [True: 79.7k, False: 29.3M]
  ------------------
 1812|   322k|                     break;
 1813|   322k|                  }
 1814|  30.5M|               }
 1815|  41.4M|               if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1815:20): [True: 1.24M, False: 40.1M]
  |  Branch (1815:33): [True: 1.91M, False: 38.2M]
  ------------------
 1816|  3.15M|                  if (!in_flow) break;
  ------------------
  |  Branch (1816:23): [True: 1.98k, False: 3.15M]
  ------------------
 1817|       |
 1818|  3.15M|                  auto continuation = it;
 1819|  3.15M|                  skip_newline(continuation, end);
 1820|  3.15M|                  int32_t continuation_indent = 0;
 1821|  24.7M|                  while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1821:26): [True: 24.7M, False: 578]
  |  Branch (1821:50): [True: 21.5M, False: 3.21M]
  |  Branch (1821:74): [True: 60.6k, False: 3.15M]
  ------------------
 1822|  21.5M|                     if (*continuation == ' ') ++continuation_indent;
  ------------------
  |  Branch (1822:26): [True: 21.5M, False: 60.6k]
  ------------------
 1823|  21.5M|                     ++continuation;
 1824|  21.5M|                  }
 1825|       |
 1826|  3.15M|                  if (continuation == end) {
  ------------------
  |  Branch (1826:23): [True: 578, False: 3.15M]
  ------------------
 1827|    578|                     break;
 1828|    578|                  }
 1829|       |
 1830|  3.15M|                  if (*continuation == '#') {
  ------------------
  |  Branch (1830:23): [True: 44.4k, False: 3.11M]
  ------------------
 1831|  44.4k|                     it = continuation;
 1832|  44.4k|                     skip_comment(it, end);
 1833|  44.4k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (1833:26): [True: 44.4k, False: 42]
  |  Branch (1833:40): [True: 20.6k, False: 23.7k]
  |  Branch (1833:55): [True: 23.6k, False: 82]
  ------------------
 1834|  44.3k|                        skip_newline(it, end);
 1835|  44.3k|                        continue;
 1836|  44.3k|                     }
 1837|    124|                     break;
 1838|  44.4k|                  }
 1839|       |
 1840|       |                  // A continuation line starting with flow terminators or ':' does
 1841|       |                  // not belong to the key content.
 1842|  3.11M|                  if (*continuation == ',' || *continuation == ']' || *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1842:23): [True: 161k, False: 2.94M]
  |  Branch (1842:47): [True: 14, False: 2.94M]
  |  Branch (1842:71): [True: 12.9k, False: 2.93M]
  |  Branch (1842:95): [True: 300k, False: 2.63M]
  ------------------
 1843|   475k|                     break;
 1844|   475k|                  }
 1845|       |
 1846|  2.63M|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1846:23): [True: 177k, False: 2.45M]
  ------------------
 1847|   177k|                     if (*continuation == '?' || *continuation == ':') {
  ------------------
  |  Branch (1847:26): [True: 1.66k, False: 176k]
  |  Branch (1847:50): [True: 0, False: 176k]
  ------------------
 1848|  1.66k|                        auto after = continuation + 1;
 1849|  1.66k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1849:29): [True: 8, False: 1.66k]
  |  Branch (1849:45): [True: 18, False: 1.64k]
  |  Branch (1849:62): [True: 6, False: 1.63k]
  |  Branch (1849:80): [True: 6, False: 1.63k]
  |  Branch (1849:98): [True: 6, False: 1.62k]
  ------------------
 1850|     44|                           break;
 1851|     44|                        }
 1852|  1.66k|                     }
 1853|       |
 1854|   177k|                     if (*continuation == '&' || *continuation == '*' || *continuation == '!') {
  ------------------
  |  Branch (1854:26): [True: 6, False: 177k]
  |  Branch (1854:50): [True: 10, False: 177k]
  |  Branch (1854:74): [True: 10, False: 177k]
  ------------------
 1855|     26|                        break;
 1856|     26|                     }
 1857|       |
 1858|   177k|                     if (*continuation == '-') {
  ------------------
  |  Branch (1858:26): [True: 2.89k, False: 174k]
  ------------------
 1859|  2.89k|                        auto after = continuation + 1;
 1860|  2.89k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1860:29): [True: 12, False: 2.88k]
  |  Branch (1860:45): [True: 6, False: 2.87k]
  |  Branch (1860:62): [True: 6, False: 2.87k]
  |  Branch (1860:80): [True: 6, False: 2.86k]
  |  Branch (1860:98): [True: 6, False: 2.86k]
  ------------------
 1861|     36|                           break;
 1862|     36|                        }
 1863|  2.89k|                     }
 1864|       |
 1865|   177k|                     if (ctx.current_indent() >= 0 && continuation_indent <= ctx.current_indent()) {
  ------------------
  |  Branch (1865:26): [True: 784, False: 177k]
  |  Branch (1865:55): [True: 488, False: 296]
  ------------------
 1866|    488|                        break;
 1867|    488|                     }
 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|   756k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1873:32): [True: 755k, False: 1.03k]
  |  Branch (1873:47): [True: 594k, False: 160k]
  |  Branch (1873:64): [True: 578k, False: 16.0k]
  ------------------
 1874|   578k|                           if (*scan == ':') {
  ------------------
  |  Branch (1874:32): [True: 32.0k, False: 546k]
  ------------------
 1875|  32.0k|                              auto after_colon = scan + 1;
 1876|  32.0k|                              const bool tight_key_colon =
 1877|  32.0k|                                 (scan == continuation) || (*(scan - 1) != ' ' && *(scan - 1) != '\t');
  ------------------
  |  Branch (1877:34): [True: 0, False: 32.0k]
  |  Branch (1877:61): [True: 29.3k, False: 2.72k]
  |  Branch (1877:83): [True: 29.2k, False: 64]
  ------------------
 1878|  32.0k|                              if (tight_key_colon &&
  ------------------
  |  Branch (1878:35): [True: 29.2k, False: 2.79k]
  ------------------
 1879|  29.2k|                                  (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1879:36): [True: 26, False: 29.2k]
  |  Branch (1879:58): [True: 10, False: 29.2k]
  |  Branch (1879:81): [True: 6, False: 29.2k]
  ------------------
 1880|  29.2k|                                   *after_colon == '\n' || *after_colon == '\r')) {
  ------------------
  |  Branch (1880:36): [True: 6, False: 29.2k]
  |  Branch (1880:60): [True: 6, False: 29.2k]
  ------------------
 1881|     54|                                 break;
 1882|     54|                              }
 1883|  32.0k|                           }
 1884|   578k|                           ++scan;
 1885|   578k|                        }
 1886|   177k|                        if (scan != end && *scan == ':') {
  ------------------
  |  Branch (1886:29): [True: 176k, False: 1.03k]
  |  Branch (1886:44): [True: 54, False: 176k]
  ------------------
 1887|     54|                           break;
 1888|     54|                        }
 1889|   177k|                     }
 1890|   177k|                  }
 1891|       |
 1892|  2.63M|                  if (!key.empty() && key.back() != ' ') {
  ------------------
  |  Branch (1892:23): [True: 2.06M, False: 574k]
  |  Branch (1892:39): [True: 642k, False: 1.41M]
  ------------------
 1893|   642k|                     key.push_back(' ');
 1894|   642k|                  }
 1895|  2.63M|                  it = continuation;
 1896|  2.63M|                  continue;
 1897|  2.63M|               }
 1898|  38.2M|               if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1898:20): [True: 36.3M, False: 1.86M]
  |  Branch (1898:32): [True: 3.36M, False: 33.0M]
  |  Branch (1898:44): [True: 208, False: 33.0M]
  |  Branch (1898:56): [True: 1.09M, False: 31.9M]
  ------------------
 1899|  33.7M|               if (c == '#') {
  ------------------
  |  Branch (1899:20): [True: 3.01M, False: 30.7M]
  ------------------
 1900|  3.01M|                  if (key.empty() || key.back() == ' ' || key.back() == '\t') break;
  ------------------
  |  Branch (1900:23): [True: 5.71k, False: 3.00M]
  |  Branch (1900:38): [True: 26.2k, False: 2.97M]
  |  Branch (1900:59): [True: 2.25k, False: 2.97M]
  ------------------
 1901|  3.01M|               }
 1902|       |
 1903|  33.7M|               if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1903:20): [True: 14.4k, False: 33.7M]
  ------------------
 1904|  14.4k|                  ctx.error = error_code::invalid_control_character;
 1905|  14.4k|                  return false;
 1906|  14.4k|               }
 1907|  33.7M|               key.push_back(c);
 1908|  33.7M|               ++it;
 1909|  33.7M|            }
 1910|       |
 1911|       |            // Trim trailing whitespace from key
 1912|  13.8M|            while (!key.empty() && (key.back() == ' ' || key.back() == '\t')) {
  ------------------
  |  Branch (1912:20): [True: 9.93M, False: 3.89M]
  |  Branch (1912:37): [True: 1.18M, False: 8.75M]
  |  Branch (1912:58): [True: 169k, False: 8.58M]
  ------------------
 1913|  1.35M|               key.pop_back();
 1914|  1.35M|            }
 1915|       |
 1916|       |            // Empty keys are valid YAML (":" in block or flow mappings).
 1917|  12.4M|         }
 1918|       |
 1919|  14.1M|         if (bool(ctx.error)) return false;
  ------------------
  |  Branch (1919:14): [True: 702, False: 14.1M]
  ------------------
 1920|       |
 1921|       |         // Implicit mapping keys must be single-line in both block and flow styles.
 1922|  14.1M|         if (quoted_key_spans_lines && !in_flow) {
  ------------------
  |  Branch (1922:14): [True: 16.4k, False: 14.1M]
  |  Branch (1922:40): [True: 84, False: 16.3k]
  ------------------
 1923|     84|            ctx.error = error_code::syntax_error;
 1924|     84|            return false;
 1925|     84|         }
 1926|       |
 1927|       |         // Store anchor on key if present
 1928|  14.1M|         if (has_key_anchor) {
  ------------------
  |  Branch (1928:14): [True: 2.14M, False: 11.9M]
  ------------------
 1929|  2.14M|            ctx.anchors[std::move(key_anchor_name)] = {key_start, &*it, ctx.current_indent()};
 1930|  2.14M|         }
 1931|       |
 1932|  14.1M|         return true;
 1933|  14.1M|      }
_ZZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_bENKUlNS0_8yaml_tagEE_clESI_:
 1585|  16.1M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1586|  16.1M|            if (tag == yaml_tag::unknown) {
  ------------------
  |  Branch (1586:17): [True: 112, False: 16.1M]
  ------------------
 1587|    112|               ctx.error = error_code::syntax_error;
 1588|    112|               return false;
 1589|    112|            }
 1590|  16.1M|            if (!tag_valid_for_string(tag)) {
  ------------------
  |  Branch (1590:17): [True: 104, False: 16.1M]
  ------------------
 1591|    104|               ctx.error = error_code::syntax_error;
 1592|    104|               return false;
 1593|    104|            }
 1594|  16.1M|            return true;
 1595|  16.1M|         };
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  7.27M|      {
  275|  7.27M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  7.27M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  7.27M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  7.27M|      }
_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|  10.6M|      {
 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|  10.6M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  10.6M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  10.6M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  10.6M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  10.6M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 10.6M]
  ------------------
 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|  10.6M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 8.62M, False: 2.00M]
  ------------------
 5769|  8.62M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  8.62M|         }
 5771|  2.00M|         else {
 5772|  2.00M|            yaml::skip_inline_ws(it, end);
 5773|  2.00M|         }
 5774|       |
 5775|  10.6M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 108, False: 10.6M]
  ------------------
 5776|    108|            ctx.error = error_code::unexpected_end;
 5777|    108|            return;
 5778|    108|         }
 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|  10.6M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  10.6M|            using V = std::remove_cvref_t<T>;
 5886|  10.6M|            using counts = yaml_variant_type_count<V>;
 5887|  10.6M|            const char c = *it;
 5888|  10.6M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  10.6M|               switch (ch) {
 5890|  10.6M|               case ' ':
 5891|  10.6M|               case '\t':
 5892|  10.6M|               case '\n':
 5893|  10.6M|               case '\r':
 5894|  10.6M|               case ',':
 5895|  10.6M|               case ']':
 5896|  10.6M|               case '}':
 5897|  10.6M|                  return true;
 5898|  10.6M|               default:
 5899|  10.6M|                  return false;
 5900|  10.6M|               }
 5901|  10.6M|            };
 5902|       |
 5903|  10.6M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  10.6M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  10.6M|                  return false;
 5906|  10.6M|               }
 5907|  10.6M|               if (ctx.current_indent() < 0) {
 5908|  10.6M|                  return false;
 5909|  10.6M|               }
 5910|  10.6M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  10.6M|                  return false;
 5912|  10.6M|               }
 5913|       |
 5914|  10.6M|               auto look = word_end;
 5915|  10.6M|               yaml::skip_newline(look, end);
 5916|  10.6M|               while (look != end) {
 5917|  10.6M|                  int32_t line_indent = 0;
 5918|  10.6M|                  while (look != end && *look == ' ') {
 5919|  10.6M|                     ++line_indent;
 5920|  10.6M|                     ++look;
 5921|  10.6M|                  }
 5922|  10.6M|                  if (look != end && *look == '\t') {
 5923|  10.6M|                     return false;
 5924|  10.6M|                  }
 5925|  10.6M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  10.6M|                     if (look != end) {
 5927|  10.6M|                        yaml::skip_newline(look, end);
 5928|  10.6M|                        continue;
 5929|  10.6M|                     }
 5930|  10.6M|                     return false;
 5931|  10.6M|                  }
 5932|  10.6M|                  if (*look == '#') {
 5933|  10.6M|                     yaml::skip_comment(look, end);
 5934|  10.6M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  10.6M|                        yaml::skip_newline(look, end);
 5936|  10.6M|                        continue;
 5937|  10.6M|                     }
 5938|  10.6M|                     return false;
 5939|  10.6M|                  }
 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|  10.6M|                  {
 5945|  10.6M|                     auto scan = look;
 5946|  10.6M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  10.6M|                        if (*scan == ':') {
 5948|  10.6M|                           auto after_colon = scan + 1;
 5949|  10.6M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  10.6M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  10.6M|                              return false;
 5952|  10.6M|                           }
 5953|  10.6M|                        }
 5954|  10.6M|                        ++scan;
 5955|  10.6M|                     }
 5956|  10.6M|                  }
 5957|       |
 5958|  10.6M|                  return line_indent > ctx.current_indent();
 5959|  10.6M|               }
 5960|  10.6M|               return false;
 5961|  10.6M|            };
 5962|  10.6M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  10.6M|               if (ptr == end) {
 5964|  10.6M|                  return true;
 5965|  10.6M|               }
 5966|  10.6M|               if (*ptr == ':') {
 5967|  10.6M|                  auto next = ptr + 1;
 5968|  10.6M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  10.6M|               }
 5970|  10.6M|               return is_plain_scalar_boundary(*ptr);
 5971|  10.6M|            };
 5972|       |
 5973|  10.6M|            switch (c) {
 5974|  2.80M|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 2.80M, False: 7.83M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|  2.80M|               ++it;
 5977|  2.80M|               auto aname = yaml::parse_anchor_name(it, end);
 5978|  2.80M|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 78, False: 2.80M]
  ------------------
 5979|     78|                  ctx.error = error_code::syntax_error;
 5980|     78|                  return;
 5981|     78|               }
 5982|  2.80M|               yaml::skip_inline_ws(it, end);
 5983|  2.80M|               bool anchor_on_same_line = true;
 5984|  2.80M|               bool value_is_indentless_sequence = false;
 5985|  2.80M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 11.2k, False: 2.79M]
  |  Branch (5985:33): [True: 77.2k, False: 2.71M]
  |  Branch (5985:48): [True: 184k, False: 2.52M]
  |  Branch (5985:63): [True: 27.5k, False: 2.50M]
  ------------------
 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|   300k|                  bool value_on_next_line = false;
 5989|   300k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 289k, False: 11.2k]
  ------------------
 5990|   289k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|   289k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 27.5k, False: 261k]
  ------------------
 5993|   133k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 133k, False: 10]
  |  Branch (5993:47): [True: 118k, False: 15.8k]
  |  Branch (5993:64): [True: 106k, False: 11.6k]
  ------------------
 5994|  27.5k|                     }
 5995|       |                     // Skip newline
 5996|   289k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 289k, False: 10]
  |  Branch (5996:42): [True: 93.1k, False: 196k]
  |  Branch (5996:59): [True: 196k, False: 0]
  ------------------
 5997|   289k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   396k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 390k, False: 5.84k]
  |  Branch (5999:48): [True: 33.6k, False: 356k]
  |  Branch (5999:65): [True: 72.9k, False: 283k]
  ------------------
 6000|   106k|                           yaml::skip_newline(peek, end);
 6001|   106k|                        }
 6002|       |                        // Measure indent of next content line
 6003|   289k|                        int32_t next_indent = 0;
 6004|   552k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 543k, False: 8.98k]
  |  Branch (6004:47): [True: 263k, False: 280k]
  ------------------
 6005|   263k|                           ++next_indent;
 6006|   263k|                           ++peek;
 6007|   263k|                        }
 6008|   289k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 280k, False: 8.98k]
  |  Branch (6008:44): [True: 276k, False: 3.52k]
  |  Branch (6008:61): [True: 275k, False: 1.81k]
  ------------------
 6009|   275k|                           const bool indentless_sequence =
 6010|   275k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 273k, False: 1.92k]
  |  Branch (6010:69): [True: 108k, False: 164k]
  ------------------
 6011|   108k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 3.60k, False: 105k]
  ------------------
 6012|   105k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 103k, False: 1.31k]
  ------------------
 6013|   107k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 5.46k, False: 102k]
  ------------------
 6014|   102k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 78.6k, False: 23.4k]
  |  Branch (6014:61): [True: 77.5k, False: 1.19k]
  ------------------
 6015|   275k|                           value_is_indentless_sequence = indentless_sequence;
 6016|   275k|                           const bool same_indent_property_node =
 6017|   275k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 22.5k, False: 252k]
  ------------------
 6018|  22.5k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 1.10k, False: 21.4k]
  |  Branch (6018:48): [True: 3.69k, False: 17.7k]
  |  Branch (6018:64): [True: 278, False: 17.5k]
  |  Branch (6018:80): [True: 378, False: 17.1k]
  |  Branch (6018:96): [True: 1.21k, False: 15.9k]
  ------------------
 6019|  15.9k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 906, False: 15.0k]
  |  Branch (6019:48): [True: 1.21k, False: 13.8k]
  |  Branch (6019:65): [True: 750, False: 13.0k]
  |  Branch (6019:81): [True: 1.20k, False: 11.8k]
  ------------------
 6020|   275k|                           value_on_next_line =
 6021|   275k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 155k, False: 119k]
  |  Branch (6021:71): [True: 82.9k, False: 36.5k]
  |  Branch (6021:94): [True: 10.7k, False: 25.7k]
  ------------------
 6022|   275k|                        }
 6023|   289k|                     }
 6024|   289k|                  }
 6025|   300k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 51.3k, False: 249k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  51.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  51.3k|                     return;
 6029|  51.3k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|   249k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 19.6k, False: 229k]
  ------------------
 6032|  98.1k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 98.1k, False: 0]
  |  Branch (6032:42): [True: 83.1k, False: 14.9k]
  |  Branch (6032:57): [True: 78.4k, False: 4.76k]
  ------------------
 6033|  19.6k|                  }
 6034|   249k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 249k, False: 0]
  ------------------
 6035|   333k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 333k, False: 0]
  |  Branch (6035:40): [True: 21.4k, False: 312k]
  |  Branch (6035:55): [True: 62.9k, False: 249k]
  ------------------
 6036|  84.4k|                     yaml::skip_newline(it, end);
 6037|  84.4k|                  }
 6038|   249k|                  yaml::skip_inline_ws(it, end);
 6039|   249k|                  anchor_on_same_line = false;
 6040|   249k|               }
 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.75M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 2.75M, False: 6]
  |  Branch (6053:33): [True: 746, False: 2.74M]
  |  Branch (6053:47): [True: 24, False: 722]
  ------------------
 6054|     24|                  ctx.error = error_code::syntax_error;
 6055|     24|                  return;
 6056|     24|               }
 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.75M|               const char* anchor_start = &*it;
 6078|  2.75M|               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.75M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|  2.75M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|  2.75M|               redispatch<Opts>(value, ctx, it, end);
 6174|  2.75M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|  2.75M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 2.74M, False: 6.93k]
  ------------------
 6176|  2.74M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|  2.74M|               }
 6178|  2.75M|               return;
 6179|  2.75M|            }
 6180|   573k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 573k, False: 10.0M]
  ------------------
 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|   573k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   573k|               return;
 6199|  2.75M|            }
 6200|   914k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 914k, False: 9.72M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   914k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   914k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 46, False: 914k]
  ------------------
 6204|     46|                  ctx.error = error_code::syntax_error;
 6205|     46|                  return;
 6206|     46|               }
 6207|   914k|               yaml::skip_inline_ws(it, end);
 6208|   914k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 911k, False: 2.80k]
  |  Branch (6208:33): [True: 20.9k, False: 890k]
  ------------------
 6209|  20.9k|                  yaml::skip_comment(it, end);
 6210|  20.9k|               }
 6211|   914k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 910k, False: 4.04k]
  |  Branch (6211:34): [True: 35.9k, False: 874k]
  |  Branch (6211:49): [True: 71.5k, False: 803k]
  ------------------
 6212|   107k|                  auto content = it;
 6213|   107k|                  yaml::skip_newline(content, end);
 6214|   107k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|   107k|                  bool consume_following_content = false;
 6217|   107k|                  auto content_token = content;
 6218|   107k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 102k, False: 5.26k]
  ------------------
 6219|   102k|                     auto indent_probe = content;
 6220|   102k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|   102k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 6, False: 102k]
  ------------------
 6222|      6|                        return;
 6223|   102k|                     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|   102k|                     bool tagged_indentless_sequence = false;
 6228|   102k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 11.2k, False: 91.0k]
  |  Branch (6228:56): [True: 11.2k, False: 0]
  |  Branch (6228:79): [True: 10.4k, False: 792]
  ------------------
 6229|  10.4k|                        const auto after_dash = indent_probe + 1;
 6230|  10.4k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 858, False: 9.56k]
  ------------------
 6231|  10.2k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 9.35k, False: 210]
  ------------------
 6232|  10.2k|                           tagged_indentless_sequence =
 6233|  10.2k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 1.15k, False: 9.06k]
  ------------------
 6234|  9.06k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 5.07k, False: 3.98k]
  |  Branch (6234:60): [True: 408, False: 4.66k]
  ------------------
 6235|  10.2k|                        }
 6236|  10.4k|                     }
 6237|       |
 6238|   102k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 41.4k, False: 60.7k]
  ------------------
 6239|  60.7k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 35.0k, False: 25.6k]
  |  Branch (6239:93): [True: 1.56k, False: 24.0k]
  ------------------
 6240|   102k|                  }
 6241|       |
 6242|   107k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 78.1k, False: 29.3k]
  ------------------
 6243|  78.1k|                     it = content_token;
 6244|  78.1k|                  }
 6245|  29.3k|                  else {
 6246|  29.3k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 1.31k, False: 28.0k]
  ------------------
 6247|  1.31k|                        if constexpr (counts::n_str > 0) {
 6248|  1.31k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  1.31k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  1.31k|                           value = StrType{};
 6251|  1.31k|                           return;
 6252|  1.31k|                        }
 6253|  1.31k|                     }
 6254|  29.3k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 550, False: 28.8k]
  ------------------
 6255|    550|                        if constexpr (counts::n_null > 0) {
 6256|    550|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    550|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    550|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 550]
  ------------------
 6259|    550|                           return;
 6260|    550|                        }
 6261|    550|                     }
 6262|  29.3k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 19.3k, False: 10.0k]
  ------------------
 6263|  19.3k|                        if constexpr (counts::n_null > 0) {
 6264|  19.3k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  19.3k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  19.3k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 19.3k]
  ------------------
 6267|  19.3k|                           return;
 6268|  19.3k|                        }
 6269|  19.3k|                     }
 6270|  29.3k|                  }
 6271|   107k|               }
 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|   914k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 4.04k, False: 910k]
  ------------------
 6293|  4.04k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 1.91k, False: 2.13k]
  ------------------
 6294|  1.91k|                     if constexpr (counts::n_str > 0) {
 6295|  1.91k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|  1.91k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|  1.91k|                        value = StrType{};
 6298|  1.91k|                        return;
 6299|  1.91k|                     }
 6300|  1.91k|                  }
 6301|  4.04k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 2.12k, False: 1.91k]
  ------------------
 6302|  2.12k|                     if constexpr (counts::n_null > 0) {
 6303|  2.12k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  2.12k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  2.12k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 2.12k]
  ------------------
 6306|  2.12k|                        return;
 6307|  2.12k|                     }
 6308|  2.12k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  4.04k|                  return;
 6311|  4.04k|               }
 6312|   910k|               switch (tag) {
 6313|    998|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 998, False: 909k]
  ------------------
 6314|    998|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|    998|                  return;
 6316|  4.89k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 4.89k, False: 905k]
  ------------------
 6317|  13.9k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 9.03k, False: 901k]
  ------------------
 6318|  13.9k|                  if constexpr (counts::n_num > 0) {
 6319|  13.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  13.9k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  48.2k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 34.2k, False: 876k]
  ------------------
 6327|  48.2k|                  if constexpr (counts::n_bool > 0) {
 6328|  48.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  48.2k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  50.4k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 2.19k, False: 908k]
  ------------------
 6336|  50.4k|                  if constexpr (counts::n_null > 0) {
 6337|  50.4k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  50.4k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  50.4k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 50.4k]
  ------------------
 6340|  50.4k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  50.4k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|   157k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 106k, False: 803k]
  ------------------
 6348|   157k|                  if constexpr (counts::n_object > 0) {
 6349|   157k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|   157k|                                                                                                     end);
 6351|   157k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|   249k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 92.1k, False: 818k]
  ------------------
 6358|   249k|                  if constexpr (counts::n_array > 0) {
 6359|   249k|                     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|   249k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|   249k|                                                                                                    end);
 6367|   249k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|   249k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   888k|               default: {
  ------------------
  |  Branch (6374:16): [True: 639k, False: 271k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   888k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 639k, False: 249k]
  |  Branch (6377:36): [True: 219k, False: 419k]
  ------------------
 6378|   219k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|   219k|                     return;
 6380|   219k|                  }
 6381|       |
 6382|   668k|                  if constexpr (counts::n_array > 0) {
 6383|   668k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 419k, False: 249k]
  |  Branch (6383:39): [True: 1.31k, False: 417k]
  ------------------
 6384|  1.31k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  1.31k|                                                                                                       end);
 6386|  1.31k|                        return;
 6387|  1.31k|                     }
 6388|   668k|                  }
 6389|   668k|                  if constexpr (counts::n_object > 0) {
 6390|   668k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 417k, False: 250k]
  |  Branch (6390:39): [True: 2.93k, False: 414k]
  ------------------
 6391|  2.93k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  2.93k|                                                                                                        end);
 6393|  2.93k|                        return;
 6394|  2.93k|                     }
 6395|   668k|                  }
 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|   668k|                  if constexpr (counts::n_str > 0) {
 6426|   668k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   668k|                     return;
 6428|   668k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   668k|                  return;
 6433|   888k|               }
 6434|   910k|               }
 6435|      0|               return;
 6436|   910k|            }
 6437|  2.75M|            case '{':
  ------------------
  |  Branch (6437:13): [True: 2.75M, False: 7.88M]
  ------------------
 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.75M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  2.75M|               return;
 6449|   134k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 134k, False: 10.5M]
  ------------------
 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|   134k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|   134k|               return;
 6461|   469k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 469k, False: 10.1M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   469k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 469k, False: 472]
  |  Branch (6463:39): [True: 6, False: 469k]
  ------------------
 6464|      6|                  ctx.error = error_code::syntax_error;
 6465|      6|                  return;
 6466|      6|               }
 6467|   469k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 469k, False: 472]
  |  Branch (6467:40): [True: 118k, False: 350k]
  |  Branch (6467:56): [True: 261k, False: 89.6k]
  |  Branch (6467:73): [True: 41.2k, False: 48.4k]
  ------------------
 6468|   420k|                  if constexpr (counts::n_object > 0) {
 6469|   420k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   420k|                                                                                                     end);
 6471|   420k|                     return;
 6472|   420k|                  }
 6473|   420k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   469k|               return;
 6476|     12|            case '%':
  ------------------
  |  Branch (6476:13): [True: 12, False: 10.6M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     12|               ctx.error = error_code::syntax_error;
 6479|     12|               return;
 6480|  35.8k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 35.8k, False: 10.6M]
  ------------------
 6481|  47.0k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 11.2k, False: 10.6M]
  ------------------
 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|  47.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  47.0k|               return;
 6486|  28.7k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 28.7k, False: 10.6M]
  ------------------
 6487|   162k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 133k, False: 10.5M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|   162k|               if constexpr (counts::n_bool > 0) {
 6490|   162k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 160k, False: 1.44k]
  |  Branch (6490:44): [True: 133k, False: 27.8k]
  |  Branch (6490:60): [True: 131k, False: 1.17k]
  |  Branch (6490:76): [True: 125k, False: 5.99k]
  ------------------
 6491|   126k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 3.20k, False: 31.8k]
  |  Branch (6491:60): [True: 1.40k, False: 1.80k]
  |  Branch (6491:76): [True: 1.05k, False: 350]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|   126k|                     const auto after_true = it + 4;
 6494|   126k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|   126k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 126k, False: 918]
  ------------------
 6497|   126k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 0, False: 126k]
  ------------------
 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|   126k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 125k, False: 462]
  |  Branch (6503:47): [True: 116k, False: 8.96k]
  ------------------
 6504|   116k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 524, False: 116k]
  |  Branch (6504:47): [True: 110k, False: 5.83k]
  |  Branch (6504:63): [True: 4.33k, False: 1.50k]
  |  Branch (6504:80): [True: 488, False: 1.01k]
  |  Branch (6504:97): [True: 1.01k, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|   116k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|   116k|                           return;
 6508|   116k|                        }
 6509|  9.43k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  9.43k|                                                                                                      end);
 6511|  9.43k|                        return;
 6512|   126k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|   126k|                  }
 6515|   162k|               }
 6516|  36.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|   162k|               return;
 6518|  92.1k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 92.1k, False: 10.5M]
  ------------------
 6519|   127k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 35.7k, False: 10.6M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|   127k|               if constexpr (counts::n_bool > 0) {
 6522|   127k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 127k, False: 752]
  |  Branch (6522:44): [True: 50.5k, False: 76.6k]
  |  Branch (6522:60): [True: 32.8k, False: 17.6k]
  |  Branch (6522:76): [True: 29.7k, False: 3.02k]
  |  Branch (6522:92): [True: 28.5k, False: 1.19k]
  ------------------
 6523|  98.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 4.92k, False: 93.6k]
  |  Branch (6523:60): [True: 3.13k, False: 1.78k]
  |  Branch (6523:76): [True: 1.78k, False: 1.35k]
  |  Branch (6523:92): [True: 1.07k, False: 706]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  29.6k|                     const auto after_false = it + 5;
 6526|  29.6k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  29.6k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 24.6k, False: 4.97k]
  ------------------
 6529|  24.6k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 0, False: 24.6k]
  ------------------
 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|  24.6k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 23.5k, False: 1.11k]
  |  Branch (6535:47): [True: 18.5k, False: 5.06k]
  ------------------
 6536|  18.5k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 1.08k, False: 17.4k]
  |  Branch (6536:47): [True: 970, False: 16.4k]
  |  Branch (6536:63): [True: 6.53k, False: 9.92k]
  |  Branch (6536:80): [True: 7.01k, False: 2.91k]
  |  Branch (6536:97): [True: 2.91k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  18.5k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  18.5k|                           return;
 6540|  18.5k|                        }
 6541|  6.17k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  6.17k|                                                                                                      end);
 6543|  6.17k|                        return;
 6544|  24.6k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  29.6k|                  }
 6547|   127k|               }
 6548|   103k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|   127k|               return;
 6550|  69.2k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 69.2k, False: 10.5M]
  ------------------
 6551|  92.4k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 23.2k, False: 10.6M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  92.4k|               if constexpr (counts::n_null > 0) {
 6554|  92.4k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 91.1k, False: 1.35k]
  |  Branch (6554:44): [True: 62.4k, False: 28.6k]
  |  Branch (6554:60): [True: 51.2k, False: 11.2k]
  |  Branch (6554:76): [True: 49.0k, False: 2.19k]
  ------------------
 6555|  55.3k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 8.11k, False: 33.9k]
  |  Branch (6555:60): [True: 7.39k, False: 724]
  |  Branch (6555:76): [True: 6.26k, False: 1.13k]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  55.3k|                     const auto after_null = it + 4;
 6558|  55.3k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  55.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 44.6k, False: 10.7k]
  ------------------
 6561|  44.6k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 0, False: 44.6k]
  ------------------
 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.6k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 43.7k, False: 864]
  |  Branch (6567:47): [True: 21.0k, False: 22.6k]
  ------------------
 6568|  21.0k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 298, False: 20.7k]
  |  Branch (6568:47): [True: 410, False: 20.3k]
  |  Branch (6568:63): [True: 18.2k, False: 2.10k]
  |  Branch (6568:80): [True: 570, False: 1.53k]
  |  Branch (6568:97): [True: 1.53k, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  21.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  21.0k|                           return;
 6572|  21.0k|                        }
 6573|  23.5k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  23.5k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  23.5k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 23.5k]
  ------------------
 6576|  23.5k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  23.5k|                        return;
 6578|  44.6k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  55.3k|                  }
 6581|  92.4k|               }
 6582|  47.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  92.4k|               return;
 6584|  2.75k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 2.75k, False: 10.6M]
  ------------------
 6585|       |               // Null indicator
 6586|  2.75k|               if constexpr (counts::n_null > 0) {
 6587|  2.75k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  2.75k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  2.75k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 2.75k]
  ------------------
 6590|  2.75k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  2.75k|                  return;
 6592|  2.75k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   351k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 351k, False: 10.2M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   351k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 5.56k, False: 346k]
  |  Branch (6596:41): [True: 230k, False: 115k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   236k|                  if constexpr (counts::n_array > 0) {
 6599|   236k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   236k|                                                                                                    end);
 6601|   236k|                     return;
 6602|   236k|                  }
 6603|   236k|               }
 6604|   351k|               if constexpr (counts::n_num > 0) {
 6605|   351k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 115k, False: 236k]
  |  Branch (6605:43): [True: 6.60k, False: 109k]
  |  Branch (6605:94): [True: 5.22k, False: 103k]
  ------------------
 6606|  11.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  11.8k|                     return;
 6608|  11.8k|                  }
 6609|   351k|               }
 6610|   339k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   351k|               return;
 6612|  54.8k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 54.8k, False: 10.5M]
  ------------------
 6613|   123k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 68.5k, False: 10.5M]
  ------------------
 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|   123k|               if constexpr (counts::n_num > 0) {
 6617|   123k|                  auto start_it = it;
 6618|   123k|                  auto temp_ctx = ctx.make_speculative();
 6619|   123k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|   123k|                                                                                               end);
 6621|   123k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|   123k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|   123k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 9.06k, False: 114k]
  ------------------
 6624|  9.06k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  9.06k|                     return; // Successfully parsed as number
 6626|  9.06k|                  }
 6627|   114k|                  it = start_it; // Restore and fall through to string
 6628|   114k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|   123k|               return;
 6631|  2.08M|            default:
  ------------------
  |  Branch (6631:13): [True: 2.08M, False: 8.55M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|  2.08M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 1.63M, False: 448k]
  |  Branch (6633:32): [True: 1.02M, False: 611k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  1.02M|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 48.8k, False: 975k]
  ------------------
 6636|  48.8k|                     return;
 6637|  48.8k|                  }
 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: 798k, False: 176k]
  ------------------
 6647|   798k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|   798k|                        return; // Successfully parsed as number
 6649|   798k|                     }
 6650|   176k|                     it = start_it; // Restore and fall through to string
 6651|   176k|                  }
 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.02M|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|  1.06M|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|  1.06M|               return;
 6659|  10.6M|            }
 6660|  10.6M|         }
 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|  10.6M|         error_code expansion_error{};
 6670|  10.6M|         std::string_view expansion_message{};
 6671|       |
 6672|  10.6M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  10.6M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  10.6M|            auto start = it;
 6675|       |
 6676|  10.6M|            V v{};
 6677|  10.6M|            auto temp_ctx = ctx.make_speculative();
 6678|  10.6M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  10.6M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  10.6M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  10.6M|            if (!bool(temp_ctx.error)) {
 6683|  10.6M|               value = std::move(v);
 6684|  10.6M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  10.6M|               return true;
 6686|  10.6M|            }
 6687|       |
 6688|  10.6M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  10.6M|               expansion_error = temp_ctx.error;
 6690|  10.6M|               expansion_message = temp_ctx.custom_error_message;
 6691|  10.6M|            }
 6692|  10.6M|            it = start;
 6693|  10.6M|            return false;
 6694|  10.6M|         };
 6695|       |
 6696|  10.6M|         bool parsed = false;
 6697|  10.6M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  10.6M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  10.6M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  10.6M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 10.6M]
  ------------------
 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|  10.6M|      }
_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.75M|      {
 6718|  2.75M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|  2.75M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 482, False: 2.74M]
  ------------------
 6720|    482|            return;
 6721|  2.74M|         op<Opts>(value, ctx, it, end);
 6722|  2.74M|      }
_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|   793k|      {
  301|   793k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 793k]
  |  Branch (301:27): [True: 0, False: 793k]
  ------------------
  302|       |
  303|   793k|         ++it; // skip '*'
  304|   793k|         auto name = parse_anchor_name(it, end);
  305|   793k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 38, False: 793k]
  ------------------
  306|     38|            ctx.error = error_code::syntax_error;
  307|     38|            return true;
  308|     38|         }
  309|       |
  310|   793k|         auto anchor_it = ctx.anchors.find(name);
  311|   793k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 66, False: 793k]
  ------------------
  312|     66|            ctx.error = error_code::syntax_error; // undefined alias
  313|     66|            return true;
  314|     66|         }
  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|   793k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   793k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 178k, False: 614k]
  ------------------
  322|   178k|            return true;
  323|   178k|         }
  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|   614k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 390, False: 613k]
  ------------------
  329|    390|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    390|            return true;
  331|    390|         }
  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|   613k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   613k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 613k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   613k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 46, False: 613k]
  ------------------
  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|   613k|         auto replay_it = span.begin;
  348|   613k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   613k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   613k|         ctx.indent_stack.clear();
  353|   613k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 35.8k, False: 577k]
  ------------------
  354|  35.8k|            ctx.push_indent(span.base_indent - 1);
  355|  35.8k|         }
  356|       |
  357|   613k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   613k|         using V = std::remove_cvref_t<T>;
  360|   613k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   613k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   613k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   613k|         return true;
  367|   613k|      }
_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.60M|      {
 5311|  1.60M|         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.60M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  1.60M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  1.60M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  1.60M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 1.60M, False: 0]
  ------------------
 5321|  1.60M|            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.60M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|  1.64M|      {
 1961|  1.64M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 4.40k, False: 1.63M]
  ------------------
 1962|  4.40k|            return;
 1963|       |
 1964|  1.63M|         yaml::node_preamble_state preamble{};
 1965|  1.63M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 37.5k, False: 1.60M]
  ------------------
 1966|  1.63M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  37.5k|            return;
 1968|       |
 1969|  1.60M|         std::string str;
 1970|  1.60M|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|  1.60M|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 1.60M, False: 0]
  ------------------
 1973|  19.9k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 19.9k, False: 1.58M]
  ------------------
 1974|  19.9k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  19.9k|            break;
 1976|  3.77k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 3.77k, False: 1.59M]
  ------------------
 1977|  3.77k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  3.77k|            break;
 1979|  2.44k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 2.44k, False: 1.59M]
  ------------------
 1980|  7.71k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 5.26k, False: 1.59M]
  ------------------
 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|  7.71k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  7.71k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 2.37k, False: 5.33k]
  ------------------
 1986|  7.71k|            break;
 1987|  1.57M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 1.57M, False: 31.4k]
  ------------------
 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.57M|            else {
 2000|  1.57M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|  1.57M|            }
 2002|  1.57M|            break;
 2003|  1.60M|         }
 2004|       |
 2005|  1.60M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 1.60M, False: 190]
  ------------------
 2006|  1.60M|            value = std::move(str);
 2007|  1.60M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|  1.60M|         }
 2009|  1.60M|      }
_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.63M|      {
  466|  1.63M|         skip_inline_ws(it, end);
  467|       |
  468|  1.63M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 1.63M]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|  1.63M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.63M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 10, False: 1.63M]
  ------------------
  477|     10|            ctx.error = error_code::syntax_error;
  478|     10|            return true;
  479|     10|         }
  480|  1.63M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.63M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.63M|         skip_inline_ws(it, end);
  486|       |
  487|  1.63M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.63M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.63M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 37.5k, False: 1.60M]
  ------------------
  495|  37.5k|            return true;
  496|  37.5k|         }
  497|       |
  498|  1.60M|         return false;
  499|  1.63M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|  1.63M|                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.63M|      {
  409|  1.63M|         state.has_anchor = false;
  410|  1.63M|         state.anchor_name.clear();
  411|  1.63M|         state.anchor_start = nullptr;
  412|  1.63M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.63M|         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.63M|            else {
  421|  1.63M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 37.4k, False: 1.60M]
  ------------------
  422|  1.63M|            }
  423|  1.63M|         }
  424|       |
  425|  1.63M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.60M, False: 37.4k]
  |  Branch (425:27): [True: 64.2k, False: 1.53M]
  ------------------
  426|  64.2k|            ++it;
  427|  64.2k|            auto name = parse_anchor_name(it, end);
  428|  64.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 26, False: 64.2k]
  ------------------
  429|     26|               ctx.error = error_code::syntax_error;
  430|     26|               return true;
  431|     26|            }
  432|  64.2k|            skip_inline_ws(it, end);
  433|  64.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 64.2k]
  ------------------
  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|  64.2k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  64.2k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 64.1k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  64.2k|            }
  445|  64.1k|            state.has_anchor = true;
  446|  64.2k|            state.anchor_name = std::string(name);
  447|  64.2k|            state.anchor_start = &*it;
  448|  64.2k|         }
  449|       |
  450|  1.63M|         return false;
  451|  1.63M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  1.63M|      {
  301|  1.63M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.63M]
  |  Branch (301:27): [True: 1.60M, False: 37.4k]
  ------------------
  302|       |
  303|  37.4k|         ++it; // skip '*'
  304|  37.4k|         auto name = parse_anchor_name(it, end);
  305|  37.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 37.4k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|  37.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  37.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 34, False: 37.4k]
  ------------------
  312|     34|            ctx.error = error_code::syntax_error; // undefined alias
  313|     34|            return true;
  314|     34|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  37.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  37.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.01k, False: 35.4k]
  ------------------
  322|  2.01k|            return true;
  323|  2.01k|         }
  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|  35.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 35.4k]
  ------------------
  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|  35.4k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  35.4k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 22, False: 35.3k]
  ------------------
  339|     22|            return true;
  340|       |
  341|  35.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 28, False: 35.3k]
  ------------------
  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|  35.3k|         auto replay_it = span.begin;
  348|  35.3k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  35.3k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  35.3k|         ctx.indent_stack.clear();
  353|  35.3k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 14.0k, False: 21.3k]
  ------------------
  354|  14.0k|            ctx.push_indent(span.base_indent - 1);
  355|  14.0k|         }
  356|       |
  357|  35.3k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  35.3k|         using V = std::remove_cvref_t<T>;
  360|  35.3k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  35.3k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  35.3k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  35.3k|         return true;
  367|  35.3k|      }
_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.13M|      {
 2116|  1.13M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 1.13M]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  1.13M|         yaml::node_preamble_state preamble{};
 2120|  1.13M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 12.2k, False: 1.12M]
  ------------------
 2121|  1.13M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  1.13M|                   return yaml::tag_valid_for_float(tag);
 2123|  1.13M|                }
 2124|  1.13M|                else {
 2125|  1.13M|                   return yaml::tag_valid_for_int(tag);
 2126|  1.13M|                }
 2127|  1.13M|             }))
 2128|  12.2k|            return;
 2129|       |
 2130|  1.12M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  1.12M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  1.12M|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  1.12M|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 71.6k, False: 1.04M]
  ------------------
 2138|  71.6k|               ++it;
 2139|  71.6k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 65.5k, False: 6.05k]
  |  Branch (2139:38): [True: 2.11k, False: 63.4k]
  |  Branch (2139:74): [True: 632, False: 62.8k]
  ------------------
 2140|  62.8k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 742, False: 62.0k]
  ------------------
 2141|  3.48k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  3.48k|                  it += 3;
 2143|  3.48k|                  finalize();
 2144|  3.48k|                  return;
 2145|  3.48k|               }
 2146|  68.1k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 62.0k, False: 6.05k]
  |  Branch (2146:38): [True: 1.85k, False: 60.2k]
  |  Branch (2146:74): [True: 840, False: 59.3k]
  ------------------
 2147|  59.3k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 2.14k, False: 57.2k]
  ------------------
 2148|  4.84k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  4.84k|                  it += 3;
 2150|  4.84k|                  finalize();
 2151|  4.84k|                  return;
 2152|  4.84k|               }
 2153|  63.3k|               it = start;
 2154|  63.3k|            }
 2155|       |
 2156|  1.11M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 12.4k, False: 1.10M]
  |  Branch (2156:31): [True: 54.8k, False: 1.04M]
  ------------------
 2157|  67.2k|               const char sign = *it;
 2158|  67.2k|               ++it;
 2159|  67.2k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 66.7k, False: 524]
  |  Branch (2159:33): [True: 10.7k, False: 55.9k]
  ------------------
 2160|  10.7k|                  ++it;
 2161|  10.7k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 9.21k, False: 1.55k]
  |  Branch (2161:41): [True: 3.02k, False: 6.19k]
  |  Branch (2161:77): [True: 1.78k, False: 4.40k]
  ------------------
 2162|  7.68k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 2.86k, False: 1.53k]
  ------------------
 2163|  7.68k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 5.12k, False: 2.55k]
  ------------------
 2164|  5.12k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  5.12k|                     }
 2166|  2.55k|                     else {
 2167|  2.55k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  2.55k|                     }
 2169|  7.68k|                     it += 3;
 2170|  7.68k|                     finalize();
 2171|  7.68k|                     return;
 2172|  7.68k|                  }
 2173|  10.7k|               }
 2174|  59.6k|               it = start;
 2175|  59.6k|            }
 2176|  1.11M|         }
 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|  81.6M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 81.6M, False: 21.1k]
  ------------------
 2183|  81.6M|            const char c = *it;
 2184|  81.6M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 49.2k, False: 81.6M]
  |  Branch (2184:29): [True: 47.0k, False: 81.5M]
  |  Branch (2184:42): [True: 51.9k, False: 81.5M]
  |  Branch (2184:55): [True: 10.6k, False: 81.5M]
  |  Branch (2184:68): [True: 878k, False: 80.6M]
  |  Branch (2184:80): [True: 11.1k, False: 80.6M]
  |  Branch (2184:92): [True: 4.10k, False: 80.6M]
  |  Branch (2184:104): [True: 32.1k, False: 80.5M]
  ------------------
 2185|  1.08M|               break;
 2186|  1.08M|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  80.5M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 26.2M, False: 54.3M]
  ------------------
 2189|  26.2M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 2.90k, False: 26.2M]
  |  Branch (2189:39): [True: 9.63k, False: 26.2M]
  |  Branch (2189:59): [True: 648, False: 26.2M]
  |  Branch (2189:80): [True: 1.07k, False: 26.2M]
  |  Branch (2189:101): [True: 986, False: 26.2M]
  ------------------
 2190|  15.2k|                  break;
 2191|  15.2k|               }
 2192|  26.2M|            }
 2193|  80.5M|            ++it;
 2194|  80.5M|         }
 2195|       |
 2196|  1.12M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  1.12M|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 864, False: 1.11M]
  ------------------
 2199|    864|            ctx.error = error_code::parse_number_failure;
 2200|    864|            return;
 2201|    864|         }
 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: 16.0k]
  |  Branch (2256:37): [True: 52.2k, False: 1.05M]
  |  Branch (2256:62): [True: 7.32k, False: 1.04M]
  ------------------
 2257|  59.6k|               negative = (digits.front() == '-');
 2258|  59.6k|               digits.remove_prefix(1);
 2259|  59.6k|            }
 2260|       |
 2261|  1.11M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 234k, False: 885k]
  |  Branch (2261:38): [True: 80.8k, False: 153k]
  ------------------
 2262|  80.8k|               int base = 10;
 2263|  80.8k|               size_t offset = 0;
 2264|       |
 2265|  80.8k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 6.37k, False: 74.4k]
  |  Branch (2265:40): [True: 634, False: 73.8k]
  ------------------
 2266|  7.01k|                  base = 16;
 2267|  7.01k|                  offset = 2;
 2268|  7.01k|               }
 2269|  73.8k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 482, False: 73.3k]
  |  Branch (2269:45): [True: 2.80k, False: 70.5k]
  ------------------
 2270|  3.28k|                  base = 8;
 2271|  3.28k|                  offset = 2;
 2272|  3.28k|               }
 2273|  70.5k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 1.20k, False: 69.3k]
  |  Branch (2273:45): [True: 1.58k, False: 67.7k]
  ------------------
 2274|  2.79k|                  base = 2;
 2275|  2.79k|                  offset = 2;
 2276|  2.79k|               }
 2277|       |
 2278|  80.8k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 13.0k, False: 67.7k]
  ------------------
 2279|  13.0k|                  auto raw_digits = digits.substr(offset);
 2280|  13.0k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  13.0k|                  std::string clean_storage;
 2283|  13.0k|                  std::string_view clean_view;
 2284|  13.0k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 4.86k, False: 8.22k]
  ------------------
 2285|  4.86k|                     clean_storage.reserve(raw_digits.size());
 2286|  1.83M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 1.83M, False: 4.86k]
  ------------------
 2287|  1.83M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 1.82M, False: 12.8k]
  ------------------
 2288|  1.82M|                           clean_storage.push_back(c);
 2289|  1.82M|                        }
 2290|  1.83M|                     }
 2291|  4.86k|                     clean_view = clean_storage;
 2292|  4.86k|                  }
 2293|  8.22k|                  else {
 2294|  8.22k|                     clean_view = raw_digits;
 2295|  8.22k|                  }
 2296|       |
 2297|  13.0k|                  uint64_t parsed_int{};
 2298|  13.0k|                  auto [ptr, ec] =
 2299|  13.0k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  13.0k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 4.96k, False: 8.12k]
  |  Branch (2300:44): [True: 2.64k, False: 5.48k]
  ------------------
 2301|  7.60k|                     ctx.error = error_code::parse_number_failure;
 2302|  7.60k|                     finalize();
 2303|  7.60k|                     return;
 2304|  7.60k|                  }
 2305|       |
 2306|  5.48k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  5.48k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 3.21k, False: 2.26k]
  ------------------
 2308|  5.48k|                  finalize();
 2309|  5.48k|                  return;
 2310|  13.0k|               }
 2311|  80.8k|            }
 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.58k, False: 1.11M]
  ------------------
 2321|  7.58k|            clean_storage.reserve(num_str.size());
 2322|  52.6M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 52.6M, False: 7.58k]
  ------------------
 2323|  52.6M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 52.6M, False: 41.1k]
  ------------------
 2324|  52.6M|                  clean_storage.push_back(c);
 2325|  52.6M|               }
 2326|  52.6M|            }
 2327|  7.58k|            clean_view = clean_storage;
 2328|  7.58k|         }
 2329|  1.11M|         else {
 2330|  1.11M|            clean_view = num_str;
 2331|  1.11M|         }
 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.09M, False: 29.2k]
  |  Branch (2336:37): [True: 52.2k, False: 1.03M]
  ------------------
 2337|  52.2k|            parse_view.remove_prefix(1);
 2338|  52.2k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 13.3k, False: 38.9k]
  ------------------
 2339|  13.3k|               ctx.error = error_code::parse_number_failure;
 2340|  13.3k|               return;
 2341|  13.3k|            }
 2342|  52.2k|         }
 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: 108k, False: 998k]
  |  Branch (2347:45): [True: 187k, False: 810k]
  ------------------
 2348|   266k|               ctx.error = error_code::parse_number_failure;
 2349|   266k|            }
 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.13M|      {
  466|  1.13M|         skip_inline_ws(it, end);
  467|       |
  468|  1.13M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 222, False: 1.13M]
  ------------------
  469|    222|            if constexpr (!AllowEmptyInput) {
  470|    222|               ctx.error = error_code::unexpected_end;
  471|    222|            }
  472|    222|            return true;
  473|    222|         }
  474|       |
  475|  1.13M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.13M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 154, False: 1.13M]
  ------------------
  477|    154|            ctx.error = error_code::syntax_error;
  478|    154|            return true;
  479|    154|         }
  480|  1.13M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 62, False: 1.13M]
  ------------------
  481|     62|            ctx.error = error_code::syntax_error;
  482|     62|            return true;
  483|     62|         }
  484|       |
  485|  1.13M|         skip_inline_ws(it, end);
  486|       |
  487|  1.13M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 148, False: 1.13M]
  ------------------
  488|    148|            if constexpr (!AllowEmptyInput) {
  489|    148|               ctx.error = error_code::unexpected_end;
  490|    148|            }
  491|    148|            return true;
  492|    148|         }
  493|       |
  494|  1.13M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.6k, False: 1.12M]
  ------------------
  495|  11.6k|            return true;
  496|  11.6k|         }
  497|       |
  498|  1.12M|         return false;
  499|  1.13M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|  1.13M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  1.13M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  1.13M|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  1.13M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.13M|      {
  409|  1.13M|         state.has_anchor = false;
  410|  1.13M|         state.anchor_name.clear();
  411|  1.13M|         state.anchor_start = nullptr;
  412|  1.13M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.13M|         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.13M|            else {
  421|  1.13M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 11.0k, False: 1.12M]
  ------------------
  422|  1.13M|            }
  423|  1.13M|         }
  424|       |
  425|  1.13M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.12M, False: 11.0k]
  |  Branch (425:27): [True: 6.65k, False: 1.11M]
  ------------------
  426|  6.65k|            ++it;
  427|  6.65k|            auto name = parse_anchor_name(it, end);
  428|  6.65k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 308, False: 6.34k]
  ------------------
  429|    308|               ctx.error = error_code::syntax_error;
  430|    308|               return true;
  431|    308|            }
  432|  6.34k|            skip_inline_ws(it, end);
  433|  6.34k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 284, False: 6.06k]
  ------------------
  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|  6.06k|            state.has_anchor = true;
  446|  6.06k|            state.anchor_name = std::string(name);
  447|  6.06k|            state.anchor_start = &*it;
  448|  6.06k|         }
  449|       |
  450|  1.13M|         return false;
  451|  1.13M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  1.13M|      {
  301|  1.13M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.13M]
  |  Branch (301:27): [True: 1.12M, 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: 328, False: 10.7k]
  ------------------
  306|    328|            ctx.error = error_code::syntax_error;
  307|    328|            return true;
  308|    328|         }
  309|       |
  310|  10.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 780, False: 9.94k]
  ------------------
  312|    780|            ctx.error = error_code::syntax_error; // undefined alias
  313|    780|            return true;
  314|    780|         }
  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.94k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  9.94k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 976, False: 8.96k]
  ------------------
  322|    976|            return true;
  323|    976|         }
  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.96k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 154, False: 8.81k]
  ------------------
  329|    154|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    154|            return true;
  331|    154|         }
  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.81k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.81k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 8.80k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  8.80k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 8.80k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  8.80k|         auto replay_it = span.begin;
  348|  8.80k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.80k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.80k|         ctx.indent_stack.clear();
  353|  8.80k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.65k, False: 6.15k]
  ------------------
  354|  2.65k|            ctx.push_indent(span.base_indent - 1);
  355|  2.65k|         }
  356|       |
  357|  8.80k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.80k|         using V = std::remove_cvref_t<T>;
  360|  8.80k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.80k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.80k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.80k|         return true;
  367|  8.80k|      }
_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|  49.8k|      {
 5311|  49.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|  49.8k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  49.8k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  49.8k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  49.8k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 49.8k, False: 0]
  ------------------
 5321|  49.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|  49.8k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  62.2k|      {
 2081|  62.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 62.2k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  62.2k|         yaml::node_preamble_state preamble{};
 2085|  62.2k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 13.2k, False: 49.0k]
  ------------------
 2086|  62.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  13.2k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  49.0k|         std::string str;
 2091|  49.0k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  49.0k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 6.27k, False: 42.7k]
  |  Branch (2093:31): [True: 2.17k, False: 40.6k]
  |  Branch (2093:48): [True: 976, False: 39.6k]
  |  Branch (2093:65): [True: 1.13k, False: 38.5k]
  |  Branch (2093:81): [True: 730, False: 37.7k]
  |  Branch (2093:97): [True: 406, False: 37.3k]
  ------------------
 2094|  37.3k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 1.64k, False: 35.7k]
  |  Branch (2094:29): [True: 1.57k, False: 34.1k]
  |  Branch (2094:44): [True: 1.07k, False: 33.0k]
  ------------------
 2095|  15.9k|            value = true;
 2096|  15.9k|         }
 2097|  33.0k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 11.8k, False: 21.2k]
  |  Branch (2097:37): [True: 2.11k, False: 19.1k]
  |  Branch (2097:55): [True: 2.62k, False: 16.5k]
  |  Branch (2097:73): [True: 1.05k, False: 15.4k]
  |  Branch (2097:88): [True: 11.6k, False: 3.83k]
  |  Branch (2097:103): [True: 410, False: 3.42k]
  ------------------
 2098|  32.8k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 908, False: 2.51k]
  |  Branch (2098:35): [True: 706, False: 1.81k]
  |  Branch (2098:51): [True: 1.62k, False: 184]
  ------------------
 2099|  32.8k|            value = false;
 2100|  32.8k|         }
 2101|    184|         else {
 2102|    184|            ctx.error = error_code::expected_true_or_false;
 2103|    184|         }
 2104|       |
 2105|  49.0k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  49.0k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  62.2k|      {
  466|  62.2k|         skip_inline_ws(it, end);
  467|       |
  468|  62.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 62.2k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  62.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  62.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 62.2k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  62.2k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 62.2k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  62.2k|         skip_inline_ws(it, end);
  486|       |
  487|  62.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 62.2k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  62.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.2k, False: 49.0k]
  ------------------
  495|  13.2k|            return true;
  496|  13.2k|         }
  497|       |
  498|  49.0k|         return false;
  499|  62.2k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  62.2k|                                             [](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|  62.2k|      {
  409|  62.2k|         state.has_anchor = false;
  410|  62.2k|         state.anchor_name.clear();
  411|  62.2k|         state.anchor_start = nullptr;
  412|  62.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  62.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|  62.2k|            else {
  421|  62.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 13.1k, False: 49.1k]
  ------------------
  422|  62.2k|            }
  423|  62.2k|         }
  424|       |
  425|  62.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 49.1k, False: 13.1k]
  |  Branch (425:27): [True: 10.9k, False: 38.1k]
  ------------------
  426|  10.9k|            ++it;
  427|  10.9k|            auto name = parse_anchor_name(it, end);
  428|  10.9k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 10.9k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  10.9k|            skip_inline_ws(it, end);
  433|  10.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 10.9k]
  ------------------
  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|  10.9k|            state.has_anchor = true;
  446|  10.9k|            state.anchor_name = std::string(name);
  447|  10.9k|            state.anchor_start = &*it;
  448|  10.9k|         }
  449|       |
  450|  62.2k|         return false;
  451|  62.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  62.2k|      {
  301|  62.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 62.2k]
  |  Branch (301:27): [True: 49.1k, False: 13.1k]
  ------------------
  302|       |
  303|  13.1k|         ++it; // skip '*'
  304|  13.1k|         auto name = parse_anchor_name(it, end);
  305|  13.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 13.1k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  13.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  13.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 48, False: 13.0k]
  ------------------
  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|  13.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  13.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 682, False: 12.4k]
  ------------------
  322|    682|            return true;
  323|    682|         }
  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: 0, False: 12.4k]
  ------------------
  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.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: 2.33k, False: 10.0k]
  ------------------
  354|  2.33k|            ctx.push_indent(span.base_indent - 1);
  355|  2.33k|         }
  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|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  28.4k|      {
 2467|  28.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 28.4k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  28.4k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  28.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 10, False: 28.4k]
  ------------------
 2473|     10|            ctx.error = error_code::unexpected_end;
 2474|     10|            return;
 2475|     10|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  28.4k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 2.75k, False: 25.7k]
  ------------------
 2479|  2.75k|            ++it;
 2480|  2.75k|            return;
 2481|  2.75k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  25.7k|         auto start = it;
 2485|   119k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 119k, False: 878]
  |  Branch (2485:30): [True: 94.1k, False: 24.8k]
  ------------------
 2486|  94.1k|            ++it;
 2487|  94.1k|         }
 2488|       |
 2489|  25.7k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  25.7k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 30, False: 25.6k]
  ------------------
 2491|     30|            ctx.error = error_code::syntax_error;
 2492|     30|         }
 2493|  25.7k|      }
_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|  4.03M|      {
 5311|  4.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|  4.03M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  4.03M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  4.03M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  4.03M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 4.03M, False: 0]
  ------------------
 5321|  4.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|  4.03M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|  4.12M|      {
 4617|  4.12M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 4.12M]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|  4.12M|         yaml::node_preamble_state preamble{};
 4621|  4.12M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 89.5k, False: 4.03M]
  ------------------
 4622|  4.12M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  89.5k|            return;
 4624|       |
 4625|  4.03M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|  4.03M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 1.75k, False: 4.02M]
  ------------------
 4627|  1.75k|            return;
 4628|       |
 4629|  4.02M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|  4.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|  4.02M|         std::remove_cvref_t<T> preexisting_entries;
 4643|  4.02M|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 4.02M]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|  4.02M|         struct merge_restore_guard
 4648|  4.02M|         {
 4649|  4.02M|            std::remove_cvref_t<T>& target;
 4650|  4.02M|            std::remove_cvref_t<T>& saved;
 4651|  4.02M|            ~merge_restore_guard()
 4652|  4.02M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  4.02M|               for (auto& entry : saved) {
 4656|  4.02M|                  target.emplace(entry.first, std::move(entry.second));
 4657|  4.02M|               }
 4658|  4.02M|            }
 4659|  4.02M|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|  4.02M|         const bool treat_as_block_mapping =
 4662|  4.02M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [Folded, False: 4.02M]
  |  Branch (4662:48): [True: 0, False: 0]
  |  Branch (4662:62): [True: 0, False: 0]
  ------------------
 4663|       |
 4664|  4.02M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 2.81M, False: 1.21M]
  |  Branch (4664:28): [True: 0, Folded]
  ------------------
 4665|       |            // Flow mapping
 4666|  2.81M|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  2.81M|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  2.81M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 2.80M, False: 7.98k]
  |  Branch (4670:30): [True: 27.9k, False: 2.77M]
  ------------------
 4671|  27.9k|               ++it;
 4672|  27.9k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  27.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 6, False: 27.9k]
  ------------------
 4674|      6|                  return;
 4675|  27.9k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  27.9k|               return;
 4677|  27.9k|            }
 4678|       |
 4679|  7.87M|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 7.85M, False: 21.6k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  7.85M|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  7.85M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 7.85M, False: 0]
  |  Branch (4683:33): [True: 43.7k, False: 7.81M]
  ------------------
 4684|  43.7k|                  ++it;
 4685|  43.7k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  43.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 6, False: 43.7k]
  ------------------
 4687|      6|                     return;
 4688|  43.7k|                  break;
 4689|  43.7k|               }
 4690|       |
 4691|  7.81M|               bool explicit_flow_key = false;
 4692|  7.81M|               auto explicit_probe = it;
 4693|  7.81M|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  7.81M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 7.81M, False: 0]
  |  Branch (4694:45): [True: 95.4k, False: 7.71M]
  ------------------
 4695|  95.4k|                  const auto after_q = explicit_probe + 1;
 4696|  95.4k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 10, False: 95.3k]
  |  Branch (4696:41): [True: 51.7k, False: 43.6k]
  ------------------
 4697|  55.6k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 2.91k, False: 40.6k]
  |  Branch (4697:42): [True: 894, False: 39.7k]
  ------------------
 4698|  55.6k|                     explicit_flow_key = true;
 4699|  55.6k|                     it = explicit_probe + 1;
 4700|  55.6k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  55.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 6, False: 55.6k]
  ------------------
 4702|      6|                        return;
 4703|  55.6k|                  }
 4704|  95.4k|               }
 4705|       |               // Parse key
 4706|  7.81M|               key_t key{};
 4707|  7.81M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  7.81M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 55.6k, False: 7.75M]
  |  Branch (4708:44): [True: 55.5k, False: 10]
  |  Branch (4708:58): [True: 1.29k, False: 54.3k]
  |  Branch (4708:72): [True: 30.8k, False: 23.4k]
  |  Branch (4708:86): [True: 960, False: 22.4k]
  ------------------
 4709|  33.1k|                     key.clear();
 4710|  33.1k|                  }
 4711|  7.77M|                  else {
 4712|  7.77M|                     auto key_probe = it;
 4713|  7.77M|                     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.77M|                     bool parse_complex_flow_key = false;
 4718|  7.77M|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 7.77M, False: 10]
  ------------------
 4719|  7.77M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 38.7k, False: 7.73M]
  |  Branch (4719:50): [True: 66.6k, False: 7.67M]
  ------------------
 4720|   105k|                           parse_complex_flow_key = true;
 4721|   105k|                        }
 4722|  7.67M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 2.58M, False: 5.08M]
  ------------------
 4723|  2.58M|                           ++key_probe;
 4724|  2.58M|                           yaml::parse_anchor_name(key_probe, end);
 4725|  2.58M|                           yaml::skip_inline_ws(key_probe, end);
 4726|  2.58M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 2.58M, False: 36]
  |  Branch (4726:53): [True: 9.80k, False: 2.57M]
  |  Branch (4726:74): [True: 1.20M, False: 1.37M]
  ------------------
 4727|  1.21M|                              parse_complex_flow_key = true;
 4728|  1.21M|                           }
 4729|  2.58M|                        }
 4730|  7.77M|                     }
 4731|       |
 4732|  7.77M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 1.32M, False: 6.45M]
  ------------------
 4733|  1.32M|                        glz::generic key_node{};
 4734|  1.32M|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  1.32M|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 3.55k, False: 1.31M]
  ------------------
 4736|  3.55k|                           return;
 4737|  1.31M|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 10, False: 1.31M]
  ------------------
 4738|     10|                           return;
 4739|  1.31M|                     }
 4740|  6.45M|                     else {
 4741|  6.45M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 86.3k, False: 6.37M]
  ------------------
 4742|  86.3k|                           return;
 4743|  86.3k|                        }
 4744|  6.45M|                     }
 4745|  7.77M|                  }
 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.72M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  7.81M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 10, False: 7.81M]
  ------------------
 4761|     10|                  return;
 4762|       |
 4763|  7.81M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  7.81M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  7.81M|                     val = {};
 4766|  7.81M|                     return true;
 4767|  7.81M|                  }
 4768|  7.81M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  7.81M|                     val = glz::generic{};
 4770|  7.81M|                     return true;
 4771|  7.81M|                  }
 4772|  7.81M|                  else {
 4773|  7.81M|                     static constexpr std::string_view null_value{"null"};
 4774|  7.81M|                     auto null_it = null_value.data();
 4775|  7.81M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  7.81M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  7.81M|                     return !bool(ctx.error);
 4778|  7.81M|                  }
 4779|  7.81M|               };
 4780|       |
 4781|  7.81M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 7.72M, False: 90.0k]
  |  Branch (4781:34): [True: 3.09M, False: 4.62M]
  |  Branch (4781:48): [True: 1.78M, False: 2.83M]
  ------------------
 4782|  4.88M|                  val_t val{};
 4783|  4.88M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 4.88M]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|  4.88M|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|  4.88M|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 1.78M, False: 3.09M]
  ------------------
 4789|  1.78M|                     ++it;
 4790|  1.78M|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  1.78M|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 10, False: 1.78M]
  ------------------
 4792|     10|                        return;
 4793|  1.78M|                     break;
 4794|  1.78M|                  }
 4795|       |
 4796|  3.09M|                  ++it; // skip comma
 4797|  3.09M|                  yaml::skip_ws_and_newlines(it, end);
 4798|  3.09M|                  continue;
 4799|  4.88M|               }
 4800|       |
 4801|  2.92M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 90.0k, False: 2.83M]
  |  Branch (4801:33): [True: 32, False: 2.83M]
  ------------------
 4802|    132|                  ctx.error = error_code::syntax_error;
 4803|    132|                  return;
 4804|    132|               }
 4805|  2.92M|               ++it;
 4806|       |
 4807|  2.92M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  2.92M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 10, False: 2.92M]
  ------------------
 4809|     10|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  2.92M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 2.83M, False: 89.9k]
  |  Branch (4812:34): [True: 241k, False: 2.59M]
  |  Branch (4812:48): [True: 108k, False: 2.48M]
  ------------------
 4813|   350k|                  val_t val{};
 4814|   350k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 350k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|   350k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|   350k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 108k, False: 241k]
  ------------------
 4820|   108k|                     ++it;
 4821|   108k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|   108k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 6, False: 108k]
  ------------------
 4823|      6|                        return;
 4824|   108k|                     break;
 4825|   108k|                  }
 4826|       |
 4827|   241k|                  ++it; // skip comma
 4828|   241k|                  yaml::skip_ws_and_newlines(it, end);
 4829|   241k|                  continue;
 4830|   350k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  2.57M|               val_t val{};
 4834|  2.57M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  2.57M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 2.58k, False: 2.57M]
  ------------------
 4836|  2.58k|                  return;
 4837|       |
 4838|  2.57M|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  2.57M|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  2.57M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 2.48M, False: 89.9k]
  |  Branch (4842:33): [True: 722k, False: 1.76M]
  ------------------
 4843|   722k|                  ++it;
 4844|   722k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|   722k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 6, False: 722k]
  ------------------
 4846|      6|                     return;
 4847|   722k|                  break;
 4848|   722k|               }
 4849|  1.85M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 1.76M, False: 89.9k]
  |  Branch (4849:38): [True: 1.66M, False: 96.7k]
  ------------------
 4850|  1.66M|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  1.66M|                  yaml::skip_ws_and_newlines(it, end);
 4853|  1.66M|               }
 4854|   186k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 96.7k, False: 89.9k]
  |  Branch (4854:39): [True: 54.6k, False: 42.0k]
  |  Branch (4854:54): [True: 42.0k, False: 14]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  96.7k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  96.7k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 96.6k, False: 26]
  |  Branch (4858:36): [True: 13.4k, False: 83.2k]
  ------------------
 4859|  13.4k|                     ++it;
 4860|  13.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  13.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 6, False: 13.4k]
  ------------------
 4862|      6|                        return;
 4863|  13.4k|                     break;
 4864|  13.4k|                  }
 4865|  83.2k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 83.2k, False: 26]
  |  Branch (4865:36): [True: 83.1k, False: 24]
  ------------------
 4866|  83.1k|                     ++it;
 4867|  83.1k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  83.1k|                     continue;
 4869|  83.1k|                  }
 4870|     50|                  ctx.error = error_code::syntax_error;
 4871|     50|                  return;
 4872|  83.2k|               }
 4873|  89.9k|               else {
 4874|  89.9k|                  ctx.error = error_code::syntax_error;
 4875|  89.9k|                  return;
 4876|  89.9k|               }
 4877|  2.57M|            }
 4878|  2.78M|         }
 4879|  1.21M|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|  1.21M|            yaml::parse_block_mapping_loop<Opts>(
 4882|  1.21M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.21M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.21M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.21M|                        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.21M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.21M|                           if (ctx.stream_begin) {
 4893|  1.21M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.21M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.21M|                              };
 4896|       |
 4897|  1.21M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.21M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.21M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.21M|                                 return line != end && *line == ':';
 4901|  1.21M|                              };
 4902|       |
 4903|  1.21M|                              if (!is_line_content_start(it) &&
 4904|  1.21M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.21M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.21M|                                 ctx.error = error_code::syntax_error;
 4907|  1.21M|                                 return false;
 4908|  1.21M|                              }
 4909|  1.21M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.21M|                           }
 4911|  1.21M|                        }
 4912|       |
 4913|  1.21M|                        if (*it == '-' &&
 4914|  1.21M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.21M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.21M|                           ctx.error = error_code::syntax_error;
 4918|  1.21M|                           return false;
 4919|  1.21M|                        }
 4920|       |
 4921|  1.21M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.21M|                           return false;
 4923|  1.21M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.21M|                        ctx.pop_indent();
 4925|  1.21M|                     }
 4926|  1.21M|                     else {
 4927|  1.21M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.21M|                        if (nested_indent >= 0) {
 4929|  1.21M|                           yaml::skip_to_content(it, end);
 4930|  1.21M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.21M|                              ctx.error = error_code::syntax_error;
 4932|  1.21M|                              return false;
 4933|  1.21M|                           }
 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.21M|                           const int32_t value_indent =
 4937|  1.21M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.21M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.21M|                              return false;
 4940|  1.21M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.21M|                           ctx.pop_indent();
 4942|  1.21M|                        }
 4943|  1.21M|                     }
 4944|  1.21M|                     return !bool(ctx.error);
 4945|  1.21M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.21M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|  1.21M|                     ctx.error = error_code::syntax_error;
 4952|  1.21M|                     return false;
 4953|  1.21M|                  }
 4954|  1.21M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|  1.21M|                     ++it; // skip '?'
 4956|  1.21M|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|  1.21M|                     const int32_t explicit_value_indicator_indent =
 4959|  1.21M|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|  1.21M|                     key_t key{};
 4962|  1.21M|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|  1.21M|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|  1.21M|                           return yaml::materialize_key(key, key_node, ctx);
 4965|  1.21M|                        };
 4966|       |
 4967|  1.21M|                        auto key_it = it;
 4968|  1.21M|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|  1.21M|                        auto content = key_it;
 4971|  1.21M|                        yaml::skip_to_content(content, end);
 4972|  1.21M|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|  1.21M|                        if (content != end && *content == '&') {
 4978|  1.21M|                           auto anchor_probe = content + 1;
 4979|  1.21M|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  1.21M|                           if (!anchor_name.empty()) {
 4981|  1.21M|                              auto after_anchor = anchor_probe;
 4982|  1.21M|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  1.21M|                              auto value_indicator = after_anchor;
 4985|  1.21M|                              if (value_indicator != end && *value_indicator == ':') {
 4986|  1.21M|                                 key.clear();
 4987|  1.21M|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  1.21M|                                 it = value_indicator;
 4989|  1.21M|                                 handled_anchor_only_empty_key = true;
 4990|  1.21M|                              }
 4991|  1.21M|                              else {
 4992|  1.21M|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|  1.21M|                                    yaml::skip_comment(value_indicator, end);
 4994|  1.21M|                                 }
 4995|  1.21M|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|  1.21M|                                    yaml::skip_newline(value_indicator, end);
 4997|  1.21M|                                    auto value_line = value_indicator;
 4998|  1.21M|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  1.21M|                                    if (bool(ctx.error)) [[unlikely]]
 5000|  1.21M|                                       return false;
 5001|  1.21M|                                    if (value_line != end && *value_line == ':' &&
 5002|  1.21M|                                        value_indent == explicit_value_indicator_indent) {
 5003|  1.21M|                                       key.clear();
 5004|  1.21M|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  1.21M|                                       it = value_line;
 5006|  1.21M|                                       handled_anchor_only_empty_key = true;
 5007|  1.21M|                                    }
 5008|  1.21M|                                    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|  1.21M|                                       ctx.error = error_code::syntax_error;
 5013|  1.21M|                                       return false;
 5014|  1.21M|                                    }
 5015|  1.21M|                                 }
 5016|  1.21M|                              }
 5017|  1.21M|                           }
 5018|  1.21M|                        }
 5019|       |
 5020|  1.21M|                        const bool key_content_spans_lines = [&] {
 5021|  1.21M|                           auto scan = key_it;
 5022|  1.21M|                           while (scan != content && scan != end) {
 5023|  1.21M|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|  1.21M|                              ++scan;
 5025|  1.21M|                           }
 5026|  1.21M|                           return false;
 5027|  1.21M|                        }();
 5028|       |
 5029|  1.21M|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  1.21M|                        }
 5032|  1.21M|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|  1.21M|                           key.clear();
 5034|  1.21M|                           it = content;
 5035|  1.21M|                        }
 5036|  1.21M|                        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|  1.21M|                           auto key_node_it = content;
 5042|  1.21M|                           auto key_node_end = end;
 5043|  1.21M|                           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|  1.21M|                              auto scan = content;
 5048|  1.21M|                              while (scan != end) {
 5049|  1.21M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|  1.21M|                                    ++scan;
 5051|  1.21M|                                 }
 5052|  1.21M|                                 if (scan == end) {
 5053|  1.21M|                                    break;
 5054|  1.21M|                                 }
 5055|       |
 5056|  1.21M|                                 yaml::skip_newline(scan, end);
 5057|  1.21M|                                 auto line_start = scan;
 5058|       |
 5059|  1.21M|                                 int32_t indicator_indent = 0;
 5060|  1.21M|                                 while (scan != end && *scan == ' ') {
 5061|  1.21M|                                    ++indicator_indent;
 5062|  1.21M|                                    ++scan;
 5063|  1.21M|                                 }
 5064|       |
 5065|  1.21M|                                 if (scan != end && *scan == ':') {
 5066|  1.21M|                                    const auto after_colon = scan + 1;
 5067|  1.21M|                                    if ((after_colon == end ||
 5068|  1.21M|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|  1.21M|                                        indicator_indent <= line_indent) {
 5070|  1.21M|                                       key_node_end = line_start;
 5071|  1.21M|                                       break;
 5072|  1.21M|                                    }
 5073|  1.21M|                                 }
 5074|  1.21M|                              }
 5075|  1.21M|                           }
 5076|       |
 5077|  1.21M|                           glz::generic key_node{};
 5078|  1.21M|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|  1.21M|                           ctx.explicit_mapping_key_context = true;
 5080|  1.21M|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|  1.21M|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|  1.21M|                           if (bool(ctx.error)) [[unlikely]]
 5083|  1.21M|                              return false;
 5084|  1.21M|                           it = key_node_it;
 5085|  1.21M|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|  1.21M|                              return false;
 5087|  1.21M|                        }
 5088|  1.21M|                     }
 5089|  1.21M|                     else {
 5090|  1.21M|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|  1.21M|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|  1.21M|                           if (bool(ctx.error)) [[unlikely]]
 5093|  1.21M|                              return false;
 5094|  1.21M|                        }
 5095|  1.21M|                     }
 5096|       |
 5097|  1.21M|                     yaml::skip_inline_ws(it, end);
 5098|  1.21M|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|  1.21M|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|  1.21M|                        auto probe = it;
 5103|  1.21M|                        bool found_value_indicator = false;
 5104|       |
 5105|  1.21M|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|  1.21M|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|  1.21M|                           auto value_line = probe;
 5109|  1.21M|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|  1.21M|                           if (bool(ctx.error)) [[unlikely]]
 5111|  1.21M|                              return false;
 5112|       |
 5113|  1.21M|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|  1.21M|                              probe = value_line;
 5115|  1.21M|                              continue; // blank line
 5116|  1.21M|                           }
 5117|  1.21M|                           if (*value_line == '#') {
 5118|  1.21M|                              yaml::skip_comment(value_line, end);
 5119|  1.21M|                              probe = value_line;
 5120|  1.21M|                              continue; // comment-only line
 5121|  1.21M|                           }
 5122|  1.21M|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|  1.21M|                              it = value_line;
 5124|  1.21M|                              found_value_indicator = true;
 5125|  1.21M|                           }
 5126|  1.21M|                           break;
 5127|  1.21M|                        }
 5128|       |
 5129|  1.21M|                        if (found_value_indicator) {
 5130|  1.21M|                           yaml::skip_inline_ws(it, end);
 5131|  1.21M|                        }
 5132|  1.21M|                     }
 5133|       |
 5134|  1.21M|                     val_t val{};
 5135|  1.21M|                     if (it != end && *it == ':') {
 5136|  1.21M|                        ++it;
 5137|  1.21M|                        if (it != end && *it == '\t') {
 5138|  1.21M|                           ctx.error = error_code::syntax_error;
 5139|  1.21M|                           return false;
 5140|  1.21M|                        }
 5141|  1.21M|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|  1.21M|                           auto probe = it;
 5143|  1.21M|                           yaml::skip_newline(probe, end);
 5144|  1.21M|                           while (probe != end && *probe == ' ') ++probe;
 5145|  1.21M|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|  1.21M|                              ctx.error = error_code::syntax_error;
 5147|  1.21M|                              return false;
 5148|  1.21M|                           }
 5149|  1.21M|                        }
 5150|  1.21M|                        yaml::skip_inline_ws(it, end);
 5151|  1.21M|                        if (!parse_map_value(val)) [[unlikely]]
 5152|  1.21M|                           return false;
 5153|  1.21M|                     }
 5154|       |
 5155|  1.21M|                     value.emplace(std::move(key), std::move(val));
 5156|  1.21M|                     return true;
 5157|  1.21M|                  }
 5158|       |
 5159|  1.21M|                  key_t key{};
 5160|  1.21M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|  1.21M|                     auto key_probe = it;
 5162|  1.21M|                     yaml::skip_inline_ws(key_probe, end);
 5163|  1.21M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|  1.21M|                     if (complex_flow_key) {
 5165|  1.21M|                        glz::generic key_node{};
 5166|  1.21M|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  1.21M|                        if (bool(ctx.error)) [[unlikely]]
 5168|  1.21M|                           return false;
 5169|  1.21M|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|  1.21M|                           return false;
 5171|  1.21M|                     }
 5172|  1.21M|                     else {
 5173|  1.21M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|  1.21M|                           return false;
 5175|  1.21M|                        }
 5176|  1.21M|                     }
 5177|  1.21M|                  }
 5178|  1.21M|                  else {
 5179|  1.21M|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|  1.21M|                     if (bool(ctx.error)) [[unlikely]]
 5181|  1.21M|                        return false;
 5182|  1.21M|                  }
 5183|       |
 5184|  1.21M|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|  1.21M|                  if (it == end || *it != ':') {
 5187|  1.21M|                     ctx.error = error_code::syntax_error;
 5188|  1.21M|                     return false;
 5189|  1.21M|                  }
 5190|  1.21M|                  ++it;
 5191|  1.21M|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|  1.21M|                  val_t val{};
 5194|  1.21M|                  if (!parse_map_value(val)) [[unlikely]]
 5195|  1.21M|                     return false;
 5196|       |
 5197|  1.21M|                  value.emplace(std::move(key), std::move(val));
 5198|  1.21M|                  return true;
 5199|  1.21M|               });
 5200|  1.21M|         }
 5201|       |
 5202|  3.90M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|  3.90M|      }
_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|  4.12M|      {
  466|  4.12M|         skip_inline_ws(it, end);
  467|       |
  468|  4.12M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 4.12M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  4.12M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  4.12M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 4.12M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  4.12M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 4.12M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  4.12M|         skip_inline_ws(it, end);
  486|       |
  487|  4.12M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 4.12M]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|  4.12M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 89.4k, False: 4.03M]
  ------------------
  495|  89.4k|            return true;
  496|  89.4k|         }
  497|       |
  498|  4.03M|         return false;
  499|  4.12M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4622|  4.12M|                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|  4.12M|      {
  409|  4.12M|         state.has_anchor = false;
  410|  4.12M|         state.anchor_name.clear();
  411|  4.12M|         state.anchor_start = nullptr;
  412|  4.12M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  4.12M|         if constexpr (Policy.allow_alias) {
  415|  4.12M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  4.12M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 4.11M, False: 806]
  ------------------
  417|  4.11M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 89.4k, False: 4.03M]
  ------------------
  418|  4.11M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  4.12M|         }
  424|       |
  425|  4.12M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 4.03M, False: 89.4k]
  |  Branch (425:27): [True: 37.6k, False: 3.99M]
  ------------------
  426|  37.6k|            ++it;
  427|  37.6k|            auto name = parse_anchor_name(it, end);
  428|  37.6k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 37.6k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  37.6k|            skip_inline_ws(it, end);
  433|  37.6k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 24, False: 37.6k]
  ------------------
  434|     24|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     24|                  ctx.error = error_code::unexpected_end;
  436|     24|               }
  437|     24|               return true;
  438|     24|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  37.6k|            state.has_anchor = true;
  446|  37.6k|            state.anchor_name = std::string(name);
  447|  37.6k|            state.anchor_start = &*it;
  448|  37.6k|         }
  449|       |
  450|  4.12M|         return false;
  451|  4.12M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  4.11M|      {
  301|  4.11M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 4.11M]
  |  Branch (301:27): [True: 4.03M, False: 89.4k]
  ------------------
  302|       |
  303|  89.4k|         ++it; // skip '*'
  304|  89.4k|         auto name = parse_anchor_name(it, end);
  305|  89.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 14, False: 89.4k]
  ------------------
  306|     14|            ctx.error = error_code::syntax_error;
  307|     14|            return true;
  308|     14|         }
  309|       |
  310|  89.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  89.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 50, False: 89.3k]
  ------------------
  312|     50|            ctx.error = error_code::syntax_error; // undefined alias
  313|     50|            return true;
  314|     50|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  89.3k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  89.3k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.95k, False: 84.4k]
  ------------------
  322|  4.95k|            return true;
  323|  4.95k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  84.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 62, False: 84.3k]
  ------------------
  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|  84.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  84.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 84.3k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  84.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 56, False: 84.3k]
  ------------------
  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|  84.3k|         auto replay_it = span.begin;
  348|  84.3k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  84.3k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  84.3k|         ctx.indent_stack.clear();
  353|  84.3k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.25k, False: 81.0k]
  ------------------
  354|  3.25k|            ctx.push_indent(span.base_indent - 1);
  355|  3.25k|         }
  356|       |
  357|  84.3k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  84.3k|         using V = std::remove_cvref_t<T>;
  360|  84.3k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  84.3k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  84.3k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  84.3k|         return true;
  367|  84.3k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|  5.23M|               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|  5.23M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  5.23M|                     val = glz::generic{};
 4770|  5.23M|                     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|  5.23M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|  1.21M|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|  1.21M|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 1.21M]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|  1.21M|         const int32_t parent_indent = ctx.current_indent();
 3722|  1.21M|         const bool discover_indent = (mapping_indent < 0);
 3723|  1.21M|         bool first_key = !discover_indent;
 3724|  1.21M|         bool discovered_first_key_mid_line = false;
 3725|  1.21M|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.80M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.68M, False: 1.12M]
  ------------------
 3728|  1.68M|            auto line_start = it;
 3729|  1.68M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.68M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.59M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 2.57M, False: 17.4k]
  ------------------
 3733|  2.57M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 33.8k, False: 2.54M]
  ------------------
 3734|  33.8k|                  skip_comment(it, end);
 3735|  33.8k|                  skip_newline(it, end);
 3736|  33.8k|                  first_key = false;
 3737|  33.8k|                  line_indent = 0;
 3738|  33.8k|               }
 3739|  2.54M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 44.0k, False: 2.50M]
  |  Branch (3739:40): [True: 757k, False: 1.74M]
  ------------------
 3740|   801k|                  skip_newline(it, end);
 3741|   801k|                  first_key = false;
 3742|   801k|                  line_indent = 0;
 3743|   801k|               }
 3744|  1.74M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 304k, False: 1.43M]
  ------------------
 3745|   304k|                  line_start = it;
 3746|   304k|                  line_indent = 0;
 3747|   858k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 853k, False: 5.20k]
  |  Branch (3747:39): [True: 554k, False: 298k]
  ------------------
 3748|   554k|                     ++line_indent;
 3749|   554k|                     ++it;
 3750|   554k|                  }
 3751|       |
 3752|   304k|                  bool saw_tab = false;
 3753|   319k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 311k, False: 7.85k]
  |  Branch (3753:40): [True: 7.02k, False: 304k]
  |  Branch (3753:54): [True: 8.12k, False: 296k]
  ------------------
 3754|  15.1k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 9.17k, False: 5.97k]
  |  Branch (3754:43): [True: 5.97k, False: 0]
  ------------------
 3755|  15.1k|                     ++it;
 3756|  15.1k|                  }
 3757|       |
 3758|   304k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 7.85k, False: 296k]
  |  Branch (3758:36): [True: 4.38k, False: 291k]
  |  Branch (3758:51): [True: 5.13k, False: 286k]
  |  Branch (3758:66): [True: 5.51k, False: 281k]
  ------------------
 3759|  22.8k|                     first_key = false;
 3760|  22.8k|                     line_indent = 0;
 3761|  22.8k|                     continue; // Blank or comment line
 3762|  22.8k|                  }
 3763|       |
 3764|   281k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 12, False: 281k]
  ------------------
 3765|     12|                     ctx.error = error_code::syntax_error;
 3766|     12|                     return;
 3767|     12|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   281k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 276k, False: 4.65k]
  |  Branch (3770:46): [True: 1.27k, False: 275k]
  ------------------
 3771|  1.27k|                     it = line_start;
 3772|  1.27k|                     return;
 3773|  1.27k|                  }
 3774|       |
 3775|   279k|                  first_key = false;
 3776|   279k|                  break; // Found content
 3777|   281k|               }
 3778|  1.43M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 56.9k, False: 1.38M]
  ------------------
 3779|  56.9k|                  line_start = it;
 3780|   125k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 124k, False: 770]
  |  Branch (3780:40): [True: 6.65k, False: 117k]
  |  Branch (3780:54): [True: 61.5k, False: 56.1k]
  ------------------
 3781|  56.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 770, False: 56.1k]
  |  Branch (3781:36): [True: 2.31k, False: 53.8k]
  |  Branch (3781:51): [True: 52.6k, False: 1.17k]
  |  Branch (3781:66): [True: 1.16k, False: 16]
  ------------------
 3782|  56.9k|                     first_key = false;
 3783|  56.9k|                     line_indent = 0;
 3784|  56.9k|                     continue; // Blank or comment-only line with tab indentation
 3785|  56.9k|                  }
 3786|     16|                  ctx.error = error_code::syntax_error;
 3787|     16|                  return;
 3788|  56.9k|               }
 3789|  1.38M|               else {
 3790|  1.38M|                  line_start = it;
 3791|  1.38M|                  break; // Content at column 0
 3792|  1.38M|               }
 3793|  2.57M|            }
 3794|       |
 3795|  1.67M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 17.4k, False: 1.66M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.66M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 4.55k, False: 1.65M]
  |  Branch (3799:45): [True: 1.48k, False: 1.65M]
  ------------------
 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.65M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.65M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.65M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.65M, False: 0]
  |  Branch (3806:39): [True: 445k, False: 1.21M]
  |  Branch (3806:62): [True: 53.8k, False: 391k]
  |  Branch (3806:84): [True: 29.0k, False: 24.7k]
  ------------------
 3807|  29.0k|                  it = line_start;
 3808|  29.0k|                  return;
 3809|  29.0k|               }
 3810|  1.62M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 416k, False: 1.21M]
  |  Branch (3810:43): [True: 346, False: 416k]
  ------------------
 3811|    346|                  it = line_start;
 3812|    346|                  return;
 3813|    346|               }
 3814|  1.62M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.62M|            bool established_mapping_indent_this_line = false;
 3818|  1.62M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 1.21M, False: 416k]
  ------------------
 3819|  1.21M|               mapping_indent = line_indent;
 3820|  1.21M|               established_mapping_indent_this_line = true;
 3821|  1.21M|               discovered_first_key_visual_indent = line_indent;
 3822|  1.21M|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|  1.21M|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 1.21M, False: 0]
  |  Branch (3823:43): [True: 1.21M, False: 0]
  ------------------
 3824|  1.21M|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|  1.21M|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 74, False: 1.21M]
  ------------------
 3826|     74|                        ctx.error = error_code::syntax_error;
 3827|     74|                        return;
 3828|     74|                     }
 3829|       |
 3830|  1.21M|                     discovered_first_key_mid_line = prefix.has_content;
 3831|  1.21M|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 1.20M, False: 4.65k]
  |  Branch (3831:49): [True: 992k, False: 212k]
  ------------------
 3832|   992k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   992k|                     }
 3834|  1.21M|                  }
 3835|  1.21M|               }
 3836|  1.21M|            }
 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.62M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.62M, False: 74]
  |  Branch (3840:36): [True: 1.62M, False: 0]
  |  Branch (3840:59): [True: 416k, False: 1.21M]
  ------------------
 3841|   416k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 242k, False: 173k]
  ------------------
 3842|   242k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 242k, False: 270]
  |  Branch (3842:43): [True: 185k, False: 56.9k]
  ------------------
 3843|   185k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 42, False: 185k]
  ------------------
 3844|     42|                     ctx.error = error_code::syntax_error;
 3845|     42|                     return;
 3846|     42|                  }
 3847|   185k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 6.40k, False: 178k]
  ------------------
 3848|  6.40k|                     it = line_start;
 3849|  6.40k|                     return;
 3850|  6.40k|                  }
 3851|   185k|               }
 3852|  57.1k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 932, False: 56.2k]
  ------------------
 3853|    932|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 30, False: 902]
  |  Branch (3853:47): [True: 6, False: 896]
  ------------------
 3854|    896|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 896, False: 0]
  |  Branch (3854:49): [True: 896, False: 0]
  |  Branch (3854:72): [True: 6, False: 890]
  ------------------
 3855|     42|                  ctx.error = error_code::syntax_error;
 3856|     42|                  return;
 3857|     42|               }
 3858|   242k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.61M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.61M]
  |  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.61M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.61M]
  ------------------
 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.61M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 74, False: 1.61M]
  |  Branch (3876:32): [True: 0, False: 1.61M]
  ------------------
 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.61M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 632k, False: 987k]
  |  Branch (3885:53): [True: 168k, False: 463k]
  |  Branch (3885:94): [True: 64.1k, False: 104k]
  ------------------
 3886|  64.1k|               const auto after_colon = it + 1;
 3887|  64.1k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 60.4k, False: 3.62k]
  ------------------
 3888|  64.1k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 526, False: 63.5k]
  |  Branch (3888:43): [True: 62.4k, False: 1.16k]
  ------------------
 3889|  62.9k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 2.02k, False: 60.9k]
  ------------------
 3890|  2.02k|                  it = line_start;
 3891|  2.02k|                  return;
 3892|  2.02k|               }
 3893|  64.1k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.61M|            int32_t effective_line_indent = line_indent;
 3897|  1.61M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.61M, False: 74]
  |  Branch (3897:36): [True: 1.21M, False: 407k]
  ------------------
 3898|  1.21M|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 992k, False: 217k]
  ------------------
 3899|   992k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 698k, False: 294k]
  |  Branch (3899:52): [True: 457k, False: 240k]
  ------------------
 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|   534k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   534k|            }
 3912|       |
 3913|  1.61M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 23.8k, False: 1.59M]
  ------------------
 3914|  23.8k|               return;
 3915|  23.8k|            }
 3916|  1.59M|            first_key = false;
 3917|       |
 3918|  1.59M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.59M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|  1.59M|            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.59M|               auto flow_end = it;
 3925|  1.59M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|  1.59M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 10, False: 1.59M]
  ------------------
 3927|     10|                  return;
 3928|  1.59M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 1.32M, False: 264k]
  |  Branch (3928:40): [True: 744k, False: 585k]
  |  Branch (3928:60): [True: 17.7k, False: 567k]
  |  Branch (3928:80): [True: 115k, False: 452k]
  ------------------
 3929|   877k|                  it = flow_end;
 3930|   877k|                  return;
 3931|   877k|               }
 3932|  1.59M|            }
 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.59M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 482k, False: 1.11M]
  ------------------
 3938|   482k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 134k, False: 348k]
  |  Branch (3938:34): [True: 3.71k, False: 344k]
  ------------------
 3939|   137k|                  auto peek = it;
 3940|   137k|                  skip_inline_ws(peek, end);
 3941|   137k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 132k, False: 5.25k]
  |  Branch (3941:38): [True: 126k, False: 5.77k]
  |  Branch (3941:55): [True: 124k, False: 2.22k]
  |  Branch (3941:72): [True: 119k, False: 5.60k]
  ------------------
 3942|   119k|                     continue; // At leading indent of new line
 3943|   119k|                  }
 3944|   137k|               }
 3945|   363k|               skip_inline_ws(it, end);
 3946|   363k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 358k, False: 5.25k]
  |  Branch (3946:33): [True: 14.9k, False: 343k]
  ------------------
 3947|  14.9k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  14.9k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 14.9k, False: 0]
  ------------------
 3949|  14.9k|                        const char prev = *(it - 1);
 3950|  14.9k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 7.50k, False: 7.46k]
  |  Branch (3950:44): [True: 3.78k, False: 3.71k]
  |  Branch (3950:60): [True: 2.93k, False: 850]
  |  Branch (3950:76): [True: 6, False: 2.93k]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  14.9k|                     }
 3955|  14.9k|                  }
 3956|  14.9k|               }
 3957|  14.9k|               skip_comment(it, end);
 3958|   363k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 358k, False: 5.26k]
  |  Branch (3958:34): [True: 62.2k, False: 296k]
  |  Branch (3958:49): [True: 183k, False: 112k]
  ------------------
 3959|   246k|                  skip_newline(it, end);
 3960|   246k|               }
 3961|   117k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 112k, False: 5.26k]
  ------------------
 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|   112k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   112k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 32, False: 112k]
  ------------------
 3968|     32|                        ctx.error = error_code::syntax_error;
 3969|     32|                        return;
 3970|     32|                     }
 3971|   112k|                  }
 3972|   112k|               }
 3973|   363k|            }
 3974|  1.59M|         }
 3975|  1.21M|      }
_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.61M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.61M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.61M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.61M|                        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.61M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.61M|                           if (ctx.stream_begin) {
 4893|  1.61M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.61M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.61M|                              };
 4896|       |
 4897|  1.61M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.61M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.61M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.61M|                                 return line != end && *line == ':';
 4901|  1.61M|                              };
 4902|       |
 4903|  1.61M|                              if (!is_line_content_start(it) &&
 4904|  1.61M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.61M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.61M|                                 ctx.error = error_code::syntax_error;
 4907|  1.61M|                                 return false;
 4908|  1.61M|                              }
 4909|  1.61M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.61M|                           }
 4911|  1.61M|                        }
 4912|       |
 4913|  1.61M|                        if (*it == '-' &&
 4914|  1.61M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.61M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.61M|                           ctx.error = error_code::syntax_error;
 4918|  1.61M|                           return false;
 4919|  1.61M|                        }
 4920|       |
 4921|  1.61M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.61M|                           return false;
 4923|  1.61M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.61M|                        ctx.pop_indent();
 4925|  1.61M|                     }
 4926|  1.61M|                     else {
 4927|  1.61M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.61M|                        if (nested_indent >= 0) {
 4929|  1.61M|                           yaml::skip_to_content(it, end);
 4930|  1.61M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.61M|                              ctx.error = error_code::syntax_error;
 4932|  1.61M|                              return false;
 4933|  1.61M|                           }
 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.61M|                           const int32_t value_indent =
 4937|  1.61M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.61M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.61M|                              return false;
 4940|  1.61M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.61M|                           ctx.pop_indent();
 4942|  1.61M|                        }
 4943|  1.61M|                     }
 4944|  1.61M|                     return !bool(ctx.error);
 4945|  1.61M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.61M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 624k, False: 993k]
  |  Branch (4950:37): [True: 622k, False: 1.50k]
  |  Branch (4950:58): [True: 6, False: 622k]
  ------------------
 4951|      6|                     ctx.error = error_code::syntax_error;
 4952|      6|                     return false;
 4953|      6|                  }
 4954|  1.61M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 624k, False: 993k]
  |  Branch (4954:38): [True: 1.50k, False: 622k]
  |  Branch (4954:57): [True: 155k, False: 467k]
  |  Branch (4954:77): [True: 290k, False: 176k]
  |  Branch (4954:98): [True: 148k, False: 27.7k]
  ------------------
 4955|   596k|                     ++it; // skip '?'
 4956|   596k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   596k|                     const int32_t explicit_value_indicator_indent =
 4959|   596k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 380k, False: 216k]
  ------------------
 4960|       |
 4961|   596k|                     key_t key{};
 4962|   596k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   596k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   596k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   596k|                        };
 4966|       |
 4967|   596k|                        auto key_it = it;
 4968|   596k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   596k|                        auto content = key_it;
 4971|   596k|                        yaml::skip_to_content(content, end);
 4972|   596k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   596k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 590k, False: 6.26k]
  |  Branch (4977:47): [True: 225k, False: 364k]
  ------------------
 4978|   225k|                           auto anchor_probe = content + 1;
 4979|   225k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   225k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 225k, False: 32]
  ------------------
 4981|   225k|                              auto after_anchor = anchor_probe;
 4982|   225k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   225k|                              auto value_indicator = after_anchor;
 4985|   225k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 217k, False: 7.84k]
  |  Branch (4985:61): [True: 10.6k, False: 207k]
  ------------------
 4986|  10.6k|                                 key.clear();
 4987|  10.6k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  10.6k|                                 it = value_indicator;
 4989|  10.6k|                                 handled_anchor_only_empty_key = true;
 4990|  10.6k|                              }
 4991|   214k|                              else {
 4992|   214k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 207k, False: 7.84k]
  |  Branch (4992:64): [True: 17.1k, False: 189k]
  ------------------
 4993|  17.1k|                                    yaml::skip_comment(value_indicator, end);
 4994|  17.1k|                                 }
 4995|   214k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 207k, False: 7.85k]
  |  Branch (4995:65): [True: 30.3k, False: 176k]
  |  Branch (4995:93): [True: 112k, False: 64.1k]
  ------------------
 4996|   142k|                                    yaml::skip_newline(value_indicator, end);
 4997|   142k|                                    auto value_line = value_indicator;
 4998|   142k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   142k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 6, False: 142k]
  ------------------
 5000|      6|                                       return false;
 5001|   142k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 137k, False: 5.83k]
  |  Branch (5001:62): [True: 8.33k, False: 128k]
  ------------------
 5002|  8.33k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 8.33k, False: 6]
  ------------------
 5003|  8.33k|                                       key.clear();
 5004|  8.33k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  8.33k|                                       it = value_line;
 5006|  8.33k|                                       handled_anchor_only_empty_key = true;
 5007|  8.33k|                                    }
 5008|   134k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 128k, False: 5.83k]
  |  Branch (5008:67): [True: 6, False: 128k]
  ------------------
 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|   142k|                                 }
 5016|   214k|                              }
 5017|   225k|                           }
 5018|   225k|                        }
 5019|       |
 5020|   596k|                        const bool key_content_spans_lines = [&] {
 5021|   596k|                           auto scan = key_it;
 5022|   596k|                           while (scan != content && scan != end) {
 5023|   596k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   596k|                              ++scan;
 5025|   596k|                           }
 5026|   596k|                           return false;
 5027|   596k|                        }();
 5028|       |
 5029|   596k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 18.9k, False: 577k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  18.9k|                        }
 5032|   577k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 6.26k, False: 571k]
  |  Branch (5032:53): [True: 8.62k, False: 562k]
  |  Branch (5032:72): [True: 5.94k, False: 2.67k]
  ------------------
 5033|  12.2k|                           key.clear();
 5034|  12.2k|                           it = content;
 5035|  12.2k|                        }
 5036|   565k|                        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|   565k|                           auto key_node_it = content;
 5042|   565k|                           auto key_node_end = end;
 5043|   565k|                           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|   565k|                              auto scan = content;
 5048|  2.67M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 2.61M, False: 59.9k]
  ------------------
 5049|   390M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 390M, False: 331k]
  |  Branch (5049:56): [True: 389M, False: 962k]
  |  Branch (5049:73): [True: 388M, False: 1.32M]
  ------------------
 5050|   388M|                                    ++scan;
 5051|   388M|                                 }
 5052|  2.61M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 331k, False: 2.28M]
  ------------------
 5053|   331k|                                    break;
 5054|   331k|                                 }
 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|  4.07M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 4.01M, False: 59.9k]
  |  Branch (5060:56): [True: 1.78M, False: 2.22M]
  ------------------
 5061|  1.78M|                                    ++indicator_indent;
 5062|  1.78M|                                    ++scan;
 5063|  1.78M|                                 }
 5064|       |
 5065|  2.28M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 2.22M, False: 59.9k]
  |  Branch (5065:53): [True: 227k, False: 1.99M]
  ------------------
 5066|   227k|                                    const auto after_colon = scan + 1;
 5067|   227k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 4.81k, False: 222k]
  ------------------
 5068|   222k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 192k, False: 30.0k]
  ------------------
 5069|   197k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 174k, False: 23.4k]
  ------------------
 5070|   174k|                                       key_node_end = line_start;
 5071|   174k|                                       break;
 5072|   174k|                                    }
 5073|   227k|                                 }
 5074|  2.28M|                              }
 5075|   565k|                           }
 5076|       |
 5077|   565k|                           glz::generic key_node{};
 5078|   565k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   565k|                           ctx.explicit_mapping_key_context = true;
 5080|   565k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   565k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   565k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 4.34k, False: 560k]
  ------------------
 5083|  4.34k|                              return false;
 5084|   560k|                           it = key_node_it;
 5085|   560k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 16, False: 560k]
  ------------------
 5086|     16|                              return false;
 5087|   560k|                        }
 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|   591k|                     yaml::skip_inline_ws(it, end);
 5098|   596k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   596k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 529k, False: 67.1k]
  |  Branch (5101:40): [True: 47.3k, False: 481k]
  |  Branch (5101:55): [True: 110k, False: 371k]
  ------------------
 5102|   157k|                        auto probe = it;
 5103|   157k|                        bool found_value_indicator = false;
 5104|       |
 5105|   192k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 181k, False: 11.8k]
  |  Branch (5105:49): [True: 55.2k, False: 125k]
  |  Branch (5105:67): [True: 125k, False: 0]
  ------------------
 5106|   181k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   181k|                           auto value_line = probe;
 5109|   181k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   181k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 6, False: 181k]
  ------------------
 5111|      6|                              return false;
 5112|       |
 5113|   181k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 11.2k, False: 169k]
  |  Branch (5113:53): [True: 3.68k, False: 166k]
  |  Branch (5113:76): [True: 9.78k, False: 156k]
  ------------------
 5114|  24.7k|                              probe = value_line;
 5115|  24.7k|                              continue; // blank line
 5116|  24.7k|                           }
 5117|   156k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 10.6k, False: 145k]
  ------------------
 5118|  10.6k|                              yaml::skip_comment(value_line, end);
 5119|  10.6k|                              probe = value_line;
 5120|  10.6k|                              continue; // comment-only line
 5121|  10.6k|                           }
 5122|   145k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 65.8k, False: 79.7k]
  |  Branch (5122:54): [True: 9.78k, False: 56.0k]
  ------------------
 5123|  9.78k|                              it = value_line;
 5124|  9.78k|                              found_value_indicator = true;
 5125|  9.78k|                           }
 5126|   145k|                           break;
 5127|   156k|                        }
 5128|       |
 5129|   157k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 9.78k, False: 147k]
  ------------------
 5130|  9.78k|                           yaml::skip_inline_ws(it, end);
 5131|  9.78k|                        }
 5132|   157k|                     }
 5133|       |
 5134|   596k|                     val_t val{};
 5135|   596k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 529k, False: 67.1k]
  |  Branch (5135:39): [True: 143k, False: 385k]
  ------------------
 5136|   143k|                        ++it;
 5137|   143k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 137k, False: 5.67k]
  |  Branch (5137:42): [True: 6, False: 137k]
  ------------------
 5138|      6|                           ctx.error = error_code::syntax_error;
 5139|      6|                           return false;
 5140|      6|                        }
 5141|   143k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 137k, False: 5.67k]
  |  Branch (5141:43): [True: 20.8k, False: 116k]
  |  Branch (5141:58): [True: 29.0k, False: 87.8k]
  ------------------
 5142|  49.8k|                           auto probe = it;
 5143|  49.8k|                           yaml::skip_newline(probe, end);
 5144|   110k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 97.7k, False: 12.6k]
  |  Branch (5144:51): [True: 60.5k, False: 37.2k]
  ------------------
 5145|  49.8k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 37.2k, False: 12.6k]
  |  Branch (5145:48): [True: 8.82k, False: 28.3k]
  |  Branch (5145:65): [True: 5.74k, False: 3.08k]
  |  Branch (5145:89): [True: 6, False: 5.73k]
  ------------------
 5146|      6|                              ctx.error = error_code::syntax_error;
 5147|      6|                              return false;
 5148|      6|                           }
 5149|  49.8k|                        }
 5150|   143k|                        yaml::skip_inline_ws(it, end);
 5151|   143k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 246, False: 143k]
  ------------------
 5152|    246|                           return false;
 5153|   143k|                     }
 5154|       |
 5155|   596k|                     value.emplace(std::move(key), std::move(val));
 5156|   596k|                     return true;
 5157|   596k|                  }
 5158|       |
 5159|  1.02M|                  key_t key{};
 5160|  1.02M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|  1.02M|                     auto key_probe = it;
 5162|  1.02M|                     yaml::skip_inline_ws(key_probe, end);
 5163|  1.02M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 1.02M, False: 0]
  |  Branch (5163:74): [True: 2.06k, False: 1.01M]
  |  Branch (5163:95): [True: 5.80k, False: 1.01M]
  ------------------
 5164|  1.02M|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 7.86k, False: 1.01M]
  ------------------
 5165|  7.86k|                        glz::generic key_node{};
 5166|  7.86k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  7.86k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 930, False: 6.93k]
  ------------------
 5168|    930|                           return false;
 5169|  6.93k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 6, False: 6.93k]
  ------------------
 5170|      6|                           return false;
 5171|  6.93k|                     }
 5172|  1.01M|                     else {
 5173|  1.01M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 16.2k, False: 997k]
  ------------------
 5174|  16.2k|                           return false;
 5175|  16.2k|                        }
 5176|  1.01M|                     }
 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.02M|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 17.3k, False: 1.00M]
  |  Branch (5186:36): [True: 70, False: 1.00M]
  ------------------
 5187|    238|                     ctx.error = error_code::syntax_error;
 5188|    238|                     return false;
 5189|    238|                  }
 5190|  1.02M|                  ++it;
 5191|  1.02M|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|  1.02M|                  val_t val{};
 5194|  1.02M|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 1.81k, False: 1.01M]
  ------------------
 5195|  1.81k|                     return false;
 5196|       |
 5197|  1.01M|                  value.emplace(std::move(key), std::move(val));
 5198|  1.01M|                  return true;
 5199|  1.02M|               });
_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|   596k|                        const bool key_content_spans_lines = [&] {
 5021|   596k|                           auto scan = key_it;
 5022|   602k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 449k, False: 152k]
  |  Branch (5022:54): [True: 449k, False: 0]
  ------------------
 5023|   449k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 292k, False: 156k]
  |  Branch (5023:52): [True: 150k, False: 5.82k]
  ------------------
 5024|  5.82k|                              ++scan;
 5025|  5.82k|                           }
 5026|   152k|                           return false;
 5027|   596k|                        }();
_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|   560k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   560k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   560k|                        };
_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|  1.14M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.14M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 1.13M, False: 17.0k]
  |  Branch (4884:39): [True: 947k, False: 182k]
  ------------------
 4885|   947k|                        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|   947k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   947k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 947k, False: 0]
  ------------------
 4893|   947k|                              auto is_line_content_start = [&](auto pos) {
 4894|   947k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   947k|                              };
 4896|       |
 4897|   947k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   947k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   947k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   947k|                                 return line != end && *line == ':';
 4901|   947k|                              };
 4902|       |
 4903|   947k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 947k, False: 0]
  ------------------
 4904|   947k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 19.9k, False: 927k]
  ------------------
 4905|  19.9k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 70, False: 19.8k]
  ------------------
 4906|     70|                                 ctx.error = error_code::syntax_error;
 4907|     70|                                 return false;
 4908|     70|                              }
 4909|   947k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   947k|                           }
 4911|   947k|                        }
 4912|       |
 4913|   947k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 9.95k, False: 937k]
  ------------------
 4914|  9.95k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 214, False: 9.74k]
  |  Branch (4914:49): [True: 2.59k, False: 7.14k]
  ------------------
 4915|  2.80k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 12, False: 2.79k]
  ------------------
 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|   947k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 947k]
  ------------------
 4922|      0|                           return false;
 4923|   947k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   947k|                        ctx.pop_indent();
 4925|   947k|                     }
 4926|   199k|                     else {
 4927|   199k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   199k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 61.1k, False: 138k]
  ------------------
 4929|  61.1k|                           yaml::skip_to_content(it, end);
 4930|  61.1k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 61.1k, False: 0]
  |  Branch (4930:45): [True: 0, False: 61.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|  61.1k|                           const int32_t value_indent =
 4937|  61.1k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 61.1k]
  ------------------
 4938|  61.1k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 61.1k]
  ------------------
 4939|      0|                              return false;
 4940|  61.1k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  61.1k|                           ctx.pop_indent();
 4942|  61.1k|                        }
 4943|   199k|                     }
 4944|  1.14M|                     return !bool(ctx.error);
 4945|  1.14M|                  };
_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|   947k|                              auto is_line_content_start = [&](auto pos) {
 4894|   947k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   947k|                              };
_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|   967k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   967k|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.55M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 1.55M, False: 0]
  |  Branch (4899:57): [True: 581k, False: 969k]
  |  Branch (4899:73): [True: 1.61k, False: 967k]
  ------------------
 4900|   967k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 967k, False: 0]
  |  Branch (4900:56): [True: 546k, False: 420k]
  ------------------
 4901|   967k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|  4.02M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  4.02M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 4.02M]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|  4.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_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   464k|      {
 5311|   464k|         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|   464k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   464k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   464k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   464k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 464k, False: 0]
  ------------------
 5321|   464k|            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|   464k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|   539k|      {
 4183|   539k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 539k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   539k|         auto peek = it;
 4188|   539k|         yaml::node_preamble_state preamble{};
 4189|   539k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 76.8k, False: 462k]
  ------------------
 4190|   539k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  76.8k|            it = peek;
 4192|  76.8k|            return;
 4193|  76.8k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   462k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   462k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 442, False: 462k]
  ------------------
 4198|    442|            return;
 4199|       |
 4200|   462k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 140k, False: 321k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|   140k|            it = peek;
 4203|   140k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|   140k|         }
 4205|   321k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 321k, 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|   321k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 490, False: 320k]
  |  Branch (4208:57): [True: 4.57k, False: 316k]
  ------------------
 4209|  5.06k|               it = peek;
 4210|  5.06k|            }
 4211|   321k|            int32_t seq_indent = ctx.current_indent();
 4212|   321k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 320k, False: 206]
  |  Branch (4212:31): [True: 177k, False: 143k]
  ------------------
 4213|   177k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 92.5k, False: 85.2k]
  |  Branch (4213:62): [True: 87.7k, False: 4.74k]
  ------------------
 4214|   177k|                                                          : (ctx.current_indent() + 1);
 4215|   177k|            }
 4216|   321k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   321k|         }
 4218|     84|         else {
 4219|     84|            ctx.error = error_code::syntax_error;
 4220|     84|         }
 4221|       |
 4222|   462k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   462k|      }
_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|   539k|      {
  466|   539k|         skip_inline_ws(it, end);
  467|       |
  468|   539k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 539k]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|   539k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   539k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 12, False: 539k]
  ------------------
  477|     12|            ctx.error = error_code::syntax_error;
  478|     12|            return true;
  479|     12|         }
  480|   539k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 539k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   539k|         skip_inline_ws(it, end);
  486|       |
  487|   539k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 539k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   539k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 76.7k, False: 462k]
  ------------------
  495|  76.7k|            return true;
  496|  76.7k|         }
  497|       |
  498|   462k|         return false;
  499|   539k|      }
_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|   539k|                                             [](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|   539k|      {
  409|   539k|         state.has_anchor = false;
  410|   539k|         state.anchor_name.clear();
  411|   539k|         state.anchor_start = nullptr;
  412|   539k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   539k|         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|   539k|            else {
  421|   539k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 76.7k, False: 462k]
  ------------------
  422|   539k|            }
  423|   539k|         }
  424|       |
  425|   539k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 462k, False: 76.7k]
  |  Branch (425:27): [True: 8.62k, False: 454k]
  ------------------
  426|  8.62k|            ++it;
  427|  8.62k|            auto name = parse_anchor_name(it, end);
  428|  8.62k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 28, False: 8.59k]
  ------------------
  429|     28|               ctx.error = error_code::syntax_error;
  430|     28|               return true;
  431|     28|            }
  432|  8.59k|            skip_inline_ws(it, end);
  433|  8.59k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 8.58k]
  ------------------
  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.58k|            state.has_anchor = true;
  446|  8.58k|            state.anchor_name = std::string(name);
  447|  8.58k|            state.anchor_start = &*it;
  448|  8.58k|         }
  449|       |
  450|   539k|         return false;
  451|   539k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   539k|      {
  301|   539k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 539k]
  |  Branch (301:27): [True: 462k, False: 76.7k]
  ------------------
  302|       |
  303|  76.7k|         ++it; // skip '*'
  304|  76.7k|         auto name = parse_anchor_name(it, end);
  305|  76.7k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 76.7k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  76.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  76.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 34, False: 76.6k]
  ------------------
  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|  76.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  76.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.57k, False: 75.1k]
  ------------------
  322|  1.57k|            return true;
  323|  1.57k|         }
  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|  75.1k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 56, False: 75.0k]
  ------------------
  329|     56|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     56|            return true;
  331|     56|         }
  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|  75.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  75.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 75.0k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  75.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 75.0k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  75.0k|         auto replay_it = span.begin;
  348|  75.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  75.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  75.0k|         ctx.indent_stack.clear();
  353|  75.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 5.84k, False: 69.2k]
  ------------------
  354|  5.84k|            ctx.push_indent(span.base_indent - 1);
  355|  5.84k|         }
  356|       |
  357|  75.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  75.0k|         using V = std::remove_cvref_t<T>;
  360|  75.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  75.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  75.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  75.0k|         return true;
  367|  75.0k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|   140k|      {
 2665|   140k|         using V = std::remove_cvref_t<T>;
 2666|   140k|         using value_type = typename V::value_type;
 2667|       |
 2668|   140k|         struct sequence_container_adapter
 2669|   140k|         {
 2670|   140k|            size_t index = 0;
 2671|       |
 2672|   140k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|   140k|            {
 2674|   140k|               if constexpr (!resizable<V>) {
 2675|   140k|                  return index >= container.size();
 2676|   140k|               }
 2677|   140k|               else {
 2678|   140k|                  (void)container;
 2679|   140k|                  return false;
 2680|   140k|               }
 2681|   140k|            }
 2682|       |
 2683|   140k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|   140k|            inline void append(V& container, value_type&& element) noexcept
 2686|   140k|            {
 2687|   140k|               if constexpr (emplace_backable<V>) {
 2688|   140k|                  container.emplace_back(std::move(element));
 2689|   140k|               }
 2690|   140k|               else if constexpr (emplaceable<V>) {
 2691|   140k|                  container.emplace(std::move(element));
 2692|   140k|               }
 2693|   140k|            }
 2694|   140k|         };
 2695|       |
 2696|   140k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 140k]
  |  Branch (2696:27): [True: 0, False: 140k]
  ------------------
 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|   140k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|   140k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|   140k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|   140k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 8, False: 140k]
  ------------------
 2709|      8|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|   140k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 137k, False: 3.77k]
  |  Branch (2712:27): [True: 25.4k, False: 111k]
  ------------------
 2713|  25.4k|            ++it;
 2714|  25.4k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  25.4k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 6, False: 25.4k]
  ------------------
 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.4k|            return;
 2723|  25.4k|         }
 2724|       |
 2725|   115k|         bool just_saw_comma = false;
 2726|   115k|         sequence_container_adapter adapter{};
 2727|       |
 2728|   115k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   213k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 209k, False: 4.62k]
  ------------------
 2731|   209k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   209k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 209k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   209k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 209k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   209k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 34.1k, False: 174k]
  ------------------
 2741|  34.1k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 34.1k, False: 0]
  ------------------
 2742|  34.1k|                     ++it;
 2743|  34.1k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  34.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 6, False: 34.1k]
  ------------------
 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|  34.1k|                     return;
 2752|  34.1k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  34.1k|               }
 2756|       |
 2757|   174k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 14, False: 174k]
  |  Branch (2757:34): [True: 10, False: 174k]
  ------------------
 2758|     24|                  ctx.error = error_code::syntax_error;
 2759|     24|                  return;
 2760|     24|               }
 2761|   174k|               just_saw_comma = false;
 2762|       |
 2763|   174k|               value_type element{};
 2764|   174k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   174k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 5.86k, False: 169k]
  ------------------
 2767|  5.86k|                  return;
 2768|       |
 2769|   169k|               bool saw_line_break_before_separator = false;
 2770|   169k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   169k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 6, False: 169k]
  ------------------
 2772|      6|                  return;
 2773|       |
 2774|   169k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 168k, False: 230]
  |  Branch (2774:33): [True: 23.1k, False: 145k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  23.1k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 6, False: 23.1k]
  ------------------
 2777|      6|                     ctx.error = error_code::syntax_error;
 2778|      6|                     return;
 2779|      6|                  }
 2780|  23.1k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  23.1k|                     glz::generic key_node = std::move(element);
 2782|  23.1k|                     ++it;
 2783|  23.1k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  23.1k|                     glz::generic mapped{};
 2786|  23.1k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  23.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 120, False: 23.0k]
  ------------------
 2788|    120|                        return;
 2789|       |
 2790|  23.0k|                     std::string key;
 2791|  23.0k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 4, False: 23.0k]
  ------------------
 2792|      4|                        return;
 2793|       |
 2794|  23.0k|                     glz::generic pair{};
 2795|  23.0k|                     pair[key] = std::move(mapped);
 2796|  23.0k|                     element = std::move(pair);
 2797|       |
 2798|  23.0k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  23.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 2, False: 23.0k]
  ------------------
 2800|      2|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  23.1k|               }
 2807|       |
 2808|   169k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   169k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 232, False: 168k]
  ------------------
 2811|    232|                  ctx.error = error_code::unexpected_end;
 2812|    232|                  return;
 2813|    232|               }
 2814|       |
 2815|   168k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 70.4k, False: 98.4k]
  ------------------
 2816|  70.4k|                  ++it;
 2817|  70.4k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  70.4k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 8, False: 70.4k]
  ------------------
 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|  70.4k|                  return;
 2826|  70.4k|               }
 2827|  98.4k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 98.2k, False: 186]
  ------------------
 2828|  98.2k|                  ++it;
 2829|  98.2k|                  just_saw_comma = true;
 2830|  98.2k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  98.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 6, False: 98.2k]
  ------------------
 2832|      6|                     return;
 2833|  98.2k|               }
 2834|    186|               else {
 2835|    186|                  ctx.error = error_code::syntax_error;
 2836|    186|                  return;
 2837|    186|               }
 2838|   168k|            }
 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|   115k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   462k|      {
 2649|   462k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   462k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   462k|               value.clear();
 2653|   462k|            }
 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|   462k|      }
_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|   168k|            {
 2687|   168k|               if constexpr (emplace_backable<V>) {
 2688|   168k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   168k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   321k|      {
 3160|   321k|         using V = std::remove_cvref_t<T>;
 3161|   321k|         using value_type = typename V::value_type;
 3162|       |
 3163|   321k|         struct sequence_container_adapter
 3164|   321k|         {
 3165|   321k|            size_t index = 0;
 3166|       |
 3167|   321k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   321k|            {
 3169|   321k|               if constexpr (!resizable<V>) {
 3170|   321k|                  return index >= container.size();
 3171|   321k|               }
 3172|   321k|               else {
 3173|   321k|                  (void)container;
 3174|   321k|                  return false;
 3175|   321k|               }
 3176|   321k|            }
 3177|       |
 3178|   321k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   321k|            inline void append(V& container, value_type&& element) noexcept
 3181|   321k|            {
 3182|   321k|               if constexpr (emplace_backable<V>) {
 3183|   321k|                  container.emplace_back(std::move(element));
 3184|   321k|               }
 3185|   321k|               else if constexpr (emplaceable<V>) {
 3186|   321k|                  container.emplace(std::move(element));
 3187|   321k|               }
 3188|   321k|            }
 3189|   321k|         };
 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|   321k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   321k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   321k|         bool first_item = true;
 3200|   321k|         bool has_pending_item_anchor = false;
 3201|   321k|         std::string pending_item_anchor_name{};
 3202|   321k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   661k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 616k, False: 45.0k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   616k|            int32_t line_indent = 0;
 3215|   616k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   616k|            auto line_start = it;
 3217|       |
 3218|   852k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 835k, False: 17.2k]
  ------------------
 3219|   835k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 48.2k, False: 787k]
  ------------------
 3220|  48.2k|                  skip_comment(it, end);
 3221|  48.2k|                  skip_newline(it, end);
 3222|  48.2k|                  line_start = it;
 3223|  48.2k|                  line_indent = 0;
 3224|  48.2k|               }
 3225|   787k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 49.1k, False: 738k]
  |  Branch (3225:40): [True: 95.9k, False: 642k]
  ------------------
 3226|   145k|                  skip_newline(it, end);
 3227|   145k|                  line_start = it;
 3228|   145k|                  line_indent = 0;
 3229|   145k|               }
 3230|   642k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 55.2k, False: 586k]
  ------------------
 3231|  55.2k|                  line_start = it;
 3232|  55.2k|                  line_indent = 0;
 3233|  4.53M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 4.53M, False: 4.05k]
  |  Branch (3233:39): [True: 4.48M, False: 51.2k]
  ------------------
 3234|  4.48M|                     ++line_indent;
 3235|  4.48M|                     ++it;
 3236|  4.48M|                  }
 3237|       |
 3238|  55.2k|                  bool saw_tab = false;
 3239|  66.4k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 61.3k, False: 5.02k]
  |  Branch (3239:40): [True: 5.61k, False: 55.7k]
  |  Branch (3239:54): [True: 5.51k, False: 50.2k]
  ------------------
 3240|  11.1k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 6.24k, False: 4.88k]
  |  Branch (3240:43): [True: 4.88k, False: 0]
  ------------------
 3241|  11.1k|                     ++it;
 3242|  11.1k|                  }
 3243|       |
 3244|  55.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 5.02k, False: 50.2k]
  |  Branch (3244:36): [True: 5.01k, False: 45.2k]
  |  Branch (3244:51): [True: 12.1k, False: 33.1k]
  |  Branch (3244:66): [True: 3.23k, False: 29.8k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  25.4k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 20.3k, False: 5.02k]
  |  Branch (3246:39): [True: 3.23k, False: 17.1k]
  ------------------
 3247|  3.23k|                        skip_comment(it, end);
 3248|  3.23k|                     }
 3249|  25.4k|                     line_indent = 0;
 3250|  25.4k|                     continue;
 3251|  25.4k|                  }
 3252|       |
 3253|  29.8k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 8, False: 29.8k]
  ------------------
 3254|      8|                     ctx.error = error_code::syntax_error;
 3255|      8|                     return;
 3256|      8|                  }
 3257|  29.8k|                  break; // Found content
 3258|  29.8k|               }
 3259|   586k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 17.9k, False: 568k]
  ------------------
 3260|  17.9k|                  line_start = it;
 3261|  51.3k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 50.8k, False: 502]
  |  Branch (3261:40): [True: 3.23k, False: 47.5k]
  |  Branch (3261:54): [True: 30.1k, False: 17.3k]
  ------------------
 3262|  17.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 502, False: 17.3k]
  |  Branch (3262:36): [True: 7.06k, False: 10.3k]
  |  Branch (3262:51): [True: 2.61k, False: 7.71k]
  |  Branch (3262:66): [True: 7.68k, False: 28]
  ------------------
 3263|  17.8k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 17.3k, False: 502]
  |  Branch (3263:39): [True: 7.68k, False: 9.68k]
  ------------------
 3264|  7.68k|                        skip_comment(it, end);
 3265|  7.68k|                     }
 3266|  17.8k|                     line_indent = 0;
 3267|  17.8k|                     continue;
 3268|  17.8k|                  }
 3269|     28|                  ctx.error = error_code::syntax_error;
 3270|     28|                  return;
 3271|  17.9k|               }
 3272|   568k|               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|   568k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 321k, False: 247k]
  |  Branch (3276:37): [True: 320k, False: 198]
  ------------------
 3277|   320k|                     line_indent = sequence_indent;
 3278|   320k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   320k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 320k, False: 0]
  |  Branch (3279:49): [True: 320k, False: 0]
  ------------------
 3280|   320k|                           auto probe = it;
 3281|   320k|                           int32_t leading_ws = 0;
 3282|   320k|                           bool saw_tab = false;
 3283|   567k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 567k, False: 0]
  |  Branch (3283:64): [True: 224k, False: 343k]
  |  Branch (3283:87): [True: 22.5k, False: 320k]
  ------------------
 3284|   246k|                              --probe;
 3285|   246k|                              ++leading_ws;
 3286|   246k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 1.00k, False: 245k]
  |  Branch (3286:52): [True: 22.0k, False: 223k]
  ------------------
 3287|   246k|                           }
 3288|   320k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 320k]
  |  Branch (3288:61): [True: 11.8k, False: 309k]
  |  Branch (3288:85): [True: 122k, False: 187k]
  ------------------
 3289|   133k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 6, False: 133k]
  ------------------
 3290|      6|                                 ctx.error = error_code::syntax_error;
 3291|      6|                                 return;
 3292|      6|                              }
 3293|   133k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|   133k|                           }
 3295|   320k|                        }
 3296|   320k|                     }
 3297|   320k|                  }
 3298|   320k|                  break;
 3299|   568k|               }
 3300|   835k|            }
 3301|       |
 3302|   615k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 17.2k, False: 598k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   598k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 15.9k, False: 582k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   582k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 54.9k, False: 527k]
  ------------------
 3309|  54.9k|               it = line_start;
 3310|  54.9k|               return;
 3311|  54.9k|            }
 3312|       |
 3313|   527k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 23.9k, False: 503k]
  ------------------
 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.9k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 84, False: 23.8k]
  ------------------
 3318|     84|                  ctx.error = error_code::syntax_error;
 3319|     84|                  return;
 3320|     84|               }
 3321|       |
 3322|  23.8k|               ++it;
 3323|  23.8k|               auto pending_name = parse_anchor_name(it, end);
 3324|  23.8k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 18, False: 23.8k]
  ------------------
 3325|     18|                  ctx.error = error_code::syntax_error;
 3326|     18|                  return;
 3327|     18|               }
 3328|  23.8k|               skip_inline_ws(it, end);
 3329|  23.8k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 23.7k, False: 44]
  |  Branch (3329:33): [True: 2.89k, False: 20.8k]
  ------------------
 3330|  2.89k|                  skip_comment(it, end);
 3331|  2.89k|               }
 3332|       |
 3333|  23.8k|               has_pending_item_anchor = true;
 3334|  23.8k|               pending_item_anchor_name = std::string(pending_name);
 3335|  23.8k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  23.8k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 44, False: 23.7k]
  |  Branch (3337:34): [True: 16.8k, False: 6.93k]
  |  Branch (3337:49): [True: 28, False: 16.8k]
  ------------------
 3338|     72|                  ctx.error = error_code::syntax_error;
 3339|     72|                  return;
 3340|     72|               }
 3341|       |
 3342|  23.7k|               skip_newline(it, end);
 3343|  23.7k|               continue;
 3344|  23.8k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   503k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 117k, False: 385k]
  ------------------
 3348|   117k|               it = line_start;
 3349|   117k|               return;
 3350|   117k|            }
 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|   385k|            dash_col = line_indent;
 3356|   385k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   385k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 385k, False: 6]
  ------------------
 3358|   385k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   385k|               }
 3360|   385k|            }
 3361|       |
 3362|   385k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   385k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 379k, False: 6.55k]
  |  Branch (3365:30): [True: 68.6k, False: 310k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  68.6k|               it = line_start;
 3368|  68.6k|               return;
 3369|  68.6k|            }
 3370|       |
 3371|   317k|            bool saw_tab_after_dash = false;
 3372|   616k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 607k, False: 8.57k]
  |  Branch (3372:34): [True: 179k, False: 428k]
  |  Branch (3372:48): [True: 120k, False: 308k]
  ------------------
 3373|   299k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.31k, False: 294k]
  |  Branch (3373:59): [True: 118k, False: 176k]
  ------------------
 3374|   299k|               ++it;
 3375|   299k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   317k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 118k, False: 198k]
  |  Branch (3377:39): [True: 118k, False: 562]
  |  Branch (3377:52): [True: 786, False: 117k]
  ------------------
 3378|    786|               const auto after_dash = it + 1;
 3379|    786|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 6, False: 780]
  |  Branch (3379:41): [True: 6, False: 774]
  ------------------
 3380|     12|                  ctx.error = error_code::syntax_error;
 3381|     12|                  return;
 3382|     12|               }
 3383|    786|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   317k|            auto parse_element = [&](auto& element) {
 3387|   317k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   317k|               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|   317k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   317k|                     return;
 3397|   317k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   317k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   317k|                  ctx.sequence_item_value_context = true;
 3400|   317k|                  ctx.sequence_dash_indent = dash_col;
 3401|   317k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   317k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   317k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   317k|                  ctx.pop_indent();
 3405|   317k|               }
 3406|   317k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   317k|                  skip_ws_and_comment(it, end);
 3409|   317k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   317k|                  auto nested_start = it;
 3413|   317k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   317k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   317k|                     return;
 3416|   317k|                  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|   317k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   317k|                  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|   317k|                     const int32_t element_indent =
 3428|   317k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   317k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   317k|                        return;
 3431|   317k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   317k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   317k|                     ctx.sequence_item_value_context = true;
 3434|   317k|                     ctx.sequence_dash_indent = dash_col;
 3435|   317k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   317k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   317k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   317k|                     ctx.pop_indent();
 3439|   317k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   317k|               }
 3442|       |
 3443|   317k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   317k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   317k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   317k|                                                                      pending_item_anchor_indent};
 3447|   317k|                  has_pending_item_anchor = false;
 3448|   317k|               }
 3449|   317k|            };
 3450|       |
 3451|   317k|            if constexpr (emplace_backable<V>) {
 3452|   317k|               auto& element = value.emplace_back();
 3453|   317k|               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|   317k|            first_item = false;
 3472|       |
 3473|   317k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 1.15k, False: 316k]
  ------------------
 3474|  1.15k|               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|   317k|         }
 3479|   321k|      }
_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|   317k|            auto parse_element = [&](auto& element) {
 3387|   317k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 308k, False: 8.56k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   317k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 308k, False: 8.56k]
  |  Branch (3390:33): [True: 225k, False: 83.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|   225k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 225k]
  ------------------
 3396|      0|                     return;
 3397|   225k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   225k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   225k|                  ctx.sequence_item_value_context = true;
 3400|   225k|                  ctx.sequence_dash_indent = dash_col;
 3401|   225k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   225k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   225k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   225k|                  ctx.pop_indent();
 3405|   225k|               }
 3406|  91.8k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  91.8k|                  skip_ws_and_comment(it, end);
 3409|  91.8k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  91.8k|                  auto nested_start = it;
 3413|  91.8k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  91.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 10, False: 91.8k]
  ------------------
 3415|     10|                     return;
 3416|  91.8k|                  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|  91.8k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 3.48k, False: 88.3k]
  ------------------
 3422|  91.8k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 25.4k, False: 66.4k]
  ------------------
 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|  25.4k|                     const int32_t element_indent =
 3428|  25.4k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 25.4k]
  ------------------
 3429|  25.4k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 25.4k]
  ------------------
 3430|      0|                        return;
 3431|  25.4k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  25.4k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  25.4k|                     ctx.sequence_item_value_context = true;
 3434|  25.4k|                     ctx.sequence_dash_indent = dash_col;
 3435|  25.4k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  25.4k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  25.4k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  25.4k|                     ctx.pop_indent();
 3439|  25.4k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  91.8k|               }
 3442|       |
 3443|   317k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 11.7k, False: 305k]
  |  Branch (3443:47): [True: 11.5k, False: 214]
  ------------------
 3444|  11.5k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 10.2k, False: 1.28k]
  ------------------
 3445|  11.5k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  11.5k|                                                                      pending_item_anchor_indent};
 3447|  11.5k|                  has_pending_item_anchor = false;
 3448|  11.5k|               }
 3449|   317k|            };
_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.71M|   {
 5531|  1.71M|      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.71M|         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.71M|            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.71M|            bool at_node_start = true;
 5542|  1.71M|            int depth = 0;
 5543|  1.71M|            while (pos != stop) {
 5544|  1.71M|               const char c = *pos;
 5545|  1.71M|               if (c == ' ' || c == '\t') {
 5546|  1.71M|                  ++pos;
 5547|  1.71M|                  continue;
 5548|  1.71M|               }
 5549|  1.71M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  1.71M|               if ((c == '"' || c == '\'') && node_start) {
 5552|  1.71M|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|  1.71M|                  continue;
 5554|  1.71M|               }
 5555|  1.71M|               if (c == '[' || c == '{') {
 5556|  1.71M|                  ++depth;
 5557|  1.71M|                  at_node_start = true;
 5558|  1.71M|                  ++pos;
 5559|  1.71M|                  continue;
 5560|  1.71M|               }
 5561|  1.71M|               if (c == ']' || c == '}') {
 5562|  1.71M|                  if (depth == 0) return false;
 5563|  1.71M|                  --depth;
 5564|  1.71M|                  ++pos;
 5565|  1.71M|                  continue;
 5566|  1.71M|               }
 5567|  1.71M|               if (c == ',' && depth == 0) return false;
 5568|  1.71M|               if (c == ':' && depth == 0) {
 5569|  1.71M|                  auto next = pos + 1;
 5570|  1.71M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|  1.71M|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  1.71M|               if (c == ',' || c == ':') {
 5574|  1.71M|                  at_node_start = true;
 5575|  1.71M|                  ++pos;
 5576|  1.71M|                  continue;
 5577|  1.71M|               }
 5578|  1.71M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|  1.71M|                  at_node_start = true;
 5580|  1.71M|                  continue;
 5581|  1.71M|               }
 5582|  1.71M|               ++pos;
 5583|  1.71M|            }
 5584|  1.71M|            return false;
 5585|  1.71M|         };
 5586|       |
 5587|  1.71M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5587:14): [True: 743k, False: 974k]
  |  Branch (5587:49): [True: 25.2k, False: 948k]
  ------------------
 5588|   768k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5588:17): [True: 699k, False: 69.5k]
  ------------------
 5589|   699k|               return;
 5590|   699k|            }
 5591|  69.5k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5591:17): [True: 2.52k, False: 67.0k]
  ------------------
 5592|  2.52k|               return;
 5593|  2.52k|            }
 5594|  69.5k|         }
 5595|       |
 5596|  1.01M|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|  1.01M|         return;
 5598|  1.71M|      }
 5599|       |
 5600|  1.71M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 0, False: 1.71M]
  ------------------
 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.71M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 0, False: 1.71M]
  ------------------
 5605|      0|         return;
 5606|      0|      }
 5607|  1.71M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|  1.71M|   }
_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.71M|         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.71M|            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.71M|            bool at_node_start = true;
 5542|  1.71M|            int depth = 0;
 5543|  19.5M|            while (pos != stop) {
  ------------------
  |  Branch (5543:20): [True: 19.2M, False: 227k]
  ------------------
 5544|  19.2M|               const char c = *pos;
 5545|  19.2M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5545:20): [True: 1.99M, False: 17.2M]
  |  Branch (5545:32): [True: 281k, False: 17.0M]
  ------------------
 5546|  2.28M|                  ++pos;
 5547|  2.28M|                  continue;
 5548|  2.28M|               }
 5549|  17.0M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  17.0M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5551:21): [True: 186k, False: 16.8M]
  |  Branch (5551:33): [True: 31.1k, False: 16.7M]
  |  Branch (5551:47): [True: 117k, False: 100k]
  ------------------
 5552|   117k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5552:23): [True: 26.1k, False: 90.9k]
  ------------------
 5553|  90.9k|                  continue;
 5554|   117k|               }
 5555|  16.8M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5555:20): [True: 165k, False: 16.7M]
  |  Branch (5555:32): [True: 164k, False: 16.5M]
  ------------------
 5556|   329k|                  ++depth;
 5557|   329k|                  at_node_start = true;
 5558|   329k|                  ++pos;
 5559|   329k|                  continue;
 5560|   329k|               }
 5561|  16.5M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5561:20): [True: 112k, False: 16.4M]
  |  Branch (5561:32): [True: 161k, False: 16.2M]
  ------------------
 5562|   273k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5562:23): [True: 131k, False: 142k]
  ------------------
 5563|   142k|                  --depth;
 5564|   142k|                  ++pos;
 5565|   142k|                  continue;
 5566|   273k|               }
 5567|  16.2M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5567:20): [True: 774k, False: 15.5M]
  |  Branch (5567:32): [True: 474k, False: 300k]
  ------------------
 5568|  15.8M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5568:20): [True: 1.20M, False: 14.5M]
  |  Branch (5568:32): [True: 858k, False: 348k]
  ------------------
 5569|   858k|                  auto next = pos + 1;
 5570|   858k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5570:26): [True: 5.79k, False: 852k]
  |  Branch (5570:41): [True: 618k, False: 234k]
  |  Branch (5570:57): [True: 42.4k, False: 192k]
  |  Branch (5570:74): [True: 35.7k, False: 156k]
  |  Branch (5570:91): [True: 41.6k, False: 114k]
  ------------------
 5571|   858k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  14.9M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5573:20): [True: 300k, False: 14.6M]
  |  Branch (5573:32): [True: 348k, False: 14.2M]
  ------------------
 5574|   648k|                  at_node_start = true;
 5575|   648k|                  ++pos;
 5576|   648k|                  continue;
 5577|   648k|               }
 5578|  14.2M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5578:20): [True: 1.89M, False: 12.4M]
  |  Branch (5578:34): [True: 205k, False: 1.69M]
  ------------------
 5579|   205k|                  at_node_start = true;
 5580|   205k|                  continue;
 5581|   205k|               }
 5582|  14.0M|               ++pos;
 5583|  14.0M|            }
 5584|   227k|            return false;
 5585|  1.71M|         };
_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|   211k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   211k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 2.44k, False: 209k]
  ------------------
 5964|  2.44k|                  return true;
 5965|  2.44k|               }
 5966|   209k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 159k, False: 50.4k]
  ------------------
 5967|   159k|                  auto next = ptr + 1;
 5968|   159k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 1.90k, False: 157k]
  |  Branch (5968:43): [True: 111k, False: 45.5k]
  |  Branch (5968:59): [True: 29.1k, False: 16.3k]
  |  Branch (5968:76): [True: 8.07k, False: 8.30k]
  |  Branch (5968:93): [True: 5.46k, False: 2.84k]
  ------------------
 5969|   159k|               }
 5970|  50.4k|               return is_plain_scalar_boundary(*ptr);
 5971|   209k|            };
_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|  50.4k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  50.4k|               switch (ch) {
 5890|  2.54k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 2.54k, False: 47.9k]
  ------------------
 5891|  5.17k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 2.63k, False: 47.8k]
  ------------------
 5892|  7.34k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 2.16k, False: 48.3k]
  ------------------
 5893|  24.8k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 17.4k, False: 32.9k]
  ------------------
 5894|  32.8k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 8.04k, False: 42.4k]
  ------------------
 5895|  35.2k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 2.32k, False: 48.1k]
  ------------------
 5896|  36.7k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 1.50k, False: 48.9k]
  ------------------
 5897|  36.7k|                  return true;
 5898|  13.7k|               default:
  ------------------
  |  Branch (5898:16): [True: 13.7k, False: 36.7k]
  ------------------
 5899|  13.7k|                  return false;
 5900|  50.4k|               }
 5901|  50.4k|            };
_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|   195k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|   195k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|   195k|                  return false;
 5906|   195k|               }
 5907|   195k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 0, False: 195k]
  ------------------
 5908|      0|                  return false;
 5909|      0|               }
 5910|   195k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 195k, False: 0]
  |  Branch (5910:40): [True: 0, False: 0]
  |  Branch (5910:61): [True: 0, False: 0]
  ------------------
 5911|      0|                  return false;
 5912|      0|               }
 5913|       |
 5914|   195k|               auto look = word_end;
 5915|   195k|               yaml::skip_newline(look, end);
 5916|   195k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 0, False: 195k]
  ------------------
 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|   195k|               return false;
 5961|   195k|            };
_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.79M|   {
 5485|  1.79M|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|  1.79M|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|  1.79M|         const bool could_be_mapping = [&] {
 5493|  1.79M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  1.79M|               return line_could_be_flow_mapping(it, end);
 5495|  1.79M|            }
 5496|  1.79M|            else {
 5497|  1.79M|               return yaml::line_could_be_block_mapping(it, end);
 5498|  1.79M|            }
 5499|  1.79M|         }();
 5500|  1.79M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 1.03M, False: 755k]
  ------------------
 5501|  1.03M|            return false;
 5502|  1.03M|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   755k|         auto temp_ctx = ctx.make_speculative();
 5505|   755k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   755k|                                                                                               end);
 5507|   755k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   755k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   755k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 748k, False: 7.11k]
  ------------------
 5510|   748k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   748k|            return true;
 5512|   748k|         }
 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.11k|         ctx.error = temp_ctx.error;
 5517|  7.11k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  7.11k|         return false;
 5519|   755k|      }
 5520|  1.79M|   }
_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.79M|         const bool could_be_mapping = [&] {
 5493|  1.79M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  1.79M|               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|       |            else {
 5497|       |               return yaml::line_could_be_block_mapping(it, end);
 5498|       |            }
 5499|  1.79M|         }();
_ZN3glz4yaml15materialize_keyILb0ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  1.51M|   {
   39|       |      if constexpr (empty_on_null) {
   40|       |         if (key_node.is_null()) {
   41|       |            key.clear();
   42|       |            return true;
   43|       |         }
   44|       |      }
   45|  1.51M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 96.9k, False: 1.41M]
  ------------------
   46|  96.9k|         key = *s;
   47|  96.9k|         return true;
   48|  96.9k|      }
   49|  1.41M|      key.clear();
   50|  1.41M|      (void)glz::write_json(key_node, key);
   51|  1.41M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  1.41M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 62, False: 1.41M]
  ------------------
   53|     62|            ctx.error = error_code::exceeded_max_expansion;
   54|     62|            ctx.custom_error_message = "complex key expansion";
   55|     62|            return false;
   56|     62|         }
   57|  1.41M|      }
   58|  1.41M|      return true;
   59|  1.51M|   }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  2.11M|      {
  275|  2.11M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  2.11M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  2.11M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  2.11M|      }
_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.59M|      {
 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.59M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  2.59M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  2.59M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  2.59M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  2.59M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 2.59M]
  ------------------
 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.59M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 1.41M, False: 1.17M]
  ------------------
 5769|  1.41M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  1.41M|         }
 5771|  1.17M|         else {
 5772|  1.17M|            yaml::skip_inline_ws(it, end);
 5773|  1.17M|         }
 5774|       |
 5775|  2.59M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 66, False: 2.59M]
  ------------------
 5776|     66|            ctx.error = error_code::unexpected_end;
 5777|     66|            return;
 5778|     66|         }
 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.59M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  2.59M|            using V = std::remove_cvref_t<T>;
 5886|  2.59M|            using counts = yaml_variant_type_count<V>;
 5887|  2.59M|            const char c = *it;
 5888|  2.59M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  2.59M|               switch (ch) {
 5890|  2.59M|               case ' ':
 5891|  2.59M|               case '\t':
 5892|  2.59M|               case '\n':
 5893|  2.59M|               case '\r':
 5894|  2.59M|               case ',':
 5895|  2.59M|               case ']':
 5896|  2.59M|               case '}':
 5897|  2.59M|                  return true;
 5898|  2.59M|               default:
 5899|  2.59M|                  return false;
 5900|  2.59M|               }
 5901|  2.59M|            };
 5902|       |
 5903|  2.59M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  2.59M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  2.59M|                  return false;
 5906|  2.59M|               }
 5907|  2.59M|               if (ctx.current_indent() < 0) {
 5908|  2.59M|                  return false;
 5909|  2.59M|               }
 5910|  2.59M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  2.59M|                  return false;
 5912|  2.59M|               }
 5913|       |
 5914|  2.59M|               auto look = word_end;
 5915|  2.59M|               yaml::skip_newline(look, end);
 5916|  2.59M|               while (look != end) {
 5917|  2.59M|                  int32_t line_indent = 0;
 5918|  2.59M|                  while (look != end && *look == ' ') {
 5919|  2.59M|                     ++line_indent;
 5920|  2.59M|                     ++look;
 5921|  2.59M|                  }
 5922|  2.59M|                  if (look != end && *look == '\t') {
 5923|  2.59M|                     return false;
 5924|  2.59M|                  }
 5925|  2.59M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  2.59M|                     if (look != end) {
 5927|  2.59M|                        yaml::skip_newline(look, end);
 5928|  2.59M|                        continue;
 5929|  2.59M|                     }
 5930|  2.59M|                     return false;
 5931|  2.59M|                  }
 5932|  2.59M|                  if (*look == '#') {
 5933|  2.59M|                     yaml::skip_comment(look, end);
 5934|  2.59M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  2.59M|                        yaml::skip_newline(look, end);
 5936|  2.59M|                        continue;
 5937|  2.59M|                     }
 5938|  2.59M|                     return false;
 5939|  2.59M|                  }
 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.59M|                  {
 5945|  2.59M|                     auto scan = look;
 5946|  2.59M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  2.59M|                        if (*scan == ':') {
 5948|  2.59M|                           auto after_colon = scan + 1;
 5949|  2.59M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  2.59M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  2.59M|                              return false;
 5952|  2.59M|                           }
 5953|  2.59M|                        }
 5954|  2.59M|                        ++scan;
 5955|  2.59M|                     }
 5956|  2.59M|                  }
 5957|       |
 5958|  2.59M|                  return line_indent > ctx.current_indent();
 5959|  2.59M|               }
 5960|  2.59M|               return false;
 5961|  2.59M|            };
 5962|  2.59M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  2.59M|               if (ptr == end) {
 5964|  2.59M|                  return true;
 5965|  2.59M|               }
 5966|  2.59M|               if (*ptr == ':') {
 5967|  2.59M|                  auto next = ptr + 1;
 5968|  2.59M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  2.59M|               }
 5970|  2.59M|               return is_plain_scalar_boundary(*ptr);
 5971|  2.59M|            };
 5972|       |
 5973|  2.59M|            switch (c) {
 5974|   596k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 596k, False: 1.99M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   596k|               ++it;
 5977|   596k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   596k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 40, False: 596k]
  ------------------
 5979|     40|                  ctx.error = error_code::syntax_error;
 5980|     40|                  return;
 5981|     40|               }
 5982|   596k|               yaml::skip_inline_ws(it, end);
 5983|   596k|               bool anchor_on_same_line = true;
 5984|   596k|               bool value_is_indentless_sequence = false;
 5985|   596k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 13.9k, False: 582k]
  |  Branch (5985:33): [True: 56.4k, False: 526k]
  |  Branch (5985:48): [True: 130k, False: 396k]
  |  Branch (5985:63): [True: 20.5k, False: 375k]
  ------------------
 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|   221k|                  bool value_on_next_line = false;
 5989|   221k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 207k, False: 13.9k]
  ------------------
 5990|   207k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|   207k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 20.5k, False: 186k]
  ------------------
 5993|   165k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 164k, False: 794]
  |  Branch (5993:47): [True: 153k, False: 10.8k]
  |  Branch (5993:64): [True: 144k, False: 8.84k]
  ------------------
 5994|  20.5k|                     }
 5995|       |                     // Skip newline
 5996|   207k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 206k, False: 794]
  |  Branch (5996:42): [True: 67.3k, False: 139k]
  |  Branch (5996:59): [True: 139k, False: 0]
  ------------------
 5997|   206k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   339k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 320k, False: 18.8k]
  |  Branch (5999:48): [True: 48.8k, False: 271k]
  |  Branch (5999:65): [True: 83.9k, False: 187k]
  ------------------
 6000|   132k|                           yaml::skip_newline(peek, end);
 6001|   132k|                        }
 6002|       |                        // Measure indent of next content line
 6003|   206k|                        int32_t next_indent = 0;
 6004|   376k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 354k, False: 21.8k]
  |  Branch (6004:47): [True: 170k, False: 184k]
  ------------------
 6005|   170k|                           ++next_indent;
 6006|   170k|                           ++peek;
 6007|   170k|                        }
 6008|   206k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 184k, False: 21.8k]
  |  Branch (6008:44): [True: 183k, False: 1.62k]
  |  Branch (6008:61): [True: 181k, False: 1.78k]
  ------------------
 6009|   181k|                           const bool indentless_sequence =
 6010|   181k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 178k, False: 2.40k]
  |  Branch (6010:69): [True: 43.3k, False: 135k]
  ------------------
 6011|  43.3k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 358, False: 42.9k]
  ------------------
 6012|  42.9k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 39.7k, False: 3.20k]
  ------------------
 6013|  40.1k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 3.99k, False: 36.1k]
  ------------------
 6014|  36.1k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 18.8k, False: 17.2k]
  |  Branch (6014:61): [True: 17.6k, False: 1.16k]
  ------------------
 6015|   181k|                           value_is_indentless_sequence = indentless_sequence;
 6016|   181k|                           const bool same_indent_property_node =
 6017|   181k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 15.8k, False: 165k]
  ------------------
 6018|  15.8k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 1.43k, False: 14.4k]
  |  Branch (6018:48): [True: 3.36k, False: 11.0k]
  |  Branch (6018:64): [True: 238, False: 10.8k]
  |  Branch (6018:80): [True: 758, False: 10.0k]
  |  Branch (6018:96): [True: 650, False: 9.40k]
  ------------------
 6019|  9.40k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 926, False: 8.48k]
  |  Branch (6019:48): [True: 538, False: 7.94k]
  |  Branch (6019:65): [True: 202, False: 7.74k]
  |  Branch (6019:81): [True: 2.37k, False: 5.36k]
  ------------------
 6020|   181k|                           value_on_next_line =
 6021|   181k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 131k, False: 49.6k]
  |  Branch (6021:71): [True: 21.6k, False: 28.0k]
  |  Branch (6021:94): [True: 10.4k, False: 17.5k]
  ------------------
 6022|   181k|                        }
 6023|   206k|                     }
 6024|   207k|                  }
 6025|   221k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 57.5k, False: 163k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  57.5k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  57.5k|                     return;
 6029|  57.5k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|   163k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 13.2k, False: 150k]
  ------------------
 6032|   102k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 102k, False: 0]
  |  Branch (6032:42): [True: 92.8k, False: 9.61k]
  |  Branch (6032:57): [True: 89.2k, False: 3.64k]
  ------------------
 6033|  13.2k|                  }
 6034|   163k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 163k, False: 0]
  ------------------
 6035|   255k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 255k, False: 0]
  |  Branch (6035:40): [True: 20.8k, False: 235k]
  |  Branch (6035:55): [True: 71.2k, False: 163k]
  ------------------
 6036|  92.0k|                     yaml::skip_newline(it, end);
 6037|  92.0k|                  }
 6038|   163k|                  yaml::skip_inline_ws(it, end);
 6039|   163k|                  anchor_on_same_line = false;
 6040|   163k|               }
 6041|       |
 6042|   539k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|   539k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6043:23): [True: 375k, False: 163k]
  |  Branch (6043:46): [True: 5.43k, False: 370k]
  ------------------
 6044|  5.43k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6044:24): [True: 8, False: 5.42k]
  |  Branch (6044:43): [True: 6, False: 5.42k]
  ------------------
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|     14|                     ctx.error = error_code::syntax_error;
 6047|     14|                     return;
 6048|     14|                  }
 6049|   539k|               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   539k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 539k, False: 30]
  |  Branch (6053:33): [True: 3.32k, False: 535k]
  |  Branch (6053:47): [True: 32, False: 3.29k]
  ------------------
 6054|     32|                  ctx.error = error_code::syntax_error;
 6055|     32|                  return;
 6056|     32|               }
 6057|       |
 6058|   539k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|   539k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6059:23): [True: 163k, False: 375k]
  |  Branch (6059:47): [True: 163k, False: 16]
  |  Branch (6059:60): [True: 8.84k, False: 154k]
  ------------------
 6060|  8.84k|                     auto probe = it + 1;
 6061|  8.84k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|  8.84k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6062:26): [True: 22, False: 8.82k]
  ------------------
 6063|     22|                        ctx.error = error_code::syntax_error;
 6064|     22|                        return;
 6065|     22|                     }
 6066|  8.82k|                     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|  8.82k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6070:26): [True: 80, False: 8.74k]
  ------------------
 6071|     80|                        ctx.error = error_code::syntax_error;
 6072|     80|                        return;
 6073|     80|                     }
 6074|  8.82k|                  }
 6075|   539k|               }
 6076|       |
 6077|   539k|               const char* anchor_start = &*it;
 6078|   539k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|   539k|               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|   539k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6084:23): [True: 375k, False: 163k]
  |  Branch (6084:46): [True: 104k, False: 270k]
  ------------------
 6085|   104k|                     auto key_start = it;
 6086|   104k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6086:26): [True: 3.06k, False: 101k]
  ------------------
 6087|  3.06k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|  3.06k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6088:29): [True: 6, False: 3.05k]
  |  Branch (6088:67): [True: 6, False: 3.05k]
  ------------------
 6089|     12|                           ctx.error = error_code::syntax_error;
 6090|     12|                           return;
 6091|     12|                        }
 6092|  3.05k|                        yaml::skip_inline_ws(key_start, end);
 6093|  3.05k|                        if (key_start == end) {
  ------------------
  |  Branch (6093:29): [True: 6, False: 3.04k]
  ------------------
 6094|      6|                           ctx.error = error_code::unexpected_end;
 6095|      6|                           return;
 6096|      6|                        }
 6097|  3.04k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6097:29): [True: 6, False: 3.04k]
  |  Branch (6097:51): [True: 6, False: 3.03k]
  ------------------
 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.03k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6106:29): [True: 1.21k, False: 1.81k]
  |  Branch (6106:50): [True: 6, False: 1.21k]
  ------------------
 6107|      6|                           ctx.error = error_code::syntax_error;
 6108|      6|                           return;
 6109|      6|                        }
 6110|  3.03k|                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|   104k|                     auto key_scan = key_start;
 6114|   104k|                     auto key_end = key_start;
 6115|   104k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6115:26): [True: 820, False: 103k]
  |  Branch (6115:46): [True: 1.12k, False: 102k]
  ------------------
 6116|       |                        // Quoted key: skip to closing quote
 6117|  1.94k|                        const char quote = *key_scan;
 6118|  1.94k|                        ++key_scan;
 6119|  9.58k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6119:32): [True: 9.58k, False: 0]
  |  Branch (6119:51): [True: 7.63k, False: 1.94k]
  ------------------
 6120|  7.63k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6120:32): [True: 432, False: 7.20k]
  |  Branch (6120:53): [True: 210, False: 222]
  ------------------
 6121|    210|                              ++key_scan;
 6122|    210|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6122:35): [True: 210, False: 0]
  ------------------
 6123|    210|                           }
 6124|  7.42k|                           else {
 6125|  7.42k|                              ++key_scan;
 6126|  7.42k|                           }
 6127|  7.63k|                        }
 6128|  1.94k|                        if (key_scan == end) {
  ------------------
  |  Branch (6128:29): [True: 0, False: 1.94k]
  ------------------
 6129|      0|                           ctx.error = error_code::syntax_error;
 6130|      0|                           return;
 6131|      0|                        }
 6132|  1.94k|                        ++key_scan; // past closing quote
 6133|  1.94k|                        key_end = key_scan;
 6134|  1.94k|                        yaml::skip_inline_ws(key_scan, end);
 6135|  1.94k|                     }
 6136|   102k|                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|  1.38M|                        while (key_scan != end) {
  ------------------
  |  Branch (6138:32): [True: 1.38M, False: 6]
  ------------------
 6139|  1.38M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6139:32): [True: 137k, False: 1.24M]
  ------------------
 6140|   137k|                              auto next = key_scan + 1;
 6141|   137k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6141:35): [True: 24.3k, False: 113k]
  |  Branch (6141:50): [True: 47.9k, False: 65.5k]
  |  Branch (6141:66): [True: 12.7k, False: 52.8k]
  |  Branch (6141:83): [True: 13.8k, False: 38.9k]
  |  Branch (6141:100): [True: 3.75k, False: 35.1k]
  ------------------
 6142|   102k|                                 break;
 6143|   102k|                              }
 6144|   137k|                           }
 6145|  1.27M|                           ++key_scan;
 6146|  1.27M|                        }
 6147|   102k|                        key_end = key_scan;
 6148|   119k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6148:32): [True: 106k, False: 13.1k]
  |  Branch (6148:57): [True: 15.7k, False: 90.3k]
  |  Branch (6148:82): [True: 682, False: 89.6k]
  ------------------
 6149|  16.4k|                           --key_end;
 6150|  16.4k|                        }
 6151|   102k|                     }
 6152|   104k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6152:26): [True: 12, False: 104k]
  |  Branch (6152:45): [True: 62, False: 104k]
  ------------------
 6153|     74|                        ctx.error = error_code::syntax_error;
 6154|     74|                        return;
 6155|     74|                     }
 6156|       |                     // Store anchor with just the key text span
 6157|   104k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|   104k|                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|   104k|                     if constexpr (counts::n_object > 0) {
 6161|   104k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|   104k|                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|   104k|                     return;
 6168|   104k|                  }
 6169|   539k|               }
 6170|       |
 6171|   434k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   539k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   539k|               redispatch<Opts>(value, ctx, it, end);
 6174|   539k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   539k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 402k, False: 136k]
  ------------------
 6176|   402k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|   402k|               }
 6178|   539k|               return;
 6179|   539k|            }
 6180|  30.0k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 30.0k, False: 2.56M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|  30.0k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|  30.0k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6183:23): [True: 6.96k, False: 23.0k]
  ------------------
 6184|  6.96k|                     if constexpr (counts::n_object > 0) {
 6185|  6.96k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|  6.96k|                                                                                                        end);
 6187|  6.96k|                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|  6.96k|                  }
 6194|  30.0k|               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|  30.0k|               return;
 6199|   539k|            }
 6200|   228k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 228k, False: 2.36M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   228k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   228k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 16, False: 228k]
  ------------------
 6204|     16|                  ctx.error = error_code::syntax_error;
 6205|     16|                  return;
 6206|     16|               }
 6207|   228k|               yaml::skip_inline_ws(it, end);
 6208|   228k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 219k, False: 8.82k]
  |  Branch (6208:33): [True: 37.6k, False: 182k]
  ------------------
 6209|  37.6k|                  yaml::skip_comment(it, end);
 6210|  37.6k|               }
 6211|   228k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 218k, False: 9.93k]
  |  Branch (6211:34): [True: 45.4k, False: 173k]
  |  Branch (6211:49): [True: 58.3k, False: 114k]
  ------------------
 6212|   103k|                  auto content = it;
 6213|   103k|                  yaml::skip_newline(content, end);
 6214|   103k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|   103k|                  bool consume_following_content = false;
 6217|   103k|                  auto content_token = content;
 6218|   103k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 86.8k, False: 16.9k]
  ------------------
 6219|  86.8k|                     auto indent_probe = content;
 6220|  86.8k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  86.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 8, False: 86.7k]
  ------------------
 6222|      8|                        return;
 6223|  86.7k|                     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|  86.7k|                     bool tagged_indentless_sequence = false;
 6228|  86.7k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 13.8k, False: 72.9k]
  |  Branch (6228:56): [True: 13.8k, False: 0]
  |  Branch (6228:79): [True: 12.4k, False: 1.40k]
  ------------------
 6229|  12.4k|                        const auto after_dash = indent_probe + 1;
 6230|  12.4k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 2.33k, False: 10.1k]
  ------------------
 6231|  11.5k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 9.24k, False: 882]
  ------------------
 6232|  11.5k|                           tagged_indentless_sequence =
 6233|  11.5k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 1.55k, False: 10.0k]
  ------------------
 6234|  10.0k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 5.45k, False: 4.57k]
  |  Branch (6234:60): [True: 838, False: 4.61k]
  ------------------
 6235|  11.5k|                        }
 6236|  12.4k|                     }
 6237|       |
 6238|  86.7k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 21.9k, False: 64.8k]
  ------------------
 6239|  64.8k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 20.9k, False: 43.8k]
  |  Branch (6239:93): [True: 2.38k, False: 41.4k]
  ------------------
 6240|  86.7k|                  }
 6241|       |
 6242|   103k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 45.3k, False: 58.4k]
  ------------------
 6243|  45.3k|                     it = content_token;
 6244|  45.3k|                  }
 6245|  58.4k|                  else {
 6246|  58.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 8.60k, False: 49.8k]
  ------------------
 6247|  8.60k|                        if constexpr (counts::n_str > 0) {
 6248|  8.60k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  8.60k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  8.60k|                           value = StrType{};
 6251|  8.60k|                           return;
 6252|  8.60k|                        }
 6253|  8.60k|                     }
 6254|  58.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 330, False: 58.1k]
  ------------------
 6255|    330|                        if constexpr (counts::n_null > 0) {
 6256|    330|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    330|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    330|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 330]
  ------------------
 6259|    330|                           return;
 6260|    330|                        }
 6261|    330|                     }
 6262|  58.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 43.8k, False: 14.6k]
  ------------------
 6263|  43.8k|                        if constexpr (counts::n_null > 0) {
 6264|  43.8k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  43.8k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  43.8k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 43.8k]
  ------------------
 6267|  43.8k|                           return;
 6268|  43.8k|                        }
 6269|  43.8k|                     }
 6270|  58.4k|                  }
 6271|   103k|               }
 6272|   228k|               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|   228k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6275:23): [True: 165k, False: 62.6k]
  |  Branch (6275:36): [True: 6, False: 165k]
  ------------------
 6276|      6|                     ctx.error = error_code::syntax_error;
 6277|      6|                     return;
 6278|      6|                  }
 6279|   228k|                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|   228k|                     const bool starts_block_sequence_entry =
 6282|   228k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6282:26): [True: 165k, False: 62.6k]
  |  Branch (6282:39): [True: 20.4k, False: 145k]
  ------------------
 6283|  20.4k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6283:26): [True: 3.07k, False: 17.4k]
  |  Branch (6283:45): [True: 15.5k, False: 1.87k]
  ------------------
 6284|   228k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6284:26): [True: 157k, False: 71.3k]
  |  Branch (6284:58): [True: 8.32k, 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.32k|                        redispatch<Opts>(value, ctx, it, end);
 6288|  8.32k|                        return;
 6289|  8.32k|                     }
 6290|   228k|                  }
 6291|   228k|               }
 6292|   228k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 9.93k, False: 218k]
  ------------------
 6293|  9.93k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 2.78k, False: 7.15k]
  ------------------
 6294|  2.78k|                     if constexpr (counts::n_str > 0) {
 6295|  2.78k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|  2.78k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|  2.78k|                        value = StrType{};
 6298|  2.78k|                        return;
 6299|  2.78k|                     }
 6300|  2.78k|                  }
 6301|  9.93k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 7.15k, False: 2.78k]
  ------------------
 6302|  7.15k|                     if constexpr (counts::n_null > 0) {
 6303|  7.15k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  7.15k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  7.15k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 7.15k]
  ------------------
 6306|  7.15k|                        return;
 6307|  7.15k|                     }
 6308|  7.15k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  9.93k|                  return;
 6311|  9.93k|               }
 6312|   218k|               switch (tag) {
 6313|  2.90k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 2.90k, False: 215k]
  ------------------
 6314|  2.90k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  2.90k|                  return;
 6316|  6.68k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 6.68k, False: 211k]
  ------------------
 6317|  6.90k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 212, False: 218k]
  ------------------
 6318|  6.90k|                  if constexpr (counts::n_num > 0) {
 6319|  6.90k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  6.90k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  37.4k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 30.5k, False: 188k]
  ------------------
 6327|  37.4k|                  if constexpr (counts::n_bool > 0) {
 6328|  37.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  37.4k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  37.9k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 416, False: 218k]
  ------------------
 6336|  37.9k|                  if constexpr (counts::n_null > 0) {
 6337|  37.9k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  37.9k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  37.9k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 37.9k]
  ------------------
 6340|  37.9k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  37.9k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  55.6k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 17.7k, False: 200k]
  ------------------
 6348|  55.6k|                  if constexpr (counts::n_object > 0) {
 6349|  55.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  55.6k|                                                                                                     end);
 6351|  55.6k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  84.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 28.3k, False: 190k]
  ------------------
 6358|  84.0k|                  if constexpr (counts::n_array > 0) {
 6359|  84.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|  84.0k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|  84.0k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6361:29): [True: 28.3k, False: 55.6k]
  |  Branch (6361:42): [True: 12.1k, False: 16.2k]
  ------------------
 6362|  12.1k|                           ctx.allow_indentless_sequence = true;
 6363|  12.1k|                        }
 6364|  84.0k|                     }
 6365|  84.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  84.0k|                                                                                                    end);
 6367|  84.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  84.0k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   154k|               default: {
  ------------------
  |  Branch (6374:16): [True: 70.6k, False: 147k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   154k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 70.6k, False: 84.0k]
  |  Branch (6377:36): [True: 13.5k, False: 57.0k]
  ------------------
 6378|  13.5k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  13.5k|                     return;
 6380|  13.5k|                  }
 6381|       |
 6382|   141k|                  if constexpr (counts::n_array > 0) {
 6383|   141k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 57.0k, False: 84.0k]
  |  Branch (6383:39): [True: 1.16k, False: 55.9k]
  ------------------
 6384|  1.16k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  1.16k|                                                                                                       end);
 6386|  1.16k|                        return;
 6387|  1.16k|                     }
 6388|   141k|                  }
 6389|   141k|                  if constexpr (counts::n_object > 0) {
 6390|   141k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 55.9k, False: 85.1k]
  |  Branch (6390:39): [True: 4.63k, False: 51.2k]
  ------------------
 6391|  4.63k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  4.63k|                                                                                                        end);
 6393|  4.63k|                        return;
 6394|  4.63k|                     }
 6395|   141k|                  }
 6396|       |
 6397|   141k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|   141k|                     if constexpr (counts::n_array > 0) {
 6399|   141k|                        const bool starts_block_sequence_entry =
 6400|   141k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6400:29): [True: 51.2k, False: 89.8k]
  |  Branch (6400:42): [True: 7.68k, False: 43.5k]
  ------------------
 6401|  7.68k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6401:29): [True: 744, False: 6.94k]
  |  Branch (6401:48): [True: 6.15k, False: 786]
  ------------------
 6402|   141k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6402:29): [True: 6.90k, False: 134k]
  ------------------
 6403|  6.90k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|  6.90k|                                                                                                          it, end);
 6405|  6.90k|                           return;
 6406|  6.90k|                        }
 6407|   141k|                     }
 6408|   141k|                     if constexpr (counts::n_object > 0) {
 6409|   141k|                        const bool starts_explicit_mapping_indicator =
 6410|   141k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6410:29): [True: 44.3k, False: 96.7k]
  |  Branch (6410:43): [True: 2.40k, False: 41.9k]
  |  Branch (6410:57): [True: 3.41k, False: 38.5k]
  ------------------
 6411|  5.82k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6411:29): [True: 200, False: 5.62k]
  |  Branch (6411:48): [True: 1.39k, False: 4.22k]
  ------------------
 6412|   141k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6412:29): [True: 1.59k, False: 139k]
  ------------------
 6413|  1.59k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|  1.59k|                                                                                                           it, end);
 6415|  1.59k|                           return;
 6416|  1.59k|                        }
 6417|   139k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6417:29): [True: 0, False: 139k]
  ------------------
 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|   139k|                     }
 6423|   141k|                  }
 6424|       |
 6425|   141k|                  if constexpr (counts::n_str > 0) {
 6426|   141k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   141k|                     return;
 6428|   141k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   141k|                  return;
 6433|   154k|               }
 6434|   218k|               }
 6435|      0|               return;
 6436|   218k|            }
 6437|   136k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 136k, False: 2.45M]
  ------------------
 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: 102k, False: 33.2k]
  |  Branch (6440:51): [True: 11.6k, False: 91.2k]
  ------------------
 6441|  11.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|  11.6k|                                                                                                     end);
 6443|  11.6k|                     return;
 6444|  11.6k|                  }
 6445|   136k|               }
 6446|       |               // Flow mapping - object type
 6447|   124k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|   136k|               return;
 6449|  71.1k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 71.1k, False: 2.51M]
  ------------------
 6450|  71.1k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|  71.1k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6452:23): [True: 38.4k, False: 32.7k]
  |  Branch (6452:51): [True: 538, False: 37.9k]
  ------------------
 6453|    538|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|    538|                                                                                                     end);
 6455|    538|                     return;
 6456|    538|                  }
 6457|  71.1k|               }
 6458|       |               // Flow sequence - array type
 6459|  70.6k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  71.1k|               return;
 6461|   485k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 485k, False: 2.10M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   485k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 482k, False: 2.68k]
  |  Branch (6463:39): [True: 10, False: 482k]
  ------------------
 6464|     10|                  ctx.error = error_code::syntax_error;
 6465|     10|                  return;
 6466|     10|               }
 6467|   485k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 482k, False: 2.68k]
  |  Branch (6467:40): [True: 162k, False: 319k]
  |  Branch (6467:56): [True: 223k, False: 96.4k]
  |  Branch (6467:73): [True: 72.5k, False: 23.8k]
  ------------------
 6468|   458k|                  if constexpr (counts::n_object > 0) {
 6469|   458k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   458k|                                                                                                     end);
 6471|   458k|                     return;
 6472|   458k|                  }
 6473|   458k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   485k|               return;
 6476|     20|            case '%':
  ------------------
  |  Branch (6476:13): [True: 20, False: 2.59M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     20|               ctx.error = error_code::syntax_error;
 6479|     20|               return;
 6480|  13.9k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 13.9k, False: 2.57M]
  ------------------
 6481|  17.4k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 3.42k, False: 2.58M]
  ------------------
 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|  17.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  17.4k|               return;
 6486|  38.8k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 38.8k, False: 2.55M]
  ------------------
 6487|  72.0k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 33.1k, False: 2.55M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  72.0k|               if constexpr (counts::n_bool > 0) {
 6490|  72.0k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 66.8k, False: 5.21k]
  |  Branch (6490:44): [True: 35.9k, False: 30.8k]
  |  Branch (6490:60): [True: 33.8k, False: 2.18k]
  |  Branch (6490:76): [True: 29.9k, False: 3.88k]
  ------------------
 6491|  36.8k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 6.71k, False: 30.1k]
  |  Branch (6491:60): [True: 4.61k, False: 2.10k]
  |  Branch (6491:76): [True: 3.11k, False: 1.50k]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  33.0k|                     const auto after_true = it + 4;
 6494|  33.0k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  33.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 31.1k, False: 1.92k]
  ------------------
 6497|  31.1k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 376, False: 30.7k]
  ------------------
 6498|    376|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|    376|                           return;
 6500|    376|                        }
 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.7k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 29.9k, False: 776]
  |  Branch (6503:47): [True: 17.5k, False: 12.3k]
  ------------------
 6504|  17.5k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 13.5k, False: 3.97k]
  |  Branch (6504:47): [True: 726, False: 3.24k]
  |  Branch (6504:63): [True: 1.13k, False: 2.11k]
  |  Branch (6504:80): [True: 1.41k, False: 696]
  |  Branch (6504:97): [True: 696, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  17.5k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  17.5k|                           return;
 6508|  17.5k|                        }
 6509|  13.1k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  13.1k|                                                                                                      end);
 6511|  13.1k|                        return;
 6512|  30.7k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  33.0k|                  }
 6515|  72.0k|               }
 6516|  40.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  72.0k|               return;
 6518|  58.7k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 58.7k, False: 2.53M]
  ------------------
 6519|  71.0k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 12.3k, False: 2.57M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  71.0k|               if constexpr (counts::n_bool > 0) {
 6522|  71.0k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 69.9k, False: 1.13k]
  |  Branch (6522:44): [True: 55.7k, False: 14.2k]
  |  Branch (6522:60): [True: 45.8k, False: 9.89k]
  |  Branch (6522:76): [True: 41.1k, False: 4.62k]
  |  Branch (6522:92): [True: 37.8k, False: 3.34k]
  ------------------
 6523|  38.2k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 3.84k, False: 28.2k]
  |  Branch (6523:60): [True: 2.32k, False: 1.52k]
  |  Branch (6523:76): [True: 1.03k, False: 1.29k]
  |  Branch (6523:92): [True: 366, False: 666]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  38.2k|                     const auto after_false = it + 5;
 6526|  38.2k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  38.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 32.1k, False: 6.06k]
  ------------------
 6529|  32.1k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 248, False: 31.8k]
  ------------------
 6530|    248|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|    248|                           return;
 6532|    248|                        }
 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|  31.8k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 31.3k, False: 554]
  |  Branch (6535:47): [True: 22.9k, False: 8.41k]
  ------------------
 6536|  22.9k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 3.36k, False: 19.5k]
  |  Branch (6536:47): [True: 1.39k, False: 18.1k]
  |  Branch (6536:63): [True: 5.10k, False: 13.0k]
  |  Branch (6536:80): [True: 12.4k, False: 604]
  |  Branch (6536:97): [True: 604, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  22.9k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  22.9k|                           return;
 6540|  22.9k|                        }
 6541|  8.97k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  8.97k|                                                                                                      end);
 6543|  8.97k|                        return;
 6544|  31.8k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  38.2k|                  }
 6547|  71.0k|               }
 6548|  38.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  71.0k|               return;
 6550|  23.6k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 23.6k, False: 2.56M]
  ------------------
 6551|  50.4k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 26.7k, False: 2.56M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  50.4k|               if constexpr (counts::n_null > 0) {
 6554|  50.4k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 48.6k, False: 1.79k]
  |  Branch (6554:44): [True: 22.2k, False: 26.3k]
  |  Branch (6554:60): [True: 20.2k, False: 2.05k]
  |  Branch (6554:76): [True: 19.0k, False: 1.19k]
  ------------------
 6555|  31.1k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 13.4k, False: 16.1k]
  |  Branch (6555:60): [True: 12.5k, False: 852]
  |  Branch (6555:76): [True: 12.0k, False: 488]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  31.1k|                     const auto after_null = it + 4;
 6558|  31.1k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  31.1k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 27.4k, False: 3.65k]
  ------------------
 6561|  27.4k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 1.79k, False: 25.7k]
  ------------------
 6562|  1.79k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|  1.79k|                           return;
 6564|  1.79k|                        }
 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.7k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 24.7k, False: 966]
  |  Branch (6567:47): [True: 4.47k, False: 20.2k]
  ------------------
 6568|  4.47k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 1.26k, False: 3.21k]
  |  Branch (6568:47): [True: 326, False: 2.88k]
  |  Branch (6568:63): [True: 254, False: 2.63k]
  |  Branch (6568:80): [True: 766, False: 1.86k]
  |  Branch (6568:97): [True: 1.86k, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  4.47k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  4.47k|                           return;
 6572|  4.47k|                        }
 6573|  21.2k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  21.2k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  21.2k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 21.2k]
  ------------------
 6576|  21.2k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  21.2k|                        return;
 6578|  25.7k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  31.1k|                  }
 6581|  50.4k|               }
 6582|  22.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  50.4k|               return;
 6584|  5.59k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 5.59k, False: 2.58M]
  ------------------
 6585|       |               // Null indicator
 6586|  5.59k|               if constexpr (counts::n_null > 0) {
 6587|  5.59k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  5.59k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  5.59k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 5.59k]
  ------------------
 6590|  5.59k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  5.59k|                  return;
 6592|  5.59k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   302k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 302k, False: 2.28M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   302k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 15.9k, False: 287k]
  |  Branch (6596:41): [True: 173k, False: 113k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   189k|                  if constexpr (counts::n_array > 0) {
 6599|   189k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   189k|                                                                                                    end);
 6601|   189k|                     return;
 6602|   189k|                  }
 6603|   189k|               }
 6604|   302k|               if constexpr (counts::n_num > 0) {
 6605|   302k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 113k, False: 189k]
  |  Branch (6605:43): [True: 3.65k, False: 110k]
  |  Branch (6605:94): [True: 5.51k, False: 104k]
  ------------------
 6606|  9.17k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  9.17k|                     return;
 6608|  9.17k|                  }
 6609|   302k|               }
 6610|   293k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   302k|               return;
 6612|  23.0k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 23.0k, False: 2.56M]
  ------------------
 6613|  63.6k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 40.6k, False: 2.54M]
  ------------------
 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|  63.6k|               if constexpr (counts::n_num > 0) {
 6617|  63.6k|                  auto start_it = it;
 6618|  63.6k|                  auto temp_ctx = ctx.make_speculative();
 6619|  63.6k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  63.6k|                                                                                               end);
 6621|  63.6k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  63.6k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  63.6k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 7.43k, False: 56.2k]
  ------------------
 6624|  7.43k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  7.43k|                     return; // Successfully parsed as number
 6626|  7.43k|                  }
 6627|  56.2k|                  it = start_it; // Restore and fall through to string
 6628|  56.2k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  63.6k|               return;
 6631|   459k|            default:
  ------------------
  |  Branch (6631:13): [True: 459k, False: 2.13M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|   459k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 286k, False: 173k]
  |  Branch (6633:32): [True: 80.1k, False: 205k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  80.1k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 9.90k, False: 70.2k]
  ------------------
 6636|  9.90k|                     return;
 6637|  9.90k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  70.2k|                  if constexpr (counts::n_num > 0) {
 6640|  70.2k|                     auto start_it = it;
 6641|  70.2k|                     auto temp_ctx = ctx.make_speculative();
 6642|  70.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  70.2k|                                                                                                  end);
 6644|  70.2k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  70.2k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  70.2k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 17.9k, False: 52.3k]
  ------------------
 6647|  17.9k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  17.9k|                        return; // Successfully parsed as number
 6649|  17.9k|                     }
 6650|  52.3k|                     it = start_it; // Restore and fall through to string
 6651|  52.3k|                  }
 6652|       |                  // Fall through to string
 6653|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6654|  70.2k|                  return;
 6655|  80.1k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   379k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   379k|               return;
 6659|  2.59M|            }
 6660|  2.59M|         }
 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.59M|         error_code expansion_error{};
 6670|  2.59M|         std::string_view expansion_message{};
 6671|       |
 6672|  2.59M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  2.59M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  2.59M|            auto start = it;
 6675|       |
 6676|  2.59M|            V v{};
 6677|  2.59M|            auto temp_ctx = ctx.make_speculative();
 6678|  2.59M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  2.59M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  2.59M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  2.59M|            if (!bool(temp_ctx.error)) {
 6683|  2.59M|               value = std::move(v);
 6684|  2.59M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  2.59M|               return true;
 6686|  2.59M|            }
 6687|       |
 6688|  2.59M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  2.59M|               expansion_error = temp_ctx.error;
 6690|  2.59M|               expansion_message = temp_ctx.custom_error_message;
 6691|  2.59M|            }
 6692|  2.59M|            it = start;
 6693|  2.59M|            return false;
 6694|  2.59M|         };
 6695|       |
 6696|  2.59M|         bool parsed = false;
 6697|  2.59M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  2.59M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  2.59M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  2.59M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 2.59M]
  ------------------
 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.59M|      }
_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.05M|      {
 5311|  1.05M|         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.05M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  1.05M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  1.05M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  1.05M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 1.05M, False: 0]
  ------------------
 5321|  1.05M|            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.05M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4616|  1.05M|      {
 4617|  1.05M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 1.05M]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|  1.05M|         yaml::node_preamble_state preamble{};
 4621|  1.05M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 7.29k, False: 1.05M]
  ------------------
 4622|  1.05M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  7.29k|            return;
 4624|       |
 4625|  1.05M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|  1.05M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 2.60k, False: 1.04M]
  ------------------
 4627|  2.60k|            return;
 4628|       |
 4629|  1.04M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|  1.04M|         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.04M|         std::remove_cvref_t<T> preexisting_entries;
 4643|  1.04M|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 1.04M]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|  1.04M|         struct merge_restore_guard
 4648|  1.04M|         {
 4649|  1.04M|            std::remove_cvref_t<T>& target;
 4650|  1.04M|            std::remove_cvref_t<T>& saved;
 4651|  1.04M|            ~merge_restore_guard()
 4652|  1.04M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  1.04M|               for (auto& entry : saved) {
 4656|  1.04M|                  target.emplace(entry.first, std::move(entry.second));
 4657|  1.04M|               }
 4658|  1.04M|            }
 4659|  1.04M|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|  1.04M|         const bool treat_as_block_mapping =
 4662|  1.04M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [True: 1.04M, Folded]
  |  Branch (4662:48): [True: 155k, False: 893k]
  |  Branch (4662:62): [True: 2.51k, False: 152k]
  ------------------
 4663|       |
 4664|  1.04M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 155k, False: 893k]
  |  Branch (4664:28): [True: 152k, False: 2.51k]
  ------------------
 4665|       |            // Flow mapping
 4666|   152k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|   152k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|   152k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 143k, False: 9.15k]
  |  Branch (4670:30): [True: 7.29k, False: 136k]
  ------------------
 4671|  7.29k|               ++it;
 4672|  7.29k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  7.29k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 6, False: 7.29k]
  ------------------
 4674|      6|                  return;
 4675|  7.29k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  7.29k|               return;
 4677|  7.29k|            }
 4678|       |
 4679|   610k|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 592k, False: 18.2k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|   592k|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|   592k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 592k, False: 0]
  |  Branch (4683:33): [True: 18.1k, False: 574k]
  ------------------
 4684|  18.1k|                  ++it;
 4685|  18.1k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  18.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 10, False: 18.1k]
  ------------------
 4687|     10|                     return;
 4688|  18.1k|                  break;
 4689|  18.1k|               }
 4690|       |
 4691|   574k|               bool explicit_flow_key = false;
 4692|   574k|               auto explicit_probe = it;
 4693|   574k|               yaml::skip_inline_ws(explicit_probe, end);
 4694|   574k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 574k, False: 0]
  |  Branch (4694:45): [True: 9.96k, False: 564k]
  ------------------
 4695|  9.96k|                  const auto after_q = explicit_probe + 1;
 4696|  9.96k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 6, False: 9.96k]
  |  Branch (4696:41): [True: 6.71k, False: 3.24k]
  ------------------
 4697|  7.74k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 786, False: 2.46k]
  |  Branch (4697:42): [True: 238, False: 2.22k]
  ------------------
 4698|  7.74k|                     explicit_flow_key = true;
 4699|  7.74k|                     it = explicit_probe + 1;
 4700|  7.74k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  7.74k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 6, False: 7.73k]
  ------------------
 4702|      6|                        return;
 4703|  7.74k|                  }
 4704|  9.96k|               }
 4705|       |               // Parse key
 4706|   574k|               key_t key{};
 4707|   574k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|   574k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 7.73k, False: 566k]
  |  Branch (4708:44): [True: 7.73k, False: 8]
  |  Branch (4708:58): [True: 1.19k, False: 6.54k]
  |  Branch (4708:72): [True: 1.10k, False: 5.43k]
  |  Branch (4708:86): [True: 542, False: 4.89k]
  ------------------
 4709|  2.83k|                     key.clear();
 4710|  2.83k|                  }
 4711|   571k|                  else {
 4712|   571k|                     auto key_probe = it;
 4713|   571k|                     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|   571k|                     bool parse_complex_flow_key = false;
 4718|   571k|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 571k, False: 8]
  ------------------
 4719|   571k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 1.02k, False: 570k]
  |  Branch (4719:50): [True: 6.75k, False: 563k]
  ------------------
 4720|  7.78k|                           parse_complex_flow_key = true;
 4721|  7.78k|                        }
 4722|   563k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 70.3k, False: 493k]
  ------------------
 4723|  70.3k|                           ++key_probe;
 4724|  70.3k|                           yaml::parse_anchor_name(key_probe, end);
 4725|  70.3k|                           yaml::skip_inline_ws(key_probe, end);
 4726|  70.3k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 70.3k, False: 50]
  |  Branch (4726:53): [True: 228, False: 70.1k]
  |  Branch (4726:74): [True: 38.1k, False: 31.9k]
  ------------------
 4727|  38.3k|                              parse_complex_flow_key = true;
 4728|  38.3k|                           }
 4729|  70.3k|                        }
 4730|   571k|                     }
 4731|       |
 4732|   571k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 46.1k, False: 525k]
  ------------------
 4733|  46.1k|                        glz::generic key_node{};
 4734|  46.1k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  46.1k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 2.26k, False: 43.8k]
  ------------------
 4736|  2.26k|                           return;
 4737|  43.8k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 10, False: 43.8k]
  ------------------
 4738|     10|                           return;
 4739|  43.8k|                     }
 4740|   525k|                     else {
 4741|   525k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 21.7k, False: 503k]
  ------------------
 4742|  21.7k|                           return;
 4743|  21.7k|                        }
 4744|   525k|                     }
 4745|   571k|                  }
 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|   550k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|   574k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 6, False: 574k]
  ------------------
 4761|      6|                  return;
 4762|       |
 4763|   574k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|   574k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|   574k|                     val = {};
 4766|   574k|                     return true;
 4767|   574k|                  }
 4768|   574k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   574k|                     val = glz::generic{};
 4770|   574k|                     return true;
 4771|   574k|                  }
 4772|   574k|                  else {
 4773|   574k|                     static constexpr std::string_view null_value{"null"};
 4774|   574k|                     auto null_it = null_value.data();
 4775|   574k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|   574k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|   574k|                     return !bool(ctx.error);
 4778|   574k|                  }
 4779|   574k|               };
 4780|       |
 4781|   574k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 550k, False: 24.0k]
  |  Branch (4781:34): [True: 201k, False: 349k]
  |  Branch (4781:48): [True: 33.2k, False: 315k]
  ------------------
 4782|   234k|                  val_t val{};
 4783|   234k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 234k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|   234k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|   234k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 33.2k, False: 201k]
  ------------------
 4789|  33.2k|                     ++it;
 4790|  33.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  33.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 6, False: 33.2k]
  ------------------
 4792|      6|                        return;
 4793|  33.2k|                     break;
 4794|  33.2k|                  }
 4795|       |
 4796|   201k|                  ++it; // skip comma
 4797|   201k|                  yaml::skip_ws_and_newlines(it, end);
 4798|   201k|                  continue;
 4799|   234k|               }
 4800|       |
 4801|   339k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 24.0k, False: 315k]
  |  Branch (4801:33): [True: 66, False: 315k]
  ------------------
 4802|    158|                  ctx.error = error_code::syntax_error;
 4803|    158|                  return;
 4804|    158|               }
 4805|   339k|               ++it;
 4806|       |
 4807|   339k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|   339k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 6, False: 339k]
  ------------------
 4809|      6|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|   339k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 315k, False: 23.9k]
  |  Branch (4812:34): [True: 12.8k, False: 302k]
  |  Branch (4812:48): [True: 12.9k, False: 289k]
  ------------------
 4813|  25.7k|                  val_t val{};
 4814|  25.7k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 25.7k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  25.7k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  25.7k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 12.9k, False: 12.8k]
  ------------------
 4820|  12.9k|                     ++it;
 4821|  12.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  12.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 6, False: 12.9k]
  ------------------
 4823|      6|                        return;
 4824|  12.9k|                     break;
 4825|  12.9k|                  }
 4826|       |
 4827|  12.8k|                  ++it; // skip comma
 4828|  12.8k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  12.8k|                  continue;
 4830|  25.7k|               }
 4831|       |
 4832|       |               // Parse value
 4833|   313k|               val_t val{};
 4834|   313k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|   313k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 1.04k, False: 312k]
  ------------------
 4836|  1.04k|                  return;
 4837|       |
 4838|   312k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|   312k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|   312k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 288k, False: 24.0k]
  |  Branch (4842:33): [True: 36.1k, False: 252k]
  ------------------
 4843|  36.1k|                  ++it;
 4844|  36.1k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|  36.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 6, False: 36.0k]
  ------------------
 4846|      6|                     return;
 4847|  36.0k|                  break;
 4848|  36.1k|               }
 4849|   276k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 252k, False: 24.0k]
  |  Branch (4849:38): [True: 246k, False: 6.69k]
  ------------------
 4850|   246k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|   246k|                  yaml::skip_ws_and_newlines(it, end);
 4853|   246k|               }
 4854|  30.7k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 6.69k, False: 24.0k]
  |  Branch (4854:39): [True: 2.93k, False: 3.76k]
  |  Branch (4854:54): [True: 3.72k, False: 36]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  6.65k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  6.65k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 6.64k, False: 14]
  |  Branch (4858:36): [True: 1.48k, False: 5.16k]
  ------------------
 4859|  1.48k|                     ++it;
 4860|  1.48k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  1.48k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 6, False: 1.47k]
  ------------------
 4862|      6|                        return;
 4863|  1.47k|                     break;
 4864|  1.48k|                  }
 4865|  5.17k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 5.16k, False: 14]
  |  Branch (4865:36): [True: 5.14k, False: 20]
  ------------------
 4866|  5.14k|                     ++it;
 4867|  5.14k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  5.14k|                     continue;
 4869|  5.14k|                  }
 4870|     34|                  ctx.error = error_code::syntax_error;
 4871|     34|                  return;
 4872|  5.17k|               }
 4873|  24.0k|               else {
 4874|  24.0k|                  ctx.error = error_code::syntax_error;
 4875|  24.0k|                  return;
 4876|  24.0k|               }
 4877|   312k|            }
 4878|   145k|         }
 4879|   895k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   895k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   895k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   895k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   895k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   895k|                        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|   895k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   895k|                           if (ctx.stream_begin) {
 4893|   895k|                              auto is_line_content_start = [&](auto pos) {
 4894|   895k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   895k|                              };
 4896|       |
 4897|   895k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   895k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   895k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   895k|                                 return line != end && *line == ':';
 4901|   895k|                              };
 4902|       |
 4903|   895k|                              if (!is_line_content_start(it) &&
 4904|   895k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   895k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   895k|                                 ctx.error = error_code::syntax_error;
 4907|   895k|                                 return false;
 4908|   895k|                              }
 4909|   895k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   895k|                           }
 4911|   895k|                        }
 4912|       |
 4913|   895k|                        if (*it == '-' &&
 4914|   895k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   895k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   895k|                           ctx.error = error_code::syntax_error;
 4918|   895k|                           return false;
 4919|   895k|                        }
 4920|       |
 4921|   895k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   895k|                           return false;
 4923|   895k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   895k|                        ctx.pop_indent();
 4925|   895k|                     }
 4926|   895k|                     else {
 4927|   895k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   895k|                        if (nested_indent >= 0) {
 4929|   895k|                           yaml::skip_to_content(it, end);
 4930|   895k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   895k|                              ctx.error = error_code::syntax_error;
 4932|   895k|                              return false;
 4933|   895k|                           }
 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|   895k|                           const int32_t value_indent =
 4937|   895k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   895k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   895k|                              return false;
 4940|   895k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   895k|                           ctx.pop_indent();
 4942|   895k|                        }
 4943|   895k|                     }
 4944|   895k|                     return !bool(ctx.error);
 4945|   895k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   895k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   895k|                     ctx.error = error_code::syntax_error;
 4952|   895k|                     return false;
 4953|   895k|                  }
 4954|   895k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   895k|                     ++it; // skip '?'
 4956|   895k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   895k|                     const int32_t explicit_value_indicator_indent =
 4959|   895k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   895k|                     key_t key{};
 4962|   895k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   895k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   895k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   895k|                        };
 4966|       |
 4967|   895k|                        auto key_it = it;
 4968|   895k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   895k|                        auto content = key_it;
 4971|   895k|                        yaml::skip_to_content(content, end);
 4972|   895k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   895k|                        if (content != end && *content == '&') {
 4978|   895k|                           auto anchor_probe = content + 1;
 4979|   895k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   895k|                           if (!anchor_name.empty()) {
 4981|   895k|                              auto after_anchor = anchor_probe;
 4982|   895k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   895k|                              auto value_indicator = after_anchor;
 4985|   895k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   895k|                                 key.clear();
 4987|   895k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   895k|                                 it = value_indicator;
 4989|   895k|                                 handled_anchor_only_empty_key = true;
 4990|   895k|                              }
 4991|   895k|                              else {
 4992|   895k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   895k|                                    yaml::skip_comment(value_indicator, end);
 4994|   895k|                                 }
 4995|   895k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   895k|                                    yaml::skip_newline(value_indicator, end);
 4997|   895k|                                    auto value_line = value_indicator;
 4998|   895k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   895k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   895k|                                       return false;
 5001|   895k|                                    if (value_line != end && *value_line == ':' &&
 5002|   895k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   895k|                                       key.clear();
 5004|   895k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   895k|                                       it = value_line;
 5006|   895k|                                       handled_anchor_only_empty_key = true;
 5007|   895k|                                    }
 5008|   895k|                                    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|   895k|                                       ctx.error = error_code::syntax_error;
 5013|   895k|                                       return false;
 5014|   895k|                                    }
 5015|   895k|                                 }
 5016|   895k|                              }
 5017|   895k|                           }
 5018|   895k|                        }
 5019|       |
 5020|   895k|                        const bool key_content_spans_lines = [&] {
 5021|   895k|                           auto scan = key_it;
 5022|   895k|                           while (scan != content && scan != end) {
 5023|   895k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   895k|                              ++scan;
 5025|   895k|                           }
 5026|   895k|                           return false;
 5027|   895k|                        }();
 5028|       |
 5029|   895k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   895k|                        }
 5032|   895k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   895k|                           key.clear();
 5034|   895k|                           it = content;
 5035|   895k|                        }
 5036|   895k|                        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|   895k|                           auto key_node_it = content;
 5042|   895k|                           auto key_node_end = end;
 5043|   895k|                           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|   895k|                              auto scan = content;
 5048|   895k|                              while (scan != end) {
 5049|   895k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   895k|                                    ++scan;
 5051|   895k|                                 }
 5052|   895k|                                 if (scan == end) {
 5053|   895k|                                    break;
 5054|   895k|                                 }
 5055|       |
 5056|   895k|                                 yaml::skip_newline(scan, end);
 5057|   895k|                                 auto line_start = scan;
 5058|       |
 5059|   895k|                                 int32_t indicator_indent = 0;
 5060|   895k|                                 while (scan != end && *scan == ' ') {
 5061|   895k|                                    ++indicator_indent;
 5062|   895k|                                    ++scan;
 5063|   895k|                                 }
 5064|       |
 5065|   895k|                                 if (scan != end && *scan == ':') {
 5066|   895k|                                    const auto after_colon = scan + 1;
 5067|   895k|                                    if ((after_colon == end ||
 5068|   895k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   895k|                                        indicator_indent <= line_indent) {
 5070|   895k|                                       key_node_end = line_start;
 5071|   895k|                                       break;
 5072|   895k|                                    }
 5073|   895k|                                 }
 5074|   895k|                              }
 5075|   895k|                           }
 5076|       |
 5077|   895k|                           glz::generic key_node{};
 5078|   895k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   895k|                           ctx.explicit_mapping_key_context = true;
 5080|   895k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   895k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   895k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   895k|                              return false;
 5084|   895k|                           it = key_node_it;
 5085|   895k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   895k|                              return false;
 5087|   895k|                        }
 5088|   895k|                     }
 5089|   895k|                     else {
 5090|   895k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   895k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   895k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   895k|                              return false;
 5094|   895k|                        }
 5095|   895k|                     }
 5096|       |
 5097|   895k|                     yaml::skip_inline_ws(it, end);
 5098|   895k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   895k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   895k|                        auto probe = it;
 5103|   895k|                        bool found_value_indicator = false;
 5104|       |
 5105|   895k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   895k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   895k|                           auto value_line = probe;
 5109|   895k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   895k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   895k|                              return false;
 5112|       |
 5113|   895k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   895k|                              probe = value_line;
 5115|   895k|                              continue; // blank line
 5116|   895k|                           }
 5117|   895k|                           if (*value_line == '#') {
 5118|   895k|                              yaml::skip_comment(value_line, end);
 5119|   895k|                              probe = value_line;
 5120|   895k|                              continue; // comment-only line
 5121|   895k|                           }
 5122|   895k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   895k|                              it = value_line;
 5124|   895k|                              found_value_indicator = true;
 5125|   895k|                           }
 5126|   895k|                           break;
 5127|   895k|                        }
 5128|       |
 5129|   895k|                        if (found_value_indicator) {
 5130|   895k|                           yaml::skip_inline_ws(it, end);
 5131|   895k|                        }
 5132|   895k|                     }
 5133|       |
 5134|   895k|                     val_t val{};
 5135|   895k|                     if (it != end && *it == ':') {
 5136|   895k|                        ++it;
 5137|   895k|                        if (it != end && *it == '\t') {
 5138|   895k|                           ctx.error = error_code::syntax_error;
 5139|   895k|                           return false;
 5140|   895k|                        }
 5141|   895k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   895k|                           auto probe = it;
 5143|   895k|                           yaml::skip_newline(probe, end);
 5144|   895k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   895k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   895k|                              ctx.error = error_code::syntax_error;
 5147|   895k|                              return false;
 5148|   895k|                           }
 5149|   895k|                        }
 5150|   895k|                        yaml::skip_inline_ws(it, end);
 5151|   895k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   895k|                           return false;
 5153|   895k|                     }
 5154|       |
 5155|   895k|                     value.emplace(std::move(key), std::move(val));
 5156|   895k|                     return true;
 5157|   895k|                  }
 5158|       |
 5159|   895k|                  key_t key{};
 5160|   895k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   895k|                     auto key_probe = it;
 5162|   895k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   895k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   895k|                     if (complex_flow_key) {
 5165|   895k|                        glz::generic key_node{};
 5166|   895k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   895k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   895k|                           return false;
 5169|   895k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   895k|                           return false;
 5171|   895k|                     }
 5172|   895k|                     else {
 5173|   895k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   895k|                           return false;
 5175|   895k|                        }
 5176|   895k|                     }
 5177|   895k|                  }
 5178|   895k|                  else {
 5179|   895k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   895k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   895k|                        return false;
 5182|   895k|                  }
 5183|       |
 5184|   895k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   895k|                  if (it == end || *it != ':') {
 5187|   895k|                     ctx.error = error_code::syntax_error;
 5188|   895k|                     return false;
 5189|   895k|                  }
 5190|   895k|                  ++it;
 5191|   895k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   895k|                  val_t val{};
 5194|   895k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   895k|                     return false;
 5196|       |
 5197|   895k|                  value.emplace(std::move(key), std::move(val));
 5198|   895k|                  return true;
 5199|   895k|               });
 5200|   895k|         }
 5201|       |
 5202|  1.01M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|  1.01M|      }
_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.05M|      {
  466|  1.05M|         skip_inline_ws(it, end);
  467|       |
  468|  1.05M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 1.05M]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  1.05M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.05M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 1.05M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  1.05M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.05M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.05M|         skip_inline_ws(it, end);
  486|       |
  487|  1.05M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.05M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.05M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.26k, False: 1.05M]
  ------------------
  495|  7.26k|            return true;
  496|  7.26k|         }
  497|       |
  498|  1.05M|         return false;
  499|  1.05M|      }
_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.05M|                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.05M|      {
  409|  1.05M|         state.has_anchor = false;
  410|  1.05M|         state.anchor_name.clear();
  411|  1.05M|         state.anchor_start = nullptr;
  412|  1.05M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.05M|         if constexpr (Policy.allow_alias) {
  415|  1.05M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  1.05M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 1.04M, False: 11.2k]
  ------------------
  417|  1.04M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 7.22k, False: 1.03M]
  ------------------
  418|  1.04M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  1.05M|         }
  424|       |
  425|  1.05M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.05M, False: 7.22k]
  |  Branch (425:27): [True: 36.4k, False: 1.01M]
  ------------------
  426|  36.4k|            ++it;
  427|  36.4k|            auto name = parse_anchor_name(it, end);
  428|  36.4k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 22, False: 36.4k]
  ------------------
  429|     22|               ctx.error = error_code::syntax_error;
  430|     22|               return true;
  431|     22|            }
  432|  36.4k|            skip_inline_ws(it, end);
  433|  36.4k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 36.4k]
  ------------------
  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|  36.4k|            state.has_anchor = true;
  446|  36.4k|            state.anchor_name = std::string(name);
  447|  36.4k|            state.anchor_start = &*it;
  448|  36.4k|         }
  449|       |
  450|  1.05M|         return false;
  451|  1.05M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  1.04M|      {
  301|  1.04M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.04M]
  |  Branch (301:27): [True: 1.03M, False: 7.22k]
  ------------------
  302|       |
  303|  7.22k|         ++it; // skip '*'
  304|  7.22k|         auto name = parse_anchor_name(it, end);
  305|  7.22k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 30, False: 7.19k]
  ------------------
  306|     30|            ctx.error = error_code::syntax_error;
  307|     30|            return true;
  308|     30|         }
  309|       |
  310|  7.19k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.19k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 38, False: 7.15k]
  ------------------
  312|     38|            ctx.error = error_code::syntax_error; // undefined alias
  313|     38|            return true;
  314|     38|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  7.15k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  7.15k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 254, False: 6.90k]
  ------------------
  322|    254|            return true;
  323|    254|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  6.90k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 62, False: 6.83k]
  ------------------
  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|  6.83k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.83k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 10, False: 6.82k]
  ------------------
  339|     10|            return true;
  340|       |
  341|  6.82k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.82k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  6.82k|         auto replay_it = span.begin;
  348|  6.82k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.82k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.82k|         ctx.indent_stack.clear();
  353|  6.82k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.84k, False: 3.98k]
  ------------------
  354|  2.84k|            ctx.push_indent(span.base_indent - 1);
  355|  2.84k|         }
  356|       |
  357|  6.82k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.82k|         using V = std::remove_cvref_t<T>;
  360|  6.82k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.82k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.82k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.82k|         return true;
  367|  6.82k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|   260k|               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|   260k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   260k|                     val = glz::generic{};
 4770|   260k|                     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|   260k|               };
_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|   895k|      {
 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|   895k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 895k]
  ------------------
 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|   895k|         const int32_t parent_indent = ctx.current_indent();
 3722|   895k|         const bool discover_indent = (mapping_indent < 0);
 3723|   895k|         bool first_key = !discover_indent;
 3724|   895k|         bool discovered_first_key_mid_line = false;
 3725|   895k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.08M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.56M, False: 524k]
  ------------------
 3728|  1.56M|            auto line_start = it;
 3729|  1.56M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.56M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.01M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 1.96M, False: 51.8k]
  ------------------
 3733|  1.96M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 76.5k, False: 1.89M]
  ------------------
 3734|  76.5k|                  skip_comment(it, end);
 3735|  76.5k|                  skip_newline(it, end);
 3736|  76.5k|                  first_key = false;
 3737|  76.5k|                  line_indent = 0;
 3738|  76.5k|               }
 3739|  1.89M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 230k, False: 1.65M]
  |  Branch (3739:40): [True: 74.4k, False: 1.58M]
  ------------------
 3740|   305k|                  skip_newline(it, end);
 3741|   305k|                  first_key = false;
 3742|   305k|                  line_indent = 0;
 3743|   305k|               }
 3744|  1.58M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 183k, False: 1.40M]
  ------------------
 3745|   183k|                  line_start = it;
 3746|   183k|                  line_indent = 0;
 3747|  5.64M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 5.63M, False: 13.4k]
  |  Branch (3747:39): [True: 5.46M, False: 170k]
  ------------------
 3748|  5.46M|                     ++line_indent;
 3749|  5.46M|                     ++it;
 3750|  5.46M|                  }
 3751|       |
 3752|   183k|                  bool saw_tab = false;
 3753|   215k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 195k, False: 20.4k]
  |  Branch (3753:40): [True: 16.5k, False: 178k]
  |  Branch (3753:54): [True: 15.6k, False: 163k]
  ------------------
 3754|  32.2k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 18.8k, False: 13.4k]
  |  Branch (3754:43): [True: 13.4k, False: 0]
  ------------------
 3755|  32.2k|                     ++it;
 3756|  32.2k|                  }
 3757|       |
 3758|   183k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 20.4k, False: 163k]
  |  Branch (3758:36): [True: 11.1k, False: 152k]
  |  Branch (3758:51): [True: 7.49k, False: 144k]
  |  Branch (3758:66): [True: 20.1k, False: 124k]
  ------------------
 3759|  59.2k|                     first_key = false;
 3760|  59.2k|                     line_indent = 0;
 3761|  59.2k|                     continue; // Blank or comment line
 3762|  59.2k|                  }
 3763|       |
 3764|   124k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 14, False: 124k]
  ------------------
 3765|     14|                     ctx.error = error_code::syntax_error;
 3766|     14|                     return;
 3767|     14|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   124k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 119k, False: 5.06k]
  |  Branch (3770:46): [True: 1.50k, False: 117k]
  ------------------
 3771|  1.50k|                     it = line_start;
 3772|  1.50k|                     return;
 3773|  1.50k|                  }
 3774|       |
 3775|   122k|                  first_key = false;
 3776|   122k|                  break; // Found content
 3777|   124k|               }
 3778|  1.40M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 15.6k, False: 1.38M]
  ------------------
 3779|  15.6k|                  line_start = it;
 3780|  71.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 63.4k, False: 8.30k]
  |  Branch (3780:40): [True: 22.9k, False: 40.5k]
  |  Branch (3780:54): [True: 33.1k, False: 7.39k]
  ------------------
 3781|  15.6k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 8.30k, False: 7.39k]
  |  Branch (3781:36): [True: 5.21k, False: 2.18k]
  |  Branch (3781:51): [True: 1.25k, False: 924]
  |  Branch (3781:66): [True: 906, False: 18]
  ------------------
 3782|  15.6k|                     first_key = false;
 3783|  15.6k|                     line_indent = 0;
 3784|  15.6k|                     continue; // Blank or comment-only line with tab indentation
 3785|  15.6k|                  }
 3786|     18|                  ctx.error = error_code::syntax_error;
 3787|     18|                  return;
 3788|  15.6k|               }
 3789|  1.38M|               else {
 3790|  1.38M|                  line_start = it;
 3791|  1.38M|                  break; // Content at column 0
 3792|  1.38M|               }
 3793|  1.96M|            }
 3794|       |
 3795|  1.56M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 51.8k, False: 1.50M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.50M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 9.28k, False: 1.49M]
  |  Branch (3799:45): [True: 1.55k, False: 1.49M]
  ------------------
 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.49M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.49M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.49M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.49M, False: 0]
  |  Branch (3806:39): [True: 603k, False: 894k]
  |  Branch (3806:62): [True: 148k, False: 454k]
  |  Branch (3806:84): [True: 112k, False: 36.5k]
  ------------------
 3807|   112k|                  it = line_start;
 3808|   112k|                  return;
 3809|   112k|               }
 3810|  1.38M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 491k, False: 894k]
  |  Branch (3810:43): [True: 740, False: 490k]
  ------------------
 3811|    740|                  it = line_start;
 3812|    740|                  return;
 3813|    740|               }
 3814|  1.38M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.38M|            bool established_mapping_indent_this_line = false;
 3818|  1.38M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 894k, False: 490k]
  ------------------
 3819|   894k|               mapping_indent = line_indent;
 3820|   894k|               established_mapping_indent_this_line = true;
 3821|   894k|               discovered_first_key_visual_indent = line_indent;
 3822|   894k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   894k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 894k, False: 0]
  |  Branch (3823:43): [True: 894k, False: 0]
  ------------------
 3824|   894k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   894k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 62, False: 894k]
  ------------------
 3826|     62|                        ctx.error = error_code::syntax_error;
 3827|     62|                        return;
 3828|     62|                     }
 3829|       |
 3830|   894k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   894k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 888k, False: 5.06k]
  |  Branch (3831:49): [True: 661k, False: 227k]
  ------------------
 3832|   661k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   661k|                     }
 3834|   894k|                  }
 3835|   894k|               }
 3836|   894k|            }
 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.38M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.38M, False: 62]
  |  Branch (3840:36): [True: 1.38M, False: 0]
  |  Branch (3840:59): [True: 490k, False: 894k]
  ------------------
 3841|   490k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 171k, False: 318k]
  ------------------
 3842|   171k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 171k, False: 446]
  |  Branch (3842:43): [True: 19.2k, False: 151k]
  ------------------
 3843|  19.2k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 70, False: 19.1k]
  ------------------
 3844|     70|                     ctx.error = error_code::syntax_error;
 3845|     70|                     return;
 3846|     70|                  }
 3847|  19.1k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 6.65k, False: 12.4k]
  ------------------
 3848|  6.65k|                     it = line_start;
 3849|  6.65k|                     return;
 3850|  6.65k|                  }
 3851|  19.1k|               }
 3852|   152k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 3.34k, False: 148k]
  ------------------
 3853|  3.34k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 54, False: 3.29k]
  |  Branch (3853:47): [True: 6, False: 3.28k]
  ------------------
 3854|  3.28k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 3.28k, False: 0]
  |  Branch (3854:49): [True: 3.28k, False: 0]
  |  Branch (3854:72): [True: 18, False: 3.26k]
  ------------------
 3855|     78|                  ctx.error = error_code::syntax_error;
 3856|     78|                  return;
 3857|     78|               }
 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.37M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.37M]
  |  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.37M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.37M]
  ------------------
 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.37M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 62, False: 1.37M]
  |  Branch (3876:32): [True: 0, False: 1.37M]
  ------------------
 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.37M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 423k, False: 954k]
  |  Branch (3885:53): [True: 97.9k, False: 325k]
  |  Branch (3885:94): [True: 14.9k, False: 82.9k]
  ------------------
 3886|  14.9k|               const auto after_colon = it + 1;
 3887|  14.9k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 8.25k, False: 6.72k]
  ------------------
 3888|  14.9k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 3.19k, False: 11.7k]
  |  Branch (3888:43): [True: 7.58k, False: 4.20k]
  ------------------
 3889|  10.7k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 3.67k, False: 7.10k]
  ------------------
 3890|  3.67k|                  it = line_start;
 3891|  3.67k|                  return;
 3892|  3.67k|               }
 3893|  14.9k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.37M|            int32_t effective_line_indent = line_indent;
 3897|  1.37M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.37M, False: 62]
  |  Branch (3897:36): [True: 894k, False: 479k]
  ------------------
 3898|   894k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 661k, False: 232k]
  ------------------
 3899|   661k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 585k, False: 75.4k]
  |  Branch (3899:52): [True: 338k, False: 246k]
  ------------------
 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|   322k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   322k|            }
 3912|       |
 3913|  1.37M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 183k, False: 1.19M]
  ------------------
 3914|   183k|               return;
 3915|   183k|            }
 3916|  1.19M|            first_key = false;
 3917|       |
 3918|  1.19M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.19M]
  ------------------
 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.19M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 761k, False: 429k]
  ------------------
 3938|   761k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 84.7k, False: 676k]
  |  Branch (3938:34): [True: 11.9k, False: 664k]
  ------------------
 3939|  96.6k|                  auto peek = it;
 3940|  96.6k|                  skip_inline_ws(peek, end);
 3941|  96.6k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 83.1k, False: 13.4k]
  |  Branch (3941:38): [True: 69.1k, False: 14.0k]
  |  Branch (3941:55): [True: 64.5k, False: 4.59k]
  |  Branch (3941:72): [True: 60.0k, False: 4.54k]
  ------------------
 3942|  60.0k|                     continue; // At leading indent of new line
 3943|  60.0k|                  }
 3944|  96.6k|               }
 3945|   701k|               skip_inline_ws(it, end);
 3946|   701k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 687k, False: 13.4k]
  |  Branch (3946:33): [True: 30.7k, False: 657k]
  ------------------
 3947|  30.7k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  30.7k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 30.7k, False: 0]
  ------------------
 3949|  30.7k|                        const char prev = *(it - 1);
 3950|  30.7k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 15.2k, False: 15.5k]
  |  Branch (3950:44): [True: 11.8k, False: 3.42k]
  |  Branch (3950:60): [True: 7.06k, False: 4.75k]
  |  Branch (3950:76): [True: 6, False: 7.06k]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  30.7k|                     }
 3955|  30.7k|                  }
 3956|  30.7k|               }
 3957|  30.7k|               skip_comment(it, end);
 3958|   701k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 686k, False: 14.5k]
  |  Branch (3958:34): [True: 200k, False: 485k]
  |  Branch (3958:49): [True: 248k, False: 237k]
  ------------------
 3959|   449k|                  skip_newline(it, end);
 3960|   449k|               }
 3961|   251k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 237k, False: 14.5k]
  ------------------
 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|   237k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   237k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 32, False: 237k]
  ------------------
 3968|     32|                        ctx.error = error_code::syntax_error;
 3969|     32|                        return;
 3970|     32|                     }
 3971|   237k|                  }
 3972|   237k|               }
 3973|   701k|            }
 3974|  1.19M|         }
 3975|   895k|      }
_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.37M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.37M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.37M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.37M|                        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.37M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.37M|                           if (ctx.stream_begin) {
 4893|  1.37M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.37M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.37M|                              };
 4896|       |
 4897|  1.37M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.37M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.37M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.37M|                                 return line != end && *line == ':';
 4901|  1.37M|                              };
 4902|       |
 4903|  1.37M|                              if (!is_line_content_start(it) &&
 4904|  1.37M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.37M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.37M|                                 ctx.error = error_code::syntax_error;
 4907|  1.37M|                                 return false;
 4908|  1.37M|                              }
 4909|  1.37M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.37M|                           }
 4911|  1.37M|                        }
 4912|       |
 4913|  1.37M|                        if (*it == '-' &&
 4914|  1.37M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.37M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.37M|                           ctx.error = error_code::syntax_error;
 4918|  1.37M|                           return false;
 4919|  1.37M|                        }
 4920|       |
 4921|  1.37M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.37M|                           return false;
 4923|  1.37M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.37M|                        ctx.pop_indent();
 4925|  1.37M|                     }
 4926|  1.37M|                     else {
 4927|  1.37M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.37M|                        if (nested_indent >= 0) {
 4929|  1.37M|                           yaml::skip_to_content(it, end);
 4930|  1.37M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.37M|                              ctx.error = error_code::syntax_error;
 4932|  1.37M|                              return false;
 4933|  1.37M|                           }
 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.37M|                           const int32_t value_indent =
 4937|  1.37M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.37M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.37M|                              return false;
 4940|  1.37M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.37M|                           ctx.pop_indent();
 4942|  1.37M|                        }
 4943|  1.37M|                     }
 4944|  1.37M|                     return !bool(ctx.error);
 4945|  1.37M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.37M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 613k, False: 760k]
  |  Branch (4950:37): [True: 611k, False: 1.76k]
  |  Branch (4950:58): [True: 8, False: 611k]
  ------------------
 4951|      8|                     ctx.error = error_code::syntax_error;
 4952|      8|                     return false;
 4953|      8|                  }
 4954|  1.37M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 613k, False: 760k]
  |  Branch (4954:38): [True: 1.76k, False: 611k]
  |  Branch (4954:57): [True: 243k, False: 368k]
  |  Branch (4954:77): [True: 252k, False: 115k]
  |  Branch (4954:98): [True: 96.5k, False: 19.0k]
  ------------------
 4955|   594k|                     ++it; // skip '?'
 4956|   594k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   594k|                     const int32_t explicit_value_indicator_indent =
 4959|   594k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 410k, False: 184k]
  ------------------
 4960|       |
 4961|   594k|                     key_t key{};
 4962|   594k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   594k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   594k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   594k|                        };
 4966|       |
 4967|   594k|                        auto key_it = it;
 4968|   594k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   594k|                        auto content = key_it;
 4971|   594k|                        yaml::skip_to_content(content, end);
 4972|   594k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   594k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 585k, False: 8.62k]
  |  Branch (4977:47): [True: 149k, False: 435k]
  ------------------
 4978|   149k|                           auto anchor_probe = content + 1;
 4979|   149k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   149k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 149k, False: 18]
  ------------------
 4981|   149k|                              auto after_anchor = anchor_probe;
 4982|   149k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   149k|                              auto value_indicator = after_anchor;
 4985|   149k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 144k, False: 5.66k]
  |  Branch (4985:61): [True: 10.5k, False: 133k]
  ------------------
 4986|  10.5k|                                 key.clear();
 4987|  10.5k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  10.5k|                                 it = value_indicator;
 4989|  10.5k|                                 handled_anchor_only_empty_key = true;
 4990|  10.5k|                              }
 4991|   139k|                              else {
 4992|   139k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 133k, False: 5.66k]
  |  Branch (4992:64): [True: 10.5k, False: 123k]
  ------------------
 4993|  10.5k|                                    yaml::skip_comment(value_indicator, end);
 4994|  10.5k|                                 }
 4995|   139k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 133k, False: 6.01k]
  |  Branch (4995:65): [True: 23.7k, False: 109k]
  |  Branch (4995:93): [True: 46.9k, False: 62.6k]
  ------------------
 4996|  70.7k|                                    yaml::skip_newline(value_indicator, end);
 4997|  70.7k|                                    auto value_line = value_indicator;
 4998|  70.7k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  70.7k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 6, False: 70.6k]
  ------------------
 5000|      6|                                       return false;
 5001|  70.6k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 59.1k, False: 11.5k]
  |  Branch (5001:62): [True: 5.20k, False: 53.9k]
  ------------------
 5002|  5.20k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 5.19k, False: 10]
  ------------------
 5003|  5.19k|                                       key.clear();
 5004|  5.19k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  5.19k|                                       it = value_line;
 5006|  5.19k|                                       handled_anchor_only_empty_key = true;
 5007|  5.19k|                                    }
 5008|  65.5k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 53.9k, False: 11.5k]
  |  Branch (5008:67): [True: 10, False: 53.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|  70.6k|                                 }
 5016|   139k|                              }
 5017|   149k|                           }
 5018|   149k|                        }
 5019|       |
 5020|   594k|                        const bool key_content_spans_lines = [&] {
 5021|   594k|                           auto scan = key_it;
 5022|   594k|                           while (scan != content && scan != end) {
 5023|   594k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   594k|                              ++scan;
 5025|   594k|                           }
 5026|   594k|                           return false;
 5027|   594k|                        }();
 5028|       |
 5029|   594k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 15.7k, False: 578k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  15.7k|                        }
 5032|   578k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 8.62k, False: 570k]
  |  Branch (5032:53): [True: 17.3k, False: 552k]
  |  Branch (5032:72): [True: 8.41k, False: 8.92k]
  ------------------
 5033|  17.0k|                           key.clear();
 5034|  17.0k|                           it = content;
 5035|  17.0k|                        }
 5036|   561k|                        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|   561k|                           auto key_node_it = content;
 5042|   561k|                           auto key_node_end = end;
 5043|   561k|                           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|   561k|                              auto scan = content;
 5048|  5.36M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 5.17M, False: 183k]
  ------------------
 5049|   660M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 660M, False: 290k]
  |  Branch (5049:56): [True: 658M, False: 2.34M]
  |  Branch (5049:73): [True: 655M, False: 2.53M]
  ------------------
 5050|   655M|                                    ++scan;
 5051|   655M|                                 }
 5052|  5.17M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 290k, False: 4.88M]
  ------------------
 5053|   290k|                                    break;
 5054|   290k|                                 }
 5055|       |
 5056|  4.88M|                                 yaml::skip_newline(scan, end);
 5057|  4.88M|                                 auto line_start = scan;
 5058|       |
 5059|  4.88M|                                 int32_t indicator_indent = 0;
 5060|  12.9M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 12.7M, False: 183k]
  |  Branch (5060:56): [True: 8.07M, False: 4.70M]
  ------------------
 5061|  8.07M|                                    ++indicator_indent;
 5062|  8.07M|                                    ++scan;
 5063|  8.07M|                                 }
 5064|       |
 5065|  4.88M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 4.70M, False: 183k]
  |  Branch (5065:53): [True: 183k, False: 4.51M]
  ------------------
 5066|   183k|                                    const auto after_colon = scan + 1;
 5067|   183k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 6.75k, False: 177k]
  ------------------
 5068|   177k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 109k, False: 67.4k]
  ------------------
 5069|   116k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 87.6k, False: 28.9k]
  ------------------
 5070|  87.6k|                                       key_node_end = line_start;
 5071|  87.6k|                                       break;
 5072|  87.6k|                                    }
 5073|   183k|                                 }
 5074|  4.88M|                              }
 5075|   561k|                           }
 5076|       |
 5077|   561k|                           glz::generic key_node{};
 5078|   561k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   561k|                           ctx.explicit_mapping_key_context = true;
 5080|   561k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   561k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   561k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 22.1k, False: 539k]
  ------------------
 5083|  22.1k|                              return false;
 5084|   539k|                           it = key_node_it;
 5085|   539k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 10, False: 539k]
  ------------------
 5086|     10|                              return false;
 5087|   539k|                        }
 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|   572k|                     yaml::skip_inline_ws(it, end);
 5098|   594k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   594k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 409k, False: 184k]
  |  Branch (5101:40): [True: 112k, False: 297k]
  |  Branch (5101:55): [True: 143k, False: 154k]
  ------------------
 5102|   255k|                        auto probe = it;
 5103|   255k|                        bool found_value_indicator = false;
 5104|       |
 5105|   379k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 322k, False: 57.4k]
  |  Branch (5105:49): [True: 142k, False: 179k]
  |  Branch (5105:67): [True: 179k, 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: 10, False: 321k]
  ------------------
 5111|     10|                              return false;
 5112|       |
 5113|   321k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 55.6k, False: 266k]
  |  Branch (5113:53): [True: 19.4k, False: 246k]
  |  Branch (5113:76): [True: 25.7k, False: 221k]
  ------------------
 5114|   100k|                              probe = value_line;
 5115|   100k|                              continue; // blank line
 5116|   100k|                           }
 5117|   221k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 23.0k, False: 198k]
  ------------------
 5118|  23.0k|                              yaml::skip_comment(value_line, end);
 5119|  23.0k|                              probe = value_line;
 5120|  23.0k|                              continue; // comment-only line
 5121|  23.0k|                           }
 5122|   198k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 30.3k, False: 167k]
  |  Branch (5122:54): [True: 20.9k, False: 9.39k]
  ------------------
 5123|  20.9k|                              it = value_line;
 5124|  20.9k|                              found_value_indicator = true;
 5125|  20.9k|                           }
 5126|   198k|                           break;
 5127|   221k|                        }
 5128|       |
 5129|   255k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 20.9k, False: 234k]
  ------------------
 5130|  20.9k|                           yaml::skip_inline_ws(it, end);
 5131|  20.9k|                        }
 5132|   255k|                     }
 5133|       |
 5134|   594k|                     val_t val{};
 5135|   594k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 409k, False: 184k]
  |  Branch (5135:39): [True: 128k, False: 280k]
  ------------------
 5136|   128k|                        ++it;
 5137|   128k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 127k, False: 1.16k]
  |  Branch (5137:42): [True: 12, False: 127k]
  ------------------
 5138|     12|                           ctx.error = error_code::syntax_error;
 5139|     12|                           return false;
 5140|     12|                        }
 5141|   128k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 127k, False: 1.16k]
  |  Branch (5141:43): [True: 16.0k, False: 111k]
  |  Branch (5141:58): [True: 46.0k, False: 65.6k]
  ------------------
 5142|  62.0k|                           auto probe = it;
 5143|  62.0k|                           yaml::skip_newline(probe, end);
 5144|   264k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 255k, False: 9.77k]
  |  Branch (5144:51): [True: 202k, False: 52.3k]
  ------------------
 5145|  62.0k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 52.3k, False: 9.77k]
  |  Branch (5145:48): [True: 9.90k, False: 42.4k]
  |  Branch (5145:65): [True: 5.75k, False: 4.14k]
  |  Branch (5145:89): [True: 6, False: 5.74k]
  ------------------
 5146|      6|                              ctx.error = error_code::syntax_error;
 5147|      6|                              return false;
 5148|      6|                           }
 5149|  62.0k|                        }
 5150|   128k|                        yaml::skip_inline_ws(it, end);
 5151|   128k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 2.45k, False: 126k]
  ------------------
 5152|  2.45k|                           return false;
 5153|   128k|                     }
 5154|       |
 5155|   591k|                     value.emplace(std::move(key), std::move(val));
 5156|   591k|                     return true;
 5157|   594k|                  }
 5158|       |
 5159|   779k|                  key_t key{};
 5160|   779k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   779k|                     auto key_probe = it;
 5162|   779k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   779k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 779k, False: 0]
  |  Branch (5163:74): [True: 5.99k, False: 773k]
  |  Branch (5163:95): [True: 8.49k, False: 765k]
  ------------------
 5164|   779k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 14.4k, False: 765k]
  ------------------
 5165|  14.4k|                        glz::generic key_node{};
 5166|  14.4k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  14.4k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 1.17k, False: 13.3k]
  ------------------
 5168|  1.17k|                           return false;
 5169|  13.3k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 6, False: 13.3k]
  ------------------
 5170|      6|                           return false;
 5171|  13.3k|                     }
 5172|   765k|                     else {
 5173|   765k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 147k, False: 617k]
  ------------------
 5174|   147k|                           return false;
 5175|   147k|                        }
 5176|   765k|                     }
 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|   630k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   779k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 148k, False: 630k]
  |  Branch (5186:36): [True: 48, False: 630k]
  ------------------
 5187|    156|                     ctx.error = error_code::syntax_error;
 5188|    156|                     return false;
 5189|    156|                  }
 5190|   779k|                  ++it;
 5191|   779k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   779k|                  val_t val{};
 5194|   779k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 10.2k, False: 769k]
  ------------------
 5195|  10.2k|                     return false;
 5196|       |
 5197|   769k|                  value.emplace(std::move(key), std::move(val));
 5198|   769k|                  return true;
 5199|   779k|               });
_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|   594k|                        const bool key_content_spans_lines = [&] {
 5021|   594k|                           auto scan = key_it;
 5022|   625k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 395k, False: 230k]
  |  Branch (5022:54): [True: 395k, False: 0]
  ------------------
 5023|   395k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 257k, False: 137k]
  |  Branch (5023:52): [True: 106k, False: 30.8k]
  ------------------
 5024|  30.8k|                              ++scan;
 5025|  30.8k|                           }
 5026|   230k|                           return false;
 5027|   594k|                        }();
_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|   539k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   539k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   539k|                        };
_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|   759k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   759k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 708k, False: 50.7k]
  |  Branch (4884:39): [True: 421k, False: 287k]
  ------------------
 4885|   421k|                        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|   421k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   421k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 421k, False: 0]
  ------------------
 4893|   421k|                              auto is_line_content_start = [&](auto pos) {
 4894|   421k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   421k|                              };
 4896|       |
 4897|   421k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   421k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   421k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   421k|                                 return line != end && *line == ':';
 4901|   421k|                              };
 4902|       |
 4903|   421k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 421k, False: 0]
  ------------------
 4904|   421k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 20.1k, False: 401k]
  ------------------
 4905|  20.1k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 28, False: 20.0k]
  ------------------
 4906|     28|                                 ctx.error = error_code::syntax_error;
 4907|     28|                                 return false;
 4908|     28|                              }
 4909|   421k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   421k|                           }
 4911|   421k|                        }
 4912|       |
 4913|   421k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 18.1k, False: 403k]
  ------------------
 4914|  18.1k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 586, False: 17.5k]
  |  Branch (4914:49): [True: 3.04k, False: 14.5k]
  ------------------
 4915|  3.62k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 12, False: 3.61k]
  ------------------
 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|   421k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 421k]
  ------------------
 4922|      0|                           return false;
 4923|   421k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   421k|                        ctx.pop_indent();
 4925|   421k|                     }
 4926|   337k|                     else {
 4927|   337k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   337k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 67.2k, False: 270k]
  ------------------
 4929|  67.2k|                           yaml::skip_to_content(it, end);
 4930|  67.2k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 67.2k, False: 0]
  |  Branch (4930:45): [True: 0, False: 67.2k]
  |  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|  67.2k|                           const int32_t value_indent =
 4937|  67.2k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 67.2k]
  ------------------
 4938|  67.2k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 67.2k]
  ------------------
 4939|      0|                              return false;
 4940|  67.2k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  67.2k|                           ctx.pop_indent();
 4942|  67.2k|                        }
 4943|   337k|                     }
 4944|   759k|                     return !bool(ctx.error);
 4945|   759k|                  };
_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|   421k|                              auto is_line_content_start = [&](auto pos) {
 4894|   421k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   421k|                              };
_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|   441k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   441k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   914k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 914k, False: 0]
  |  Branch (4899:57): [True: 471k, False: 443k]
  |  Branch (4899:73): [True: 1.38k, False: 441k]
  ------------------
 4900|   441k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 441k, False: 0]
  |  Branch (4900:56): [True: 182k, False: 259k]
  ------------------
 4901|   441k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|  1.04M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  1.04M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 1.04M]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|  1.04M|            }
_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|   442k|      {
 6718|   442k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|   442k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 442, False: 442k]
  ------------------
 6720|    442|            return;
 6721|   442k|         op<Opts>(value, ctx, it, end);
 6722|   442k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  36.6k|      {
  301|  36.6k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 36.6k]
  |  Branch (301:27): [True: 0, False: 36.6k]
  ------------------
  302|       |
  303|  36.6k|         ++it; // skip '*'
  304|  36.6k|         auto name = parse_anchor_name(it, end);
  305|  36.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 42, False: 36.6k]
  ------------------
  306|     42|            ctx.error = error_code::syntax_error;
  307|     42|            return true;
  308|     42|         }
  309|       |
  310|  36.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  36.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 64, False: 36.5k]
  ------------------
  312|     64|            ctx.error = error_code::syntax_error; // undefined alias
  313|     64|            return true;
  314|     64|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  36.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  36.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 588, False: 35.9k]
  ------------------
  322|    588|            return true;
  323|    588|         }
  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|  35.9k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 796, False: 35.1k]
  ------------------
  329|    796|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    796|            return true;
  331|    796|         }
  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|  35.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  35.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 35.1k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  35.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 8, False: 35.1k]
  ------------------
  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|  35.1k|         auto replay_it = span.begin;
  348|  35.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  35.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  35.1k|         ctx.indent_stack.clear();
  353|  35.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 20.1k, False: 15.0k]
  ------------------
  354|  20.1k|            ctx.push_indent(span.base_indent - 1);
  355|  20.1k|         }
  356|       |
  357|  35.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  35.1k|         using V = std::remove_cvref_t<T>;
  360|  35.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  35.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  35.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  35.1k|         return true;
  367|  35.1k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   539k|      {
 5311|   539k|         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|   539k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   539k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   539k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   539k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 539k, False: 0]
  ------------------
 5321|   539k|            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|   539k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   548k|      {
 1961|   548k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 15.0k, False: 533k]
  ------------------
 1962|  15.0k|            return;
 1963|       |
 1964|   533k|         yaml::node_preamble_state preamble{};
 1965|   533k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 10.2k, False: 523k]
  ------------------
 1966|   533k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  10.2k|            return;
 1968|       |
 1969|   523k|         std::string str;
 1970|   523k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   523k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 523k, False: 0]
  ------------------
 1973|  12.8k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 12.8k, False: 510k]
  ------------------
 1974|  12.8k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  12.8k|            break;
 1976|  3.04k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 3.04k, False: 520k]
  ------------------
 1977|  3.04k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  3.04k|            break;
 1979|  4.02k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 4.02k, False: 519k]
  ------------------
 1980|  18.1k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 14.1k, False: 509k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  18.1k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  18.1k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 5.39k, False: 12.7k]
  ------------------
 1986|  18.1k|            break;
 1987|   489k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 489k, False: 34.0k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   489k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   489k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 243k, False: 245k]
  ------------------
 1992|   243k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|   243k|               }
 1994|   245k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|   245k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|   245k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   489k|            break;
 2003|   523k|         }
 2004|       |
 2005|   523k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 523k, False: 180]
  ------------------
 2006|   523k|            value = std::move(str);
 2007|   523k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   523k|         }
 2009|   523k|      }
_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|   533k|      {
  466|   533k|         skip_inline_ws(it, end);
  467|       |
  468|   533k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 16, False: 533k]
  ------------------
  469|     16|            if constexpr (!AllowEmptyInput) {
  470|     16|               ctx.error = error_code::unexpected_end;
  471|     16|            }
  472|     16|            return true;
  473|     16|         }
  474|       |
  475|   533k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   533k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 533k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   533k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 533k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   533k|         skip_inline_ws(it, end);
  486|       |
  487|   533k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 533k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   533k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 10.2k, False: 523k]
  ------------------
  495|  10.2k|            return true;
  496|  10.2k|         }
  497|       |
  498|   523k|         return false;
  499|   533k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   533k|                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|   533k|      {
  409|   533k|         state.has_anchor = false;
  410|   533k|         state.anchor_name.clear();
  411|   533k|         state.anchor_start = nullptr;
  412|   533k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   533k|         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|   533k|            else {
  421|   533k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.2k, False: 523k]
  ------------------
  422|   533k|            }
  423|   533k|         }
  424|       |
  425|   533k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 523k, False: 10.2k]
  |  Branch (425:27): [True: 14.8k, False: 508k]
  ------------------
  426|  14.8k|            ++it;
  427|  14.8k|            auto name = parse_anchor_name(it, end);
  428|  14.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 14.8k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  14.8k|            skip_inline_ws(it, end);
  433|  14.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 14.8k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|  14.8k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  14.8k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 14.7k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  14.8k|            }
  445|  14.7k|            state.has_anchor = true;
  446|  14.8k|            state.anchor_name = std::string(name);
  447|  14.8k|            state.anchor_start = &*it;
  448|  14.8k|         }
  449|       |
  450|   533k|         return false;
  451|   533k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   533k|      {
  301|   533k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 533k]
  |  Branch (301:27): [True: 523k, False: 10.2k]
  ------------------
  302|       |
  303|  10.2k|         ++it; // skip '*'
  304|  10.2k|         auto name = parse_anchor_name(it, end);
  305|  10.2k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 10.1k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  10.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 60, False: 10.1k]
  ------------------
  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|  10.1k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  10.1k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 722, False: 9.41k]
  ------------------
  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|  9.41k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 9.40k]
  ------------------
  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.40k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.40k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 9.39k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  9.39k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 12, False: 9.38k]
  ------------------
  342|     12|            ctx.error = error_code::exceeded_max_expansion;
  343|     12|            ctx.custom_error_message = "alias expansion";
  344|     12|            return true;
  345|     12|         }
  346|       |
  347|  9.38k|         auto replay_it = span.begin;
  348|  9.38k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.38k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.38k|         ctx.indent_stack.clear();
  353|  9.38k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.01k, False: 7.37k]
  ------------------
  354|  2.01k|            ctx.push_indent(span.base_indent - 1);
  355|  2.01k|         }
  356|       |
  357|  9.38k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.38k|         using V = std::remove_cvref_t<T>;
  360|  9.38k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.38k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.38k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.38k|         return true;
  367|  9.39k|      }
_ZN3glz4yaml28parse_plain_scalar_multilineINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1178|   957k|      {
 1179|   957k|         value.clear();
 1180|       |
 1181|  4.56M|         while (it != end) {
  ------------------
  |  Branch (1181:17): [True: 4.54M, False: 12.1k]
  ------------------
 1182|  4.54M|            {
 1183|  4.54M|               const auto run_start = it;
 1184|   166M|               while (it != end && !plain_scalar_block_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1184:23): [True: 166M, False: 117k]
  |  Branch (1184:36): [True: 162M, False: 4.43M]
  ------------------
 1185|   162M|                  ++it;
 1186|   162M|               }
 1187|  4.54M|               if (it != run_start) {
  ------------------
  |  Branch (1187:20): [True: 4.15M, False: 394k]
  ------------------
 1188|  4.15M|                  value.append(run_start, it);
 1189|  4.15M|               }
 1190|  4.54M|               if (it == end) break;
  ------------------
  |  Branch (1190:20): [True: 117k, False: 4.43M]
  ------------------
 1191|  4.54M|            }
 1192|       |
 1193|  4.43M|            const char c = *it;
 1194|       |
 1195|  4.43M|            if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1195:17): [True: 12.9k, False: 4.41M]
  ------------------
 1196|  12.9k|               ctx.error = error_code::invalid_control_character;
 1197|  12.9k|               return;
 1198|  12.9k|            }
 1199|       |
 1200|       |            // Check for newline - potential continuation
 1201|  4.41M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1201:17): [True: 353k, False: 4.06M]
  |  Branch (1201:30): [True: 590k, False: 3.47M]
  ------------------
 1202|       |               // Trim trailing whitespace from current line
 1203|  1.52M|               while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1203:23): [True: 1.31M, False: 213k]
  |  Branch (1203:42): [True: 513k, False: 802k]
  |  Branch (1203:65): [True: 71.7k, False: 730k]
  ------------------
 1204|   585k|                  value.pop_back();
 1205|   585k|               }
 1206|       |
 1207|       |               // Count consecutive blank lines
 1208|   944k|               int blank_lines = 0;
 1209|   944k|               auto lookahead = it;
 1210|       |
 1211|  2.17M|               while (lookahead != end) {
  ------------------
  |  Branch (1211:23): [True: 2.00M, False: 168k]
  ------------------
 1212|       |                  // Skip the newline
 1213|  2.00M|                  if (*lookahead == '\r' && (lookahead + 1) != end && *(lookahead + 1) == '\n') {
  ------------------
  |  Branch (1213:23): [True: 1.20M, False: 794k]
  |  Branch (1213:45): [True: 1.08M, False: 120k]
  |  Branch (1213:71): [True: 44.5k, False: 1.04M]
  ------------------
 1214|  44.5k|                     ++lookahead;
 1215|  44.5k|                  }
 1216|  2.00M|                  if (lookahead != end && (*lookahead == '\n' || *lookahead == '\r')) {
  ------------------
  |  Branch (1216:23): [True: 2.00M, False: 0]
  |  Branch (1216:44): [True: 839k, False: 1.16M]
  |  Branch (1216:66): [True: 1.16M, False: 0]
  ------------------
 1217|  2.00M|                     ++lookahead;
 1218|  2.00M|                  }
 1219|      0|                  else {
 1220|      0|                     break;
 1221|      0|                  }
 1222|       |
 1223|       |                  // Check if this is a blank line or comment-only line
 1224|  2.00M|                  int32_t line_indent = 0;
 1225|       |
 1226|  9.30M|                  while (lookahead != end && (*lookahead == ' ' || *lookahead == '\t')) {
  ------------------
  |  Branch (1226:26): [True: 9.13M, False: 168k]
  |  Branch (1226:47): [True: 7.26M, False: 1.87M]
  |  Branch (1226:68): [True: 37.8k, False: 1.83M]
  ------------------
 1227|  7.30M|                     ++line_indent;
 1228|  7.30M|                     ++lookahead;
 1229|  7.30M|                  }
 1230|       |
 1231|  2.00M|                  if (lookahead == end || *lookahead == '\n' || *lookahead == '\r') {
  ------------------
  |  Branch (1231:23): [True: 168k, False: 1.83M]
  |  Branch (1231:43): [True: 441k, False: 1.39M]
  |  Branch (1231:65): [True: 617k, False: 775k]
  ------------------
 1232|       |                     // Blank line
 1233|  1.22M|                     ++blank_lines;
 1234|  1.22M|                     continue;
 1235|  1.22M|                  }
 1236|       |
 1237|   775k|                  if (*lookahead == '#') {
  ------------------
  |  Branch (1237:23): [True: 50.0k, False: 725k]
  ------------------
 1238|       |                     // Comments end plain scalars per YAML spec
 1239|  50.0k|                     return;
 1240|  50.0k|                  }
 1241|       |
 1242|       |                  // Found content - check indentation
 1243|       |                  // Continuation lines must not dedent below the parent block.
 1244|   725k|                  if (line_indent < base_indent) {
  ------------------
  |  Branch (1244:23): [True: 148k, False: 576k]
  ------------------
 1245|       |                     // Dedented - end of scalar
 1246|   148k|                     return;
 1247|   148k|                  }
 1248|       |
 1249|       |                  // Document boundary markers at column 0 start/stop documents and
 1250|       |                  // must terminate a top-level plain scalar continuation.
 1251|   576k|                  if (line_indent == 0 && (at_document_start(lookahead, end) || at_document_end(lookahead, end))) {
  ------------------
  |  Branch (1251:23): [True: 456k, False: 120k]
  |  Branch (1251:44): [True: 3.51k, False: 452k]
  |  Branch (1251:81): [True: 1.98k, False: 450k]
  ------------------
 1252|  5.49k|                     return;
 1253|  5.49k|                  }
 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|   570k|                  if (*lookahead == '-') {
  ------------------
  |  Branch (1260:23): [True: 223k, False: 347k]
  ------------------
 1261|   223k|                     auto after_dash = lookahead + 1;
 1262|   223k|                     if (after_dash == end || *after_dash == ' ' || *after_dash == '\t' || *after_dash == '\n' ||
  ------------------
  |  Branch (1262:26): [True: 274, False: 223k]
  |  Branch (1262:47): [True: 10.7k, False: 212k]
  |  Branch (1262:69): [True: 4.93k, False: 207k]
  |  Branch (1262:92): [True: 192k, False: 15.4k]
  ------------------
 1263|   210k|                         *after_dash == '\r') {
  ------------------
  |  Branch (1263:26): [True: 2.48k, False: 12.9k]
  ------------------
 1264|   210k|                        if (ctx.sequence_dash_indent < 0 || line_indent <= ctx.sequence_dash_indent) {
  ------------------
  |  Branch (1264:29): [True: 2.27k, False: 208k]
  |  Branch (1264:61): [True: 201k, False: 6.46k]
  ------------------
 1265|   204k|                           return;
 1266|   204k|                        }
 1267|   210k|                     }
 1268|   223k|                  }
 1269|       |
 1270|   366k|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1270:23): [True: 212k, False: 153k]
  ------------------
 1271|       |                     // In explicit mapping keys ("? key"), a following explicit
 1272|       |                     // key/value indicator starts a new mapping entry.
 1273|   212k|                     if (*lookahead == '?' || *lookahead == ':') {
  ------------------
  |  Branch (1273:26): [True: 66.2k, False: 146k]
  |  Branch (1273:47): [True: 12.5k, False: 133k]
  ------------------
 1274|  78.8k|                        auto after = lookahead + 1;
 1275|  78.8k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1275:29): [True: 1.55k, False: 77.2k]
  |  Branch (1275:45): [True: 16.2k, False: 60.9k]
  |  Branch (1275:62): [True: 204, False: 60.7k]
  |  Branch (1275:80): [True: 13.0k, False: 47.7k]
  |  Branch (1275:98): [True: 28.8k, False: 18.8k]
  ------------------
 1276|  59.9k|                           return;
 1277|  59.9k|                        }
 1278|  78.8k|                     }
 1279|       |
 1280|       |                     // Node-property indicators at the start of a continuation
 1281|       |                     // line begin a new key node in explicit-key context.
 1282|   152k|                     if (*lookahead == '&' || *lookahead == '*' || *lookahead == '!') {
  ------------------
  |  Branch (1282:26): [True: 932, False: 151k]
  |  Branch (1282:47): [True: 63.2k, False: 88.4k]
  |  Branch (1282:68): [True: 2.33k, False: 86.1k]
  ------------------
 1283|  66.4k|                        return;
 1284|  66.4k|                     }
 1285|   152k|                  }
 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|   240k|                  if (ctx.sequence_item_value_context &&
  ------------------
  |  Branch (1289:23): [True: 74.7k, False: 165k]
  ------------------
 1290|  74.7k|                      (*lookahead == '&' || *lookahead == '*' || *lookahead == '!')) {
  ------------------
  |  Branch (1290:24): [True: 1.01k, False: 73.7k]
  |  Branch (1290:45): [True: 1.26k, False: 72.4k]
  |  Branch (1290:66): [True: 320, False: 72.1k]
  ------------------
 1291|  2.59k|                     return;
 1292|  2.59k|                  }
 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|   237k|                  {
 1297|   237k|                     auto scan = lookahead;
 1298|  9.91M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1298:29): [True: 9.89M, False: 22.3k]
  |  Branch (1298:44): [True: 9.76M, False: 131k]
  |  Branch (1298:61): [True: 9.71M, False: 43.3k]
  ------------------
 1299|  9.71M|                        if (*scan == ':') {
  ------------------
  |  Branch (1299:29): [True: 97.9k, False: 9.61M]
  ------------------
 1300|  97.9k|                           auto after_colon = scan + 1;
 1301|  97.9k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1301:32): [True: 722, False: 97.2k]
  |  Branch (1301:54): [True: 22.1k, False: 75.1k]
  |  Branch (1301:77): [True: 482, False: 74.6k]
  ------------------
 1302|  74.6k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (1302:32): [True: 9.33k, False: 65.3k]
  |  Branch (1302:56): [True: 7.76k, False: 57.5k]
  ------------------
 1303|       |                              // This looks like a mapping key - end the scalar
 1304|  40.4k|                              return;
 1305|  40.4k|                           }
 1306|  97.9k|                        }
 1307|  9.67M|                        ++scan;
 1308|  9.67M|                     }
 1309|   237k|                  }
 1310|       |
 1311|       |                  // This is a continuation line
 1312|       |                  // Add appropriate line breaks for blank lines
 1313|  1.01M|                  for (int i = 0; i < blank_lines; ++i) {
  ------------------
  |  Branch (1313:35): [True: 821k, False: 197k]
  ------------------
 1314|   821k|                     value.push_back('\n');
 1315|   821k|                  }
 1316|       |
 1317|       |                  // Add a space to fold the newline (unless we added literal newlines for blank lines)
 1318|   197k|                  if (blank_lines == 0 && !value.empty()) {
  ------------------
  |  Branch (1318:23): [True: 172k, False: 24.8k]
  |  Branch (1318:43): [True: 122k, False: 50.0k]
  ------------------
 1319|   122k|                     value.push_back(' ');
 1320|   122k|                  }
 1321|       |
 1322|       |                  // Move iterator to the content position
 1323|   197k|                  it = lookahead;
 1324|   197k|                  break;
 1325|   237k|               }
 1326|       |
 1327|       |               // If we exhausted the lookahead, we're done
 1328|   365k|               if (lookahead == end) {
  ------------------
  |  Branch (1328:20): [True: 168k, False: 197k]
  ------------------
 1329|   168k|                  return;
 1330|   168k|               }
 1331|       |
 1332|   197k|               continue; // Process the character at the new position
 1333|   365k|            }
 1334|       |
 1335|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1336|  3.47M|            if (c == '#') {
  ------------------
  |  Branch (1336:17): [True: 238k, False: 3.23M]
  ------------------
 1337|   238k|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1337:20): [True: 32.7k, False: 205k]
  |  Branch (1337:37): [True: 26.4k, False: 178k]
  |  Branch (1337:60): [True: 2.61k, False: 176k]
  ------------------
 1338|  61.7k|                  break; // This is a comment
 1339|  61.7k|               }
 1340|   238k|            }
 1341|       |
 1342|       |            // Colon followed by space/newline ends plain scalar (potential nested mapping)
 1343|  3.41M|            if (c == ':') {
  ------------------
  |  Branch (1343:17): [True: 3.23M, False: 176k]
  ------------------
 1344|  3.23M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1344:20): [True: 1.96k, False: 3.23M]
  |  Branch (1344:39): [True: 2.78k, False: 3.23M]
  |  Branch (1344:59): [True: 208, False: 3.23M]
  |  Branch (1344:80): [True: 1.41k, False: 3.22M]
  |  Branch (1344:101): [True: 390, False: 3.22M]
  ------------------
 1345|  6.76k|                  break;
 1346|  6.76k|               }
 1347|  3.23M|            }
 1348|       |
 1349|  3.40M|            value.push_back(c);
 1350|  3.40M|            ++it;
 1351|  3.40M|         }
 1352|       |
 1353|       |         // Trim trailing whitespace
 1354|   537k|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1354:17): [True: 503k, False: 33.8k]
  |  Branch (1354:36): [True: 313k, False: 189k]
  |  Branch (1354:59): [True: 25.6k, False: 163k]
  ------------------
 1355|   339k|            value.pop_back();
 1356|   339k|         }
 1357|   197k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   149k|      {
 5311|   149k|         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|   149k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   149k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   149k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   149k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 149k, False: 0]
  ------------------
 5321|   149k|            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|   149k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   151k|      {
 2116|   151k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 151k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   151k|         yaml::node_preamble_state preamble{};
 2120|   151k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 11.4k, False: 140k]
  ------------------
 2121|   151k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   151k|                   return yaml::tag_valid_for_float(tag);
 2123|   151k|                }
 2124|   151k|                else {
 2125|   151k|                   return yaml::tag_valid_for_int(tag);
 2126|   151k|                }
 2127|   151k|             }))
 2128|  11.4k|            return;
 2129|       |
 2130|   140k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   140k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   140k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   140k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 44.5k, False: 95.6k]
  ------------------
 2138|  44.5k|               ++it;
 2139|  44.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 35.1k, False: 9.45k]
  |  Branch (2139:38): [True: 2.75k, False: 32.3k]
  |  Branch (2139:74): [True: 612, False: 31.7k]
  ------------------
 2140|  31.7k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 570, False: 31.1k]
  ------------------
 2141|  3.93k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  3.93k|                  it += 3;
 2143|  3.93k|                  finalize();
 2144|  3.93k|                  return;
 2145|  3.93k|               }
 2146|  40.6k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 31.1k, False: 9.45k]
  |  Branch (2146:38): [True: 1.48k, False: 29.6k]
  |  Branch (2146:74): [True: 924, False: 28.7k]
  ------------------
 2147|  28.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 2.00k, False: 26.7k]
  ------------------
 2148|  4.41k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  4.41k|                  it += 3;
 2150|  4.41k|                  finalize();
 2151|  4.41k|                  return;
 2152|  4.41k|               }
 2153|  36.2k|               it = start;
 2154|  36.2k|            }
 2155|       |
 2156|   131k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 10.1k, False: 121k]
  |  Branch (2156:31): [True: 23.1k, False: 98.6k]
  ------------------
 2157|  33.2k|               const char sign = *it;
 2158|  33.2k|               ++it;
 2159|  33.2k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 30.6k, False: 2.63k]
  |  Branch (2159:33): [True: 12.1k, False: 18.4k]
  ------------------
 2160|  12.1k|                  ++it;
 2161|  12.1k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 9.47k, False: 2.70k]
  |  Branch (2161:41): [True: 1.61k, False: 7.85k]
  |  Branch (2161:77): [True: 2.69k, False: 5.16k]
  ------------------
 2162|  7.79k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 3.48k, False: 1.68k]
  ------------------
 2163|  7.79k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 6.21k, False: 1.57k]
  ------------------
 2164|  6.21k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  6.21k|                     }
 2166|  1.57k|                     else {
 2167|  1.57k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  1.57k|                     }
 2169|  7.79k|                     it += 3;
 2170|  7.79k|                     finalize();
 2171|  7.79k|                     return;
 2172|  7.79k|                  }
 2173|  12.1k|               }
 2174|  25.4k|               it = start;
 2175|  25.4k|            }
 2176|   131k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   124k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  71.8M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 71.7M, False: 33.7k]
  ------------------
 2183|  71.7M|            const char c = *it;
 2184|  71.7M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 36.6k, False: 71.7M]
  |  Branch (2184:29): [True: 5.45k, False: 71.7M]
  |  Branch (2184:42): [True: 9.66k, False: 71.7M]
  |  Branch (2184:55): [True: 29.6k, False: 71.6M]
  |  Branch (2184:68): [True: 2.26k, False: 71.6M]
  |  Branch (2184:80): [True: 782, False: 71.6M]
  |  Branch (2184:92): [True: 1.37k, False: 71.6M]
  |  Branch (2184:104): [True: 14.2k, False: 71.6M]
  ------------------
 2185|   100k|               break;
 2186|   100k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  71.6M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 29.1k, False: 71.6M]
  ------------------
 2189|  29.1k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 780, False: 28.4k]
  |  Branch (2189:39): [True: 2.60k, False: 25.7k]
  |  Branch (2189:59): [True: 238, False: 25.5k]
  |  Branch (2189:80): [True: 500, False: 25.0k]
  |  Branch (2189:101): [True: 2.33k, False: 22.7k]
  ------------------
 2190|  6.45k|                  break;
 2191|  6.45k|               }
 2192|  29.1k|            }
 2193|  71.6M|            ++it;
 2194|  71.6M|         }
 2195|       |
 2196|   140k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   140k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 3.38k, False: 136k]
  ------------------
 2199|  3.38k|            ctx.error = error_code::parse_number_failure;
 2200|  3.38k|            return;
 2201|  3.38k|         }
 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|   136k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   136k|            bool negative = false;
 2254|   136k|            std::string_view digits = num_str;
 2255|       |
 2256|   136k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 120k, False: 16.1k]
  |  Branch (2256:37): [True: 21.5k, False: 99.1k]
  |  Branch (2256:62): [True: 3.91k, False: 95.2k]
  ------------------
 2257|  25.4k|               negative = (digits.front() == '-');
 2258|  25.4k|               digits.remove_prefix(1);
 2259|  25.4k|            }
 2260|       |
 2261|   136k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 61.9k, False: 74.9k]
  |  Branch (2261:38): [True: 23.0k, False: 38.8k]
  ------------------
 2262|  23.0k|               int base = 10;
 2263|  23.0k|               size_t offset = 0;
 2264|       |
 2265|  23.0k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 7.50k, False: 15.5k]
  |  Branch (2265:40): [True: 1.53k, False: 14.0k]
  ------------------
 2266|  9.04k|                  base = 16;
 2267|  9.04k|                  offset = 2;
 2268|  9.04k|               }
 2269|  14.0k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 812, False: 13.2k]
  |  Branch (2269:45): [True: 1.01k, False: 12.2k]
  ------------------
 2270|  1.83k|                  base = 8;
 2271|  1.83k|                  offset = 2;
 2272|  1.83k|               }
 2273|  12.2k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 314, False: 11.8k]
  |  Branch (2273:45): [True: 3.40k, False: 8.48k]
  ------------------
 2274|  3.71k|                  base = 2;
 2275|  3.71k|                  offset = 2;
 2276|  3.71k|               }
 2277|       |
 2278|  23.0k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 14.5k, False: 8.48k]
  ------------------
 2279|  14.5k|                  auto raw_digits = digits.substr(offset);
 2280|  14.5k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  14.5k|                  std::string clean_storage;
 2283|  14.5k|                  std::string_view clean_view;
 2284|  14.5k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 4.71k, False: 9.86k]
  ------------------
 2285|  4.71k|                     clean_storage.reserve(raw_digits.size());
 2286|  33.8M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 33.8M, False: 4.71k]
  ------------------
 2287|  33.8M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 33.7M, False: 6.02k]
  ------------------
 2288|  33.7M|                           clean_storage.push_back(c);
 2289|  33.7M|                        }
 2290|  33.8M|                     }
 2291|  4.71k|                     clean_view = clean_storage;
 2292|  4.71k|                  }
 2293|  9.86k|                  else {
 2294|  9.86k|                     clean_view = raw_digits;
 2295|  9.86k|                  }
 2296|       |
 2297|  14.5k|                  uint64_t parsed_int{};
 2298|  14.5k|                  auto [ptr, ec] =
 2299|  14.5k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  14.5k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 7.50k, False: 7.07k]
  |  Branch (2300:44): [True: 3.06k, False: 4.01k]
  ------------------
 2301|  10.5k|                     ctx.error = error_code::parse_number_failure;
 2302|  10.5k|                     finalize();
 2303|  10.5k|                     return;
 2304|  10.5k|                  }
 2305|       |
 2306|  4.01k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  4.01k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 1.09k, False: 2.91k]
  ------------------
 2308|  4.01k|                  finalize();
 2309|  4.01k|                  return;
 2310|  14.5k|               }
 2311|  23.0k|            }
 2312|   136k|         }
 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|   136k|         std::string clean_storage;
 2318|   136k|         std::string_view clean_view;
 2319|       |
 2320|   136k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 3.90k, False: 132k]
  ------------------
 2321|  3.90k|            clean_storage.reserve(num_str.size());
 2322|  1.29M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 1.29M, False: 3.90k]
  ------------------
 2323|  1.29M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 1.28M, False: 8.30k]
  ------------------
 2324|  1.28M|                  clean_storage.push_back(c);
 2325|  1.28M|               }
 2326|  1.29M|            }
 2327|  3.90k|            clean_view = clean_storage;
 2328|  3.90k|         }
 2329|   132k|         else {
 2330|   132k|            clean_view = num_str;
 2331|   132k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   136k|         auto parse_view = clean_view;
 2336|   136k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 105k, False: 31.0k]
  |  Branch (2336:37): [True: 21.5k, False: 84.2k]
  ------------------
 2337|  21.5k|            parse_view.remove_prefix(1);
 2338|  21.5k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 3.53k, False: 18.0k]
  ------------------
 2339|  3.53k|               ctx.error = error_code::parse_number_failure;
 2340|  3.53k|               return;
 2341|  3.53k|            }
 2342|  21.5k|         }
 2343|       |
 2344|   133k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   133k|            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|   133k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 82.9k, False: 50.4k]
  |  Branch (2347:45): [True: 31.1k, False: 19.2k]
  ------------------
 2348|  83.3k|               ctx.error = error_code::parse_number_failure;
 2349|  83.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|   133k|         finalize();
 2360|   133k|      }
_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|   151k|      {
  466|   151k|         skip_inline_ws(it, end);
  467|       |
  468|   151k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 2.61k, False: 149k]
  ------------------
  469|  2.61k|            if constexpr (!AllowEmptyInput) {
  470|  2.61k|               ctx.error = error_code::unexpected_end;
  471|  2.61k|            }
  472|  2.61k|            return true;
  473|  2.61k|         }
  474|       |
  475|   149k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   149k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 886, False: 148k]
  ------------------
  477|    886|            ctx.error = error_code::syntax_error;
  478|    886|            return true;
  479|    886|         }
  480|   148k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 336, False: 147k]
  ------------------
  481|    336|            ctx.error = error_code::syntax_error;
  482|    336|            return true;
  483|    336|         }
  484|       |
  485|   147k|         skip_inline_ws(it, end);
  486|       |
  487|   147k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 596, False: 147k]
  ------------------
  488|    596|            if constexpr (!AllowEmptyInput) {
  489|    596|               ctx.error = error_code::unexpected_end;
  490|    596|            }
  491|    596|            return true;
  492|    596|         }
  493|       |
  494|   147k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.06k, False: 140k]
  ------------------
  495|  7.06k|            return true;
  496|  7.06k|         }
  497|       |
  498|   140k|         return false;
  499|   147k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   148k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   148k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   148k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   148k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   147k|      {
  409|   147k|         state.has_anchor = false;
  410|   147k|         state.anchor_name.clear();
  411|   147k|         state.anchor_start = nullptr;
  412|   147k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   147k|         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|   147k|            else {
  421|   147k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 6.08k, False: 141k]
  ------------------
  422|   147k|            }
  423|   147k|         }
  424|       |
  425|   147k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 141k, False: 6.08k]
  |  Branch (425:27): [True: 12.3k, False: 128k]
  ------------------
  426|  12.3k|            ++it;
  427|  12.3k|            auto name = parse_anchor_name(it, end);
  428|  12.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 358, False: 12.0k]
  ------------------
  429|    358|               ctx.error = error_code::syntax_error;
  430|    358|               return true;
  431|    358|            }
  432|  12.0k|            skip_inline_ws(it, end);
  433|  12.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 616, False: 11.3k]
  ------------------
  434|    616|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    616|                  ctx.error = error_code::unexpected_end;
  436|    616|               }
  437|    616|               return true;
  438|    616|            }
  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.3k|            state.has_anchor = true;
  446|  11.3k|            state.anchor_name = std::string(name);
  447|  11.3k|            state.anchor_start = &*it;
  448|  11.3k|         }
  449|       |
  450|   146k|         return false;
  451|   147k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   147k|      {
  301|   147k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 147k]
  |  Branch (301:27): [True: 141k, False: 6.08k]
  ------------------
  302|       |
  303|  6.08k|         ++it; // skip '*'
  304|  6.08k|         auto name = parse_anchor_name(it, end);
  305|  6.08k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 972, False: 5.11k]
  ------------------
  306|    972|            ctx.error = error_code::syntax_error;
  307|    972|            return true;
  308|    972|         }
  309|       |
  310|  5.11k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.11k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.55k, False: 3.55k]
  ------------------
  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.55k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.55k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.75k, False: 1.80k]
  ------------------
  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|  1.80k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 70, False: 1.73k]
  ------------------
  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.73k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.73k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 1.73k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  1.73k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.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|  1.73k|         auto replay_it = span.begin;
  348|  1.73k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.73k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.73k|         ctx.indent_stack.clear();
  353|  1.73k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 802, False: 936]
  ------------------
  354|    802|            ctx.push_indent(span.base_indent - 1);
  355|    802|         }
  356|       |
  357|  1.73k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.73k|         using V = std::remove_cvref_t<T>;
  360|  1.73k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.73k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.73k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.73k|         return true;
  367|  1.73k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   133k|         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|  52.7k|      {
 5311|  52.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|  52.7k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  52.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  52.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  52.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 52.7k, False: 0]
  ------------------
 5321|  52.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|  52.7k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  56.7k|      {
 2081|  56.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 56.7k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  56.7k|         yaml::node_preamble_state preamble{};
 2085|  56.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 6.28k, False: 50.4k]
  ------------------
 2086|  56.7k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  6.28k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  50.4k|         std::string str;
 2091|  50.4k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  50.4k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 4.50k, False: 45.9k]
  |  Branch (2093:31): [True: 6.77k, False: 39.1k]
  |  Branch (2093:48): [True: 1.94k, False: 37.2k]
  |  Branch (2093:65): [True: 842, False: 36.3k]
  |  Branch (2093:81): [True: 1.13k, False: 35.2k]
  |  Branch (2093:97): [True: 1.26k, False: 33.9k]
  ------------------
 2094|  33.9k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 618, False: 33.3k]
  |  Branch (2094:29): [True: 408, False: 32.9k]
  |  Branch (2094:44): [True: 1.15k, False: 31.8k]
  ------------------
 2095|  18.6k|            value = true;
 2096|  18.6k|         }
 2097|  31.8k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 4.25k, False: 27.5k]
  |  Branch (2097:37): [True: 4.50k, False: 23.0k]
  |  Branch (2097:55): [True: 2.08k, False: 20.9k]
  |  Branch (2097:73): [True: 3.13k, False: 17.8k]
  |  Branch (2097:88): [True: 13.9k, False: 3.89k]
  |  Branch (2097:103): [True: 246, False: 3.64k]
  ------------------
 2098|  31.6k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 1.06k, False: 2.58k]
  |  Branch (2098:35): [True: 1.54k, False: 1.03k]
  |  Branch (2098:51): [True: 870, False: 164]
  ------------------
 2099|  31.6k|            value = false;
 2100|  31.6k|         }
 2101|    164|         else {
 2102|    164|            ctx.error = error_code::expected_true_or_false;
 2103|    164|         }
 2104|       |
 2105|  50.4k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  50.4k|      }
_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|  56.7k|      {
  466|  56.7k|         skip_inline_ws(it, end);
  467|       |
  468|  56.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 20, False: 56.7k]
  ------------------
  469|     20|            if constexpr (!AllowEmptyInput) {
  470|     20|               ctx.error = error_code::unexpected_end;
  471|     20|            }
  472|     20|            return true;
  473|     20|         }
  474|       |
  475|  56.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  56.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 56.7k]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|  56.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 56.7k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  56.7k|         skip_inline_ws(it, end);
  486|       |
  487|  56.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 56.7k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  56.7k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 6.24k, False: 50.4k]
  ------------------
  495|  6.24k|            return true;
  496|  6.24k|         }
  497|       |
  498|  50.4k|         return false;
  499|  56.7k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  56.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|  56.7k|      {
  409|  56.7k|         state.has_anchor = false;
  410|  56.7k|         state.anchor_name.clear();
  411|  56.7k|         state.anchor_start = nullptr;
  412|  56.7k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  56.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|  56.7k|            else {
  421|  56.7k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 6.21k, False: 50.4k]
  ------------------
  422|  56.7k|            }
  423|  56.7k|         }
  424|       |
  425|  56.7k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 50.4k, False: 6.21k]
  |  Branch (425:27): [True: 4.24k, False: 46.2k]
  ------------------
  426|  4.24k|            ++it;
  427|  4.24k|            auto name = parse_anchor_name(it, end);
  428|  4.24k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 4.23k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  4.23k|            skip_inline_ws(it, end);
  433|  4.23k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 4.21k]
  ------------------
  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.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|  56.6k|         return false;
  451|  56.7k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  56.7k|      {
  301|  56.7k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 56.7k]
  |  Branch (301:27): [True: 50.4k, False: 6.21k]
  ------------------
  302|       |
  303|  6.21k|         ++it; // skip '*'
  304|  6.21k|         auto name = parse_anchor_name(it, end);
  305|  6.21k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 6.18k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  6.18k|         auto anchor_it = ctx.anchors.find(name);
  311|  6.18k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 48, False: 6.14k]
  ------------------
  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|  6.14k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  6.14k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.11k, False: 4.03k]
  ------------------
  322|  2.11k|            return true;
  323|  2.11k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  4.03k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 4.00k]
  ------------------
  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|  4.00k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.00k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 4.00k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  4.00k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.00k]
  ------------------
  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.00k|         auto replay_it = span.begin;
  348|  4.00k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.00k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.00k|         ctx.indent_stack.clear();
  353|  4.00k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.75k, False: 2.25k]
  ------------------
  354|  1.75k|            ctx.push_indent(span.base_indent - 1);
  355|  1.75k|         }
  356|       |
  357|  4.00k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.00k|         using V = std::remove_cvref_t<T>;
  360|  4.00k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.00k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.00k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.00k|         return true;
  367|  4.00k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  27.2k|      {
 2467|  27.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 27.2k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  27.2k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  27.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 8, False: 27.2k]
  ------------------
 2473|      8|            ctx.error = error_code::unexpected_end;
 2474|      8|            return;
 2475|      8|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  27.2k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 5.59k, False: 21.6k]
  ------------------
 2479|  5.59k|            ++it;
 2480|  5.59k|            return;
 2481|  5.59k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  21.6k|         auto start = it;
 2485|   106k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 105k, False: 980]
  |  Branch (2485:30): [True: 84.9k, False: 20.6k]
  ------------------
 2486|  84.9k|            ++it;
 2487|  84.9k|         }
 2488|       |
 2489|  21.6k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  21.6k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 26, False: 21.6k]
  ------------------
 2491|     26|            ctx.error = error_code::syntax_error;
 2492|     26|         }
 2493|  21.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_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|   296k|      {
 5311|   296k|         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|   296k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   296k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   296k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   296k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 296k, False: 0]
  ------------------
 5321|   296k|            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|   296k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|   298k|      {
 4183|   298k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 298k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   298k|         auto peek = it;
 4188|   298k|         yaml::node_preamble_state preamble{};
 4189|   298k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 3.73k, False: 294k]
  ------------------
 4190|   298k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  3.73k|            it = peek;
 4192|  3.73k|            return;
 4193|  3.73k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   294k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   294k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 518, False: 294k]
  ------------------
 4198|    518|            return;
 4199|       |
 4200|   294k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 72.5k, False: 221k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  72.5k|            it = peek;
 4203|  72.5k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  72.5k|         }
 4205|   221k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 221k, 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|   221k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 1.62k, False: 219k]
  |  Branch (4208:57): [True: 9.96k, False: 209k]
  ------------------
 4209|  11.5k|               it = peek;
 4210|  11.5k|            }
 4211|   221k|            int32_t seq_indent = ctx.current_indent();
 4212|   221k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 220k, False: 890]
  |  Branch (4212:31): [True: 101k, False: 119k]
  ------------------
 4213|   101k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 35.0k, False: 65.9k]
  |  Branch (4213:62): [True: 28.5k, False: 6.55k]
  ------------------
 4214|   101k|                                                          : (ctx.current_indent() + 1);
 4215|   101k|            }
 4216|   221k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   221k|         }
 4218|    108|         else {
 4219|    108|            ctx.error = error_code::syntax_error;
 4220|    108|         }
 4221|       |
 4222|   294k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   294k|      }
_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|   298k|      {
  466|   298k|         skip_inline_ws(it, end);
  467|       |
  468|   298k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 298k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  474|       |
  475|   298k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   298k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 298k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   298k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 298k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   298k|         skip_inline_ws(it, end);
  486|       |
  487|   298k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 298k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   298k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.69k, False: 294k]
  ------------------
  495|  3.69k|            return true;
  496|  3.69k|         }
  497|       |
  498|   294k|         return false;
  499|   298k|      }
_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|   298k|                                             [](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|   298k|      {
  409|   298k|         state.has_anchor = false;
  410|   298k|         state.anchor_name.clear();
  411|   298k|         state.anchor_start = nullptr;
  412|   298k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   298k|         if constexpr (Policy.allow_alias) {
  415|       |            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|   298k|            else {
  421|   298k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.66k, False: 294k]
  ------------------
  422|   298k|            }
  423|   298k|         }
  424|       |
  425|   298k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 294k, False: 3.66k]
  |  Branch (425:27): [True: 10.9k, False: 283k]
  ------------------
  426|  10.9k|            ++it;
  427|  10.9k|            auto name = parse_anchor_name(it, end);
  428|  10.9k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 16, False: 10.9k]
  ------------------
  429|     16|               ctx.error = error_code::syntax_error;
  430|     16|               return true;
  431|     16|            }
  432|  10.9k|            skip_inline_ws(it, end);
  433|  10.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 10.9k]
  ------------------
  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|  10.9k|            state.has_anchor = true;
  446|  10.9k|            state.anchor_name = std::string(name);
  447|  10.9k|            state.anchor_start = &*it;
  448|  10.9k|         }
  449|       |
  450|   298k|         return false;
  451|   298k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   298k|      {
  301|   298k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 298k]
  |  Branch (301:27): [True: 294k, False: 3.66k]
  ------------------
  302|       |
  303|  3.66k|         ++it; // skip '*'
  304|  3.66k|         auto name = parse_anchor_name(it, end);
  305|  3.66k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 24, False: 3.63k]
  ------------------
  306|     24|            ctx.error = error_code::syntax_error;
  307|     24|            return true;
  308|     24|         }
  309|       |
  310|  3.63k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.63k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 34, False: 3.60k]
  ------------------
  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|  3.60k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.60k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.29k, False: 2.30k]
  ------------------
  322|  1.29k|            return true;
  323|  1.29k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.30k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 50, False: 2.25k]
  ------------------
  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|  2.25k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.25k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 2.25k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  2.25k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.25k]
  ------------------
  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.25k|         auto replay_it = span.begin;
  348|  2.25k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.25k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.25k|         ctx.indent_stack.clear();
  353|  2.25k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.03k, False: 1.21k]
  ------------------
  354|  1.03k|            ctx.push_indent(span.base_indent - 1);
  355|  1.03k|         }
  356|       |
  357|  2.25k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.25k|         using V = std::remove_cvref_t<T>;
  360|  2.25k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.25k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.25k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.25k|         return true;
  367|  2.25k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  72.5k|      {
 2665|  72.5k|         using V = std::remove_cvref_t<T>;
 2666|  72.5k|         using value_type = typename V::value_type;
 2667|       |
 2668|  72.5k|         struct sequence_container_adapter
 2669|  72.5k|         {
 2670|  72.5k|            size_t index = 0;
 2671|       |
 2672|  72.5k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  72.5k|            {
 2674|  72.5k|               if constexpr (!resizable<V>) {
 2675|  72.5k|                  return index >= container.size();
 2676|  72.5k|               }
 2677|  72.5k|               else {
 2678|  72.5k|                  (void)container;
 2679|  72.5k|                  return false;
 2680|  72.5k|               }
 2681|  72.5k|            }
 2682|       |
 2683|  72.5k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  72.5k|            inline void append(V& container, value_type&& element) noexcept
 2686|  72.5k|            {
 2687|  72.5k|               if constexpr (emplace_backable<V>) {
 2688|  72.5k|                  container.emplace_back(std::move(element));
 2689|  72.5k|               }
 2690|  72.5k|               else if constexpr (emplaceable<V>) {
 2691|  72.5k|                  container.emplace(std::move(element));
 2692|  72.5k|               }
 2693|  72.5k|            }
 2694|  72.5k|         };
 2695|       |
 2696|  72.5k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 72.5k]
  |  Branch (2696:27): [True: 0, False: 72.5k]
  ------------------
 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|  72.5k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  72.5k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  72.5k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  72.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 6, False: 72.5k]
  ------------------
 2709|      6|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  72.5k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 70.8k, False: 1.70k]
  |  Branch (2712:27): [True: 18.3k, False: 52.4k]
  ------------------
 2713|  18.3k|            ++it;
 2714|  18.3k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  18.3k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 6, False: 18.3k]
  ------------------
 2716|      6|               return;
 2717|  18.3k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  18.3k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 2.26k, False: 16.1k]
  ------------------
 2719|  2.26k|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|  2.26k|               }
 2721|  18.3k|            }
 2722|  18.3k|            return;
 2723|  18.3k|         }
 2724|       |
 2725|  54.1k|         bool just_saw_comma = false;
 2726|  54.1k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  54.1k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  83.0k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 79.8k, False: 3.18k]
  ------------------
 2731|  79.8k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  79.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 79.8k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  79.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 79.8k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  79.8k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 12.2k, False: 67.6k]
  ------------------
 2741|  12.2k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 12.2k, False: 0]
  ------------------
 2742|  12.2k|                     ++it;
 2743|  12.2k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  12.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 6, False: 12.2k]
  ------------------
 2745|      6|                        return;
 2746|  12.2k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  12.2k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 4.80k, False: 7.44k]
  ------------------
 2748|  4.80k|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|  4.80k|                        }
 2750|  12.2k|                     }
 2751|  12.2k|                     return;
 2752|  12.2k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  12.2k|               }
 2756|       |
 2757|  67.6k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 6, False: 67.6k]
  |  Branch (2757:34): [True: 10, False: 67.6k]
  ------------------
 2758|     16|                  ctx.error = error_code::syntax_error;
 2759|     16|                  return;
 2760|     16|               }
 2761|  67.6k|               just_saw_comma = false;
 2762|       |
 2763|  67.6k|               value_type element{};
 2764|  67.6k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  67.6k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 21.6k, False: 45.9k]
  ------------------
 2767|  21.6k|                  return;
 2768|       |
 2769|  45.9k|               bool saw_line_break_before_separator = false;
 2770|  45.9k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  45.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 30, False: 45.9k]
  ------------------
 2772|     30|                  return;
 2773|       |
 2774|  45.9k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 44.2k, False: 1.70k]
  |  Branch (2774:33): [True: 6.89k, False: 37.3k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  6.89k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 6, False: 6.88k]
  ------------------
 2777|      6|                     ctx.error = error_code::syntax_error;
 2778|      6|                     return;
 2779|      6|                  }
 2780|  6.88k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  6.88k|                     glz::generic key_node = std::move(element);
 2782|  6.88k|                     ++it;
 2783|  6.88k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  6.88k|                     glz::generic mapped{};
 2786|  6.88k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  6.88k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 302, False: 6.58k]
  ------------------
 2788|    302|                        return;
 2789|       |
 2790|  6.58k|                     std::string key;
 2791|  6.58k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 0, False: 6.58k]
  ------------------
 2792|      0|                        return;
 2793|       |
 2794|  6.58k|                     glz::generic pair{};
 2795|  6.58k|                     pair[key] = std::move(mapped);
 2796|  6.58k|                     element = std::move(pair);
 2797|       |
 2798|  6.58k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  6.58k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 2, False: 6.58k]
  ------------------
 2800|      2|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  6.88k|               }
 2807|       |
 2808|  45.9k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  45.9k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 1.74k, False: 44.2k]
  ------------------
 2811|  1.74k|                  ctx.error = error_code::unexpected_end;
 2812|  1.74k|                  return;
 2813|  1.74k|               }
 2814|       |
 2815|  44.2k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 14.5k, False: 29.6k]
  ------------------
 2816|  14.5k|                  ++it;
 2817|  14.5k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  14.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 6, False: 14.5k]
  ------------------
 2819|      6|                     return;
 2820|  14.5k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  14.5k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 6.76k, False: 7.82k]
  ------------------
 2822|  6.76k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|  6.76k|                     }
 2824|  14.5k|                  }
 2825|  14.5k|                  return;
 2826|  14.5k|               }
 2827|  29.6k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 28.9k, False: 710]
  ------------------
 2828|  28.9k|                  ++it;
 2829|  28.9k|                  just_saw_comma = true;
 2830|  28.9k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  28.9k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 6, False: 28.8k]
  ------------------
 2832|      6|                     return;
 2833|  28.9k|               }
 2834|    710|               else {
 2835|    710|                  ctx.error = error_code::syntax_error;
 2836|    710|                  return;
 2837|    710|               }
 2838|  44.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.1k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   293k|      {
 2649|   293k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   293k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   293k|               value.clear();
 2653|   293k|            }
 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|   293k|      }
_ZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  965|  20.0k|      {
  966|  20.0k|         auto is_document_start = [&](auto pos) {
  967|  20.0k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  968|  20.0k|               auto after = pos + 3;
  969|  20.0k|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  970|  20.0k|                      *after == '#';
  971|  20.0k|            }
  972|  20.0k|            return false;
  973|  20.0k|         };
  974|       |
  975|  20.0k|         bool at_line_start = false;
  976|  20.0k|         auto tail = it;
  977|  46.5k|         while (tail != end) {
  ------------------
  |  Branch (977:17): [True: 31.0k, False: 15.5k]
  ------------------
  978|  31.0k|            auto line = tail;
  979|  31.0k|            skip_inline_ws(line, end);
  980|       |
  981|  31.0k|            if (line == end) {
  ------------------
  |  Branch (981:17): [True: 1.33k, False: 29.7k]
  ------------------
  982|  1.33k|               return;
  983|  1.33k|            }
  984|       |
  985|  29.7k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (985:17): [True: 11.4k, False: 18.2k]
  |  Branch (985:34): [True: 8.67k, False: 9.54k]
  ------------------
  986|  20.1k|               tail = line;
  987|  20.1k|               skip_newline(tail, end);
  988|  20.1k|               at_line_start = true;
  989|  20.1k|               continue;
  990|  20.1k|            }
  991|       |
  992|  9.54k|            if (*line == '#') {
  ------------------
  |  Branch (992:17): [True: 6.63k, False: 2.90k]
  ------------------
  993|  6.63k|               if (!at_line_start && line == it) {
  ------------------
  |  Branch (993:20): [True: 2.28k, False: 4.35k]
  |  Branch (993:38): [True: 24, False: 2.26k]
  ------------------
  994|     24|                  ctx.error = error_code::syntax_error;
  995|     24|                  return;
  996|     24|               }
  997|  6.61k|               tail = line;
  998|  6.61k|               skip_comment(tail, end);
  999|  6.61k|               if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (999:20): [True: 6.40k, False: 210]
  |  Branch (999:36): [True: 5.36k, False: 1.04k]
  |  Branch (999:53): [True: 1.01k, False: 30]
  ------------------
 1000|  6.37k|                  skip_newline(tail, end);
 1001|  6.37k|                  at_line_start = true;
 1002|  6.37k|                  continue;
 1003|  6.37k|               }
 1004|    240|               return;
 1005|  6.61k|            }
 1006|       |
 1007|  2.90k|            if (at_line_start && (at_document_end(line, end) || is_document_start(line))) {
  ------------------
  |  Branch (1007:17): [True: 2.34k, False: 564]
  |  Branch (1007:35): [True: 882, False: 1.46k]
  |  Branch (1007:65): [True: 1.23k, False: 228]
  ------------------
 1008|  2.11k|               return;
 1009|  2.11k|            }
 1010|       |
 1011|    792|            ctx.error = error_code::syntax_error;
 1012|    792|            return;
 1013|  2.90k|         }
 1014|  20.0k|      }
_ZZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_ENKUlS5_E_clIS4_EEDaS5_:
  966|  1.46k|         auto is_document_start = [&](auto pos) {
  967|  1.46k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (967:17): [True: 1.33k, False: 124]
  |  Branch (967:35): [True: 1.25k, False: 80]
  |  Branch (967:52): [True: 1.24k, False: 12]
  |  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: 208, False: 1.03k]
  |  Branch (969:39): [True: 198, False: 834]
  |  Branch (969:56): [True: 194, False: 640]
  |  Branch (969:74): [True: 192, False: 448]
  |  Branch (969:92): [True: 194, False: 254]
  ------------------
  970|    254|                      *after == '#';
  ------------------
  |  Branch (970:23): [True: 248, False: 6]
  ------------------
  971|  1.24k|            }
  972|    222|            return false;
  973|  1.46k|         };
_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|  45.6k|            {
 2687|  45.6k|               if constexpr (emplace_backable<V>) {
 2688|  45.6k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  45.6k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   221k|      {
 3160|   221k|         using V = std::remove_cvref_t<T>;
 3161|   221k|         using value_type = typename V::value_type;
 3162|       |
 3163|   221k|         struct sequence_container_adapter
 3164|   221k|         {
 3165|   221k|            size_t index = 0;
 3166|       |
 3167|   221k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   221k|            {
 3169|   221k|               if constexpr (!resizable<V>) {
 3170|   221k|                  return index >= container.size();
 3171|   221k|               }
 3172|   221k|               else {
 3173|   221k|                  (void)container;
 3174|   221k|                  return false;
 3175|   221k|               }
 3176|   221k|            }
 3177|       |
 3178|   221k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   221k|            inline void append(V& container, value_type&& element) noexcept
 3181|   221k|            {
 3182|   221k|               if constexpr (emplace_backable<V>) {
 3183|   221k|                  container.emplace_back(std::move(element));
 3184|   221k|               }
 3185|   221k|               else if constexpr (emplaceable<V>) {
 3186|   221k|                  container.emplace(std::move(element));
 3187|   221k|               }
 3188|   221k|            }
 3189|   221k|         };
 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|   221k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   221k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   221k|         bool first_item = true;
 3200|   221k|         bool has_pending_item_anchor = false;
 3201|   221k|         std::string pending_item_anchor_name{};
 3202|   221k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   681k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 578k, False: 102k]
  ------------------
 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|   578k|            int32_t line_indent = 0;
 3215|   578k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   578k|            auto line_start = it;
 3217|       |
 3218|   938k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 896k, False: 41.7k]
  ------------------
 3219|   896k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 50.2k, False: 846k]
  ------------------
 3220|  50.2k|                  skip_comment(it, end);
 3221|  50.2k|                  skip_newline(it, end);
 3222|  50.2k|                  line_start = it;
 3223|  50.2k|                  line_indent = 0;
 3224|  50.2k|               }
 3225|   846k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 68.2k, False: 778k]
  |  Branch (3225:40): [True: 170k, False: 607k]
  ------------------
 3226|   238k|                  skip_newline(it, end);
 3227|   238k|                  line_start = it;
 3228|   238k|                  line_indent = 0;
 3229|   238k|               }
 3230|   607k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 77.3k, False: 530k]
  ------------------
 3231|  77.3k|                  line_start = it;
 3232|  77.3k|                  line_indent = 0;
 3233|   216k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 206k, False: 9.69k]
  |  Branch (3233:39): [True: 138k, False: 67.6k]
  ------------------
 3234|   138k|                     ++line_indent;
 3235|   138k|                     ++it;
 3236|   138k|                  }
 3237|       |
 3238|  77.3k|                  bool saw_tab = false;
 3239|  85.9k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 75.5k, False: 10.4k]
  |  Branch (3239:40): [True: 4.58k, False: 70.9k]
  |  Branch (3239:54): [True: 4.03k, False: 66.9k]
  ------------------
 3240|  8.61k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 5.63k, False: 2.98k]
  |  Branch (3240:43): [True: 2.98k, False: 0]
  ------------------
 3241|  8.61k|                     ++it;
 3242|  8.61k|                  }
 3243|       |
 3244|  77.3k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 10.4k, False: 66.9k]
  |  Branch (3244:36): [True: 3.46k, False: 63.4k]
  |  Branch (3244:51): [True: 26.2k, False: 37.1k]
  |  Branch (3244:66): [True: 11.2k, False: 25.9k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  51.4k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 41.0k, False: 10.4k]
  |  Branch (3246:39): [True: 11.2k, False: 29.7k]
  ------------------
 3247|  11.2k|                        skip_comment(it, end);
 3248|  11.2k|                     }
 3249|  51.4k|                     line_indent = 0;
 3250|  51.4k|                     continue;
 3251|  51.4k|                  }
 3252|       |
 3253|  25.9k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 34, False: 25.8k]
  ------------------
 3254|     34|                     ctx.error = error_code::syntax_error;
 3255|     34|                     return;
 3256|     34|                  }
 3257|  25.8k|                  break; // Found content
 3258|  25.9k|               }
 3259|   530k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 18.9k, False: 511k]
  ------------------
 3260|  18.9k|                  line_start = it;
 3261|  53.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 51.6k, False: 2.09k]
  |  Branch (3261:40): [True: 2.95k, False: 48.7k]
  |  Branch (3261:54): [True: 31.8k, False: 16.8k]
  ------------------
 3262|  18.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 2.09k, False: 16.8k]
  |  Branch (3262:36): [True: 7.43k, False: 9.41k]
  |  Branch (3262:51): [True: 874, False: 8.54k]
  |  Branch (3262:66): [True: 8.50k, False: 38]
  ------------------
 3263|  18.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 16.8k, False: 2.09k]
  |  Branch (3263:39): [True: 8.50k, False: 8.30k]
  ------------------
 3264|  8.50k|                        skip_comment(it, end);
 3265|  8.50k|                     }
 3266|  18.9k|                     line_indent = 0;
 3267|  18.9k|                     continue;
 3268|  18.9k|                  }
 3269|     38|                  ctx.error = error_code::syntax_error;
 3270|     38|                  return;
 3271|  18.9k|               }
 3272|   511k|               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|   511k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 221k, False: 289k]
  |  Branch (3276:37): [True: 220k, False: 890]
  ------------------
 3277|   220k|                     line_indent = sequence_indent;
 3278|   220k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   220k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 220k, False: 0]
  |  Branch (3279:49): [True: 220k, False: 0]
  ------------------
 3280|   220k|                           auto probe = it;
 3281|   220k|                           int32_t leading_ws = 0;
 3282|   220k|                           bool saw_tab = false;
 3283|   470k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 470k, False: 0]
  |  Branch (3283:64): [True: 243k, False: 227k]
  |  Branch (3283:87): [True: 6.79k, False: 220k]
  ------------------
 3284|   250k|                              --probe;
 3285|   250k|                              ++leading_ws;
 3286|   250k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 300, False: 250k]
  |  Branch (3286:52): [True: 6.61k, False: 243k]
  ------------------
 3287|   250k|                           }
 3288|   220k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 220k]
  |  Branch (3288:61): [True: 22.5k, False: 197k]
  |  Branch (3288:85): [True: 68.4k, False: 129k]
  ------------------
 3289|  91.0k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 6, False: 91.0k]
  ------------------
 3290|      6|                                 ctx.error = error_code::syntax_error;
 3291|      6|                                 return;
 3292|      6|                              }
 3293|  91.0k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  91.0k|                           }
 3295|   220k|                        }
 3296|   220k|                     }
 3297|   220k|                  }
 3298|   220k|                  break;
 3299|   511k|               }
 3300|   896k|            }
 3301|       |
 3302|   578k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 41.7k, False: 537k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   537k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 7.99k, False: 529k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   529k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 17.5k, False: 511k]
  ------------------
 3309|  17.5k|               it = line_start;
 3310|  17.5k|               return;
 3311|  17.5k|            }
 3312|       |
 3313|   511k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 19.3k, False: 492k]
  ------------------
 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|  19.3k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 28, False: 19.3k]
  ------------------
 3318|     28|                  ctx.error = error_code::syntax_error;
 3319|     28|                  return;
 3320|     28|               }
 3321|       |
 3322|  19.3k|               ++it;
 3323|  19.3k|               auto pending_name = parse_anchor_name(it, end);
 3324|  19.3k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 14, False: 19.3k]
  ------------------
 3325|     14|                  ctx.error = error_code::syntax_error;
 3326|     14|                  return;
 3327|     14|               }
 3328|  19.3k|               skip_inline_ws(it, end);
 3329|  19.3k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 19.3k, False: 18]
  |  Branch (3329:33): [True: 4.58k, False: 14.7k]
  ------------------
 3330|  4.58k|                  skip_comment(it, end);
 3331|  4.58k|               }
 3332|       |
 3333|  19.3k|               has_pending_item_anchor = true;
 3334|  19.3k|               pending_item_anchor_name = std::string(pending_name);
 3335|  19.3k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  19.3k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 18, False: 19.3k]
  |  Branch (3337:34): [True: 10.6k, False: 8.68k]
  |  Branch (3337:49): [True: 28, False: 10.5k]
  ------------------
 3338|     46|                  ctx.error = error_code::syntax_error;
 3339|     46|                  return;
 3340|     46|               }
 3341|       |
 3342|  19.2k|               skip_newline(it, end);
 3343|  19.2k|               continue;
 3344|  19.3k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   492k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 43.0k, False: 449k]
  ------------------
 3348|  43.0k|               it = line_start;
 3349|  43.0k|               return;
 3350|  43.0k|            }
 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|   449k|            dash_col = line_indent;
 3356|   449k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   449k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 449k, False: 6]
  ------------------
 3358|   449k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   449k|               }
 3360|   449k|            }
 3361|       |
 3362|   449k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   449k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 430k, False: 19.0k]
  |  Branch (3365:30): [True: 4.70k, False: 425k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  4.70k|               it = line_start;
 3368|  4.70k|               return;
 3369|  4.70k|            }
 3370|       |
 3371|   444k|            bool saw_tab_after_dash = false;
 3372|   741k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 719k, False: 22.2k]
  |  Branch (3372:34): [True: 232k, False: 486k]
  |  Branch (3372:48): [True: 64.4k, False: 422k]
  ------------------
 3373|   296k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.90k, False: 291k]
  |  Branch (3373:59): [True: 62.7k, False: 229k]
  ------------------
 3374|   296k|               ++it;
 3375|   296k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   444k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 62.7k, False: 381k]
  |  Branch (3377:39): [True: 62.2k, False: 572]
  |  Branch (3377:52): [True: 696, False: 61.5k]
  ------------------
 3378|    696|               const auto after_dash = it + 1;
 3379|    696|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 6, False: 690]
  |  Branch (3379:41): [True: 6, False: 684]
  ------------------
 3380|     12|                  ctx.error = error_code::syntax_error;
 3381|     12|                  return;
 3382|     12|               }
 3383|    696|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   444k|            auto parse_element = [&](auto& element) {
 3387|   444k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   444k|               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|   444k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   444k|                     return;
 3397|   444k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   444k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   444k|                  ctx.sequence_item_value_context = true;
 3400|   444k|                  ctx.sequence_dash_indent = dash_col;
 3401|   444k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   444k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   444k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   444k|                  ctx.pop_indent();
 3405|   444k|               }
 3406|   444k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   444k|                  skip_ws_and_comment(it, end);
 3409|   444k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   444k|                  auto nested_start = it;
 3413|   444k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   444k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   444k|                     return;
 3416|   444k|                  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|   444k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   444k|                  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|   444k|                     const int32_t element_indent =
 3428|   444k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   444k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   444k|                        return;
 3431|   444k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   444k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   444k|                     ctx.sequence_item_value_context = true;
 3434|   444k|                     ctx.sequence_dash_indent = dash_col;
 3435|   444k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   444k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   444k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   444k|                     ctx.pop_indent();
 3439|   444k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   444k|               }
 3442|       |
 3443|   444k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   444k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   444k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   444k|                                                                      pending_item_anchor_indent};
 3447|   444k|                  has_pending_item_anchor = false;
 3448|   444k|               }
 3449|   444k|            };
 3450|       |
 3451|   444k|            if constexpr (emplace_backable<V>) {
 3452|   444k|               auto& element = value.emplace_back();
 3453|   444k|               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|   444k|            first_item = false;
 3472|       |
 3473|   444k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 3.34k, False: 441k]
  ------------------
 3474|  3.34k|               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|   444k|         }
 3479|   221k|      }
_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|   444k|            auto parse_element = [&](auto& element) {
 3387|   444k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 422k, False: 22.2k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   444k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 422k, False: 22.2k]
  |  Branch (3390:33): [True: 196k, False: 225k]
  ------------------
 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|   196k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 196k]
  ------------------
 3396|      0|                     return;
 3397|   196k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   196k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   196k|                  ctx.sequence_item_value_context = true;
 3400|   196k|                  ctx.sequence_dash_indent = dash_col;
 3401|   196k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   196k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   196k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   196k|                  ctx.pop_indent();
 3405|   196k|               }
 3406|   247k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   247k|                  skip_ws_and_comment(it, end);
 3409|   247k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   247k|                  auto nested_start = it;
 3413|   247k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   247k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 6, False: 247k]
  ------------------
 3415|      6|                     return;
 3416|   247k|                  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|   247k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 16.5k, False: 231k]
  ------------------
 3422|   247k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 72.2k, False: 175k]
  ------------------
 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|  72.2k|                     const int32_t element_indent =
 3428|  72.2k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 72.2k]
  ------------------
 3429|  72.2k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 72.2k]
  ------------------
 3430|      0|                        return;
 3431|  72.2k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  72.2k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  72.2k|                     ctx.sequence_item_value_context = true;
 3434|  72.2k|                     ctx.sequence_dash_indent = dash_col;
 3435|  72.2k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  72.2k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  72.2k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  72.2k|                     ctx.pop_indent();
 3439|  72.2k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   247k|               }
 3442|       |
 3443|   444k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 5.73k, False: 438k]
  |  Branch (3443:47): [True: 5.67k, False: 62]
  ------------------
 3444|  5.67k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 3.66k, False: 2.00k]
  ------------------
 3445|  5.67k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  5.67k|                                                                      pending_item_anchor_indent};
 3447|  5.67k|                  has_pending_item_anchor = false;
 3448|  5.67k|               }
 3449|   444k|            };
_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|   734k|   {
 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|   734k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 239k, False: 494k]
  ------------------
 5601|   239k|         return;
 5602|   239k|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|   494k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 52.9k, False: 441k]
  ------------------
 5605|  52.9k|         return;
 5606|  52.9k|      }
 5607|   441k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   441k|   }
_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|   102k|            auto is_word_boundary = [&](const auto ptr) {
 5963|   102k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 2.29k, False: 100k]
  ------------------
 5964|  2.29k|                  return true;
 5965|  2.29k|               }
 5966|   100k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 49.2k, False: 50.8k]
  ------------------
 5967|  49.2k|                  auto next = ptr + 1;
 5968|  49.2k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 18.2k, False: 31.0k]
  |  Branch (5968:43): [True: 2.44k, False: 28.5k]
  |  Branch (5968:59): [True: 6.49k, False: 22.0k]
  |  Branch (5968:76): [True: 14.6k, False: 7.45k]
  |  Branch (5968:93): [True: 3.16k, False: 4.29k]
  ------------------
 5969|  49.2k|               }
 5970|  50.8k|               return is_plain_scalar_boundary(*ptr);
 5971|   100k|            };
_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|  50.8k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  50.8k|               switch (ch) {
 5890|  1.72k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 1.72k, False: 49.1k]
  ------------------
 5891|  3.14k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 1.42k, False: 49.4k]
  ------------------
 5892|  17.8k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 14.7k, False: 36.1k]
  ------------------
 5893|  42.6k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 24.8k, False: 26.0k]
  ------------------
 5894|  42.8k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 202, False: 50.6k]
  ------------------
 5895|  43.0k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 218, False: 50.6k]
  ------------------
 5896|  43.4k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 398, False: 50.4k]
  ------------------
 5897|  43.4k|                  return true;
 5898|  7.34k|               default:
  ------------------
  |  Branch (5898:16): [True: 7.34k, False: 43.4k]
  ------------------
 5899|  7.34k|                  return false;
 5900|  50.8k|               }
 5901|  50.8k|            };
_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|  90.7k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5905|       |                  return false;
 5906|       |               }
 5907|  90.7k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 40.0k, False: 50.7k]
  ------------------
 5908|  40.0k|                  return false;
 5909|  40.0k|               }
 5910|  50.7k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 1.15k, False: 49.5k]
  |  Branch (5910:40): [True: 35.3k, False: 14.2k]
  |  Branch (5910:61): [True: 15.6k, False: 19.6k]
  ------------------
 5911|  16.7k|                  return false;
 5912|  16.7k|               }
 5913|       |
 5914|  33.9k|               auto look = word_end;
 5915|  33.9k|               yaml::skip_newline(look, end);
 5916|   167k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 155k, False: 12.2k]
  ------------------
 5917|   155k|                  int32_t line_indent = 0;
 5918|   591k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 591k, False: 236]
  |  Branch (5918:41): [True: 435k, False: 155k]
  ------------------
 5919|   435k|                     ++line_indent;
 5920|   435k|                     ++look;
 5921|   435k|                  }
 5922|   155k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 155k, False: 236]
  |  Branch (5922:38): [True: 2.16k, False: 153k]
  ------------------
 5923|  2.16k|                     return false;
 5924|  2.16k|                  }
 5925|   153k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 236, False: 153k]
  |  Branch (5925:38): [True: 106k, False: 46.5k]
  |  Branch (5925:55): [True: 13.7k, False: 32.7k]
  ------------------
 5926|   120k|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 120k, False: 236]
  ------------------
 5927|   120k|                        yaml::skip_newline(look, end);
 5928|   120k|                        continue;
 5929|   120k|                     }
 5930|    236|                     return false;
 5931|   120k|                  }
 5932|  32.7k|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 14.5k, False: 18.1k]
  ------------------
 5933|  14.5k|                     yaml::skip_comment(look, end);
 5934|  14.5k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 13.4k, False: 1.16k]
  |  Branch (5934:42): [True: 6.05k, False: 7.36k]
  |  Branch (5934:59): [True: 7.36k, False: 0]
  ------------------
 5935|  13.4k|                        yaml::skip_newline(look, end);
 5936|  13.4k|                        continue;
 5937|  13.4k|                     }
 5938|  1.16k|                     return false;
 5939|  14.5k|                  }
 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|  18.1k|                  {
 5945|  18.1k|                     auto scan = look;
 5946|  2.75M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 2.75M, False: 1.97k]
  |  Branch (5946:44): [True: 2.74M, False: 6.96k]
  |  Branch (5946:61): [True: 2.74M, False: 1.76k]
  ------------------
 5947|  2.74M|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 14.1k, False: 2.73M]
  ------------------
 5948|  14.1k|                           auto after_colon = scan + 1;
 5949|  14.1k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 1.26k, False: 12.8k]
  |  Branch (5949:54): [True: 3.13k, False: 9.71k]
  |  Branch (5949:77): [True: 294, False: 9.41k]
  ------------------
 5950|  9.41k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 2.34k, False: 7.07k]
  |  Branch (5950:56): [True: 400, False: 6.67k]
  ------------------
 5951|  7.43k|                              return false;
 5952|  7.43k|                           }
 5953|  14.1k|                        }
 5954|  2.73M|                        ++scan;
 5955|  2.73M|                     }
 5956|  18.1k|                  }
 5957|       |
 5958|  10.7k|                  return line_indent > ctx.current_indent();
 5959|  18.1k|               }
 5960|  12.2k|               return false;
 5961|  33.9k|            };
_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|   814k|   {
 5485|   814k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   814k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   814k|         const bool could_be_mapping = [&] {
 5493|   814k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   814k|               return line_could_be_flow_mapping(it, end);
 5495|   814k|            }
 5496|   814k|            else {
 5497|   814k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   814k|            }
 5499|   814k|         }();
 5500|   814k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 493k, False: 320k]
  ------------------
 5501|   493k|            return false;
 5502|   493k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   320k|         auto temp_ctx = ctx.make_speculative();
 5505|   320k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   320k|                                                                                               end);
 5507|   320k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   320k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   320k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 249k, False: 70.9k]
  ------------------
 5510|   249k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   249k|            return true;
 5512|   249k|         }
 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|  70.9k|         ctx.error = temp_ctx.error;
 5517|  70.9k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  70.9k|         return false;
 5519|   320k|      }
 5520|   814k|   }
_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|   814k|         const bool could_be_mapping = [&] {
 5493|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5494|       |               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|   814k|            else {
 5497|   814k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   814k|            }
 5499|   814k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|  52.0k|               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|  52.0k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  52.0k|                     val = glz::generic{};
 4770|  52.0k|                     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|  52.0k|               };
_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|   278k|      {
 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|   278k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 278k]
  ------------------
 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|   278k|         const int32_t parent_indent = ctx.current_indent();
 3722|   278k|         const bool discover_indent = (mapping_indent < 0);
 3723|   278k|         bool first_key = !discover_indent;
 3724|   278k|         bool discovered_first_key_mid_line = false;
 3725|   278k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|   893k|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 776k, False: 116k]
  ------------------
 3728|   776k|            auto line_start = it;
 3729|   776k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 776k]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|   900k|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 892k, False: 8.07k]
  ------------------
 3733|   892k|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 14.9k, False: 877k]
  ------------------
 3734|  14.9k|                  skip_comment(it, end);
 3735|  14.9k|                  skip_newline(it, end);
 3736|  14.9k|                  first_key = false;
 3737|  14.9k|                  line_indent = 0;
 3738|  14.9k|               }
 3739|   877k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 69.2k, False: 807k]
  |  Branch (3739:40): [True: 22.1k, False: 785k]
  ------------------
 3740|  91.3k|                  skip_newline(it, end);
 3741|  91.3k|                  first_key = false;
 3742|  91.3k|                  line_indent = 0;
 3743|  91.3k|               }
 3744|   785k|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 214k, False: 571k]
  ------------------
 3745|   214k|                  line_start = it;
 3746|   214k|                  line_indent = 0;
 3747|  1.24M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 1.23M, False: 1.44k]
  |  Branch (3747:39): [True: 1.02M, False: 213k]
  ------------------
 3748|  1.02M|                     ++line_indent;
 3749|  1.02M|                     ++it;
 3750|  1.02M|                  }
 3751|       |
 3752|   214k|                  bool saw_tab = false;
 3753|   220k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 218k, False: 1.70k]
  |  Branch (3753:40): [True: 362, False: 218k]
  |  Branch (3753:54): [True: 5.30k, False: 212k]
  ------------------
 3754|  5.67k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 4.03k, False: 1.63k]
  |  Branch (3754:43): [True: 1.63k, False: 0]
  ------------------
 3755|  5.67k|                     ++it;
 3756|  5.67k|                  }
 3757|       |
 3758|   214k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 1.70k, False: 212k]
  |  Branch (3758:36): [True: 4.34k, False: 208k]
  |  Branch (3758:51): [True: 2.96k, False: 205k]
  |  Branch (3758:66): [True: 6.13k, False: 199k]
  ------------------
 3759|  15.1k|                     first_key = false;
 3760|  15.1k|                     line_indent = 0;
 3761|  15.1k|                     continue; // Blank or comment line
 3762|  15.1k|                  }
 3763|       |
 3764|   199k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 38, False: 199k]
  ------------------
 3765|     38|                     ctx.error = error_code::syntax_error;
 3766|     38|                     return;
 3767|     38|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   199k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 198k, False: 1.04k]
  |  Branch (3770:46): [True: 228, False: 198k]
  ------------------
 3771|    228|                     it = line_start;
 3772|    228|                     return;
 3773|    228|                  }
 3774|       |
 3775|   199k|                  first_key = false;
 3776|   199k|                  break; // Found content
 3777|   199k|               }
 3778|   571k|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 2.01k, False: 569k]
  ------------------
 3779|  2.01k|                  line_start = it;
 3780|  6.55k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 6.30k, False: 244]
  |  Branch (3780:40): [True: 1.21k, False: 5.08k]
  |  Branch (3780:54): [True: 3.32k, False: 1.76k]
  ------------------
 3781|  2.01k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 244, False: 1.76k]
  |  Branch (3781:36): [True: 711, False: 1.05k]
  |  Branch (3781:51): [True: 476, False: 580]
  |  Branch (3781:66): [True: 495, False: 85]
  ------------------
 3782|  1.92k|                     first_key = false;
 3783|  1.92k|                     line_indent = 0;
 3784|  1.92k|                     continue; // Blank or comment-only line with tab indentation
 3785|  1.92k|                  }
 3786|     85|                  ctx.error = error_code::syntax_error;
 3787|     85|                  return;
 3788|  2.01k|               }
 3789|   569k|               else {
 3790|   569k|                  line_start = it;
 3791|   569k|                  break; // Content at column 0
 3792|   569k|               }
 3793|   892k|            }
 3794|       |
 3795|   776k|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 8.07k, False: 768k]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|   768k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 2.53k, False: 765k]
  |  Branch (3799:45): [True: 697, False: 765k]
  ------------------
 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|   765k|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 765k, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|   765k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 765k, False: 0]
  |  Branch (3806:39): [True: 487k, False: 277k]
  |  Branch (3806:62): [True: 165k, False: 321k]
  |  Branch (3806:84): [True: 121k, False: 43.7k]
  ------------------
 3807|   121k|                  it = line_start;
 3808|   121k|                  return;
 3809|   121k|               }
 3810|   643k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 365k, False: 277k]
  |  Branch (3810:43): [True: 141, False: 365k]
  ------------------
 3811|    141|                  it = line_start;
 3812|    141|                  return;
 3813|    141|               }
 3814|   643k|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|   643k|            bool established_mapping_indent_this_line = false;
 3818|   643k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 277k, False: 365k]
  ------------------
 3819|   277k|               mapping_indent = line_indent;
 3820|   277k|               established_mapping_indent_this_line = true;
 3821|   277k|               discovered_first_key_visual_indent = line_indent;
 3822|   277k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   277k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 277k, False: 0]
  |  Branch (3823:43): [True: 271k, False: 5.74k]
  ------------------
 3824|   271k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   271k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 306, False: 271k]
  ------------------
 3826|    306|                        ctx.error = error_code::syntax_error;
 3827|    306|                        return;
 3828|    306|                     }
 3829|       |
 3830|   271k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   271k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 270k, False: 1.04k]
  |  Branch (3831:49): [True: 235k, False: 35.4k]
  ------------------
 3832|   235k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   235k|                     }
 3834|   271k|                  }
 3835|   277k|               }
 3836|   277k|            }
 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|   643k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 642k, False: 306]
  |  Branch (3840:36): [True: 642k, False: 0]
  |  Branch (3840:59): [True: 365k, False: 277k]
  ------------------
 3841|   365k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 224k, False: 141k]
  ------------------
 3842|   224k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 223k, False: 541]
  |  Branch (3842:43): [True: 19.6k, False: 204k]
  ------------------
 3843|  19.6k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 29, False: 19.6k]
  ------------------
 3844|     29|                     ctx.error = error_code::syntax_error;
 3845|     29|                     return;
 3846|     29|                  }
 3847|  19.6k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 1.20k, False: 18.4k]
  ------------------
 3848|  1.20k|                     it = line_start;
 3849|  1.20k|                     return;
 3850|  1.20k|                  }
 3851|  19.6k|               }
 3852|   204k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 1.13k, False: 203k]
  ------------------
 3853|  1.13k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 220, False: 918]
  |  Branch (3853:47): [True: 2, False: 916]
  ------------------
 3854|    916|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 916, False: 0]
  |  Branch (3854:49): [True: 916, False: 0]
  |  Branch (3854:72): [True: 13, False: 903]
  ------------------
 3855|    235|                  ctx.error = error_code::syntax_error;
 3856|    235|                  return;
 3857|    235|               }
 3858|   224k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|   641k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 641k]
  |  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|   641k|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 641k]
  ------------------
 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|   641k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 306, False: 641k]
  |  Branch (3876:32): [True: 0, False: 641k]
  ------------------
 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|   641k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 128k, False: 513k]
  |  Branch (3885:53): [True: 30.1k, False: 98.1k]
  |  Branch (3885:94): [True: 8.19k, False: 21.9k]
  ------------------
 3886|  8.19k|               const auto after_colon = it + 1;
 3887|  8.19k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 6.07k, False: 2.12k]
  ------------------
 3888|  8.19k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 418, False: 7.77k]
  |  Branch (3888:43): [True: 5.48k, False: 2.29k]
  ------------------
 3889|  5.90k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 838, False: 5.06k]
  ------------------
 3890|    838|                  it = line_start;
 3891|    838|                  return;
 3892|    838|               }
 3893|  8.19k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|   640k|            int32_t effective_line_indent = line_indent;
 3897|   640k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 640k, False: 306]
  |  Branch (3897:36): [True: 277k, False: 363k]
  ------------------
 3898|   277k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 235k, False: 42.1k]
  ------------------
 3899|   235k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 185k, False: 49.2k]
  |  Branch (3899:52): [True: 22.0k, False: 163k]
  ------------------
 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|   212k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   212k|            }
 3912|       |
 3913|   640k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 25.3k, False: 615k]
  ------------------
 3914|  25.3k|               return;
 3915|  25.3k|            }
 3916|   615k|            first_key = false;
 3917|       |
 3918|   615k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 615k]
  ------------------
 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|   615k|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 520k, False: 94.8k]
  ------------------
 3938|   520k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 153k, False: 366k]
  |  Branch (3938:34): [True: 2.92k, False: 364k]
  ------------------
 3939|   156k|                  auto peek = it;
 3940|   156k|                  skip_inline_ws(peek, end);
 3941|   156k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 155k, False: 787]
  |  Branch (3941:38): [True: 152k, False: 3.50k]
  |  Branch (3941:55): [True: 147k, False: 4.97k]
  |  Branch (3941:72): [True: 145k, False: 1.70k]
  ------------------
 3942|   145k|                     continue; // At leading indent of new line
 3943|   145k|                  }
 3944|   156k|               }
 3945|   375k|               skip_inline_ws(it, end);
 3946|   375k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 374k, False: 787]
  |  Branch (3946:33): [True: 10.7k, False: 363k]
  ------------------
 3947|  10.7k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  10.7k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 10.7k, False: 0]
  ------------------
 3949|  10.7k|                        const char prev = *(it - 1);
 3950|  10.7k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 5.45k, False: 5.31k]
  |  Branch (3950:44): [True: 4.46k, False: 987]
  |  Branch (3950:60): [True: 3.48k, False: 979]
  |  Branch (3950:76): [True: 9, False: 3.47k]
  ------------------
 3951|      9|                           ctx.error = error_code::syntax_error;
 3952|      9|                           return;
 3953|      9|                        }
 3954|  10.7k|                     }
 3955|  10.7k|                  }
 3956|  10.7k|               }
 3957|  10.7k|               skip_comment(it, end);
 3958|   375k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 373k, False: 1.19k]
  |  Branch (3958:34): [True: 75.3k, False: 298k]
  |  Branch (3958:49): [True: 57.8k, False: 240k]
  ------------------
 3959|   133k|                  skip_newline(it, end);
 3960|   133k|               }
 3961|   241k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 240k, False: 1.19k]
  ------------------
 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|   240k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   240k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 267, False: 240k]
  ------------------
 3968|    267|                        ctx.error = error_code::syntax_error;
 3969|    267|                        return;
 3970|    267|                     }
 3971|   240k|                  }
 3972|   240k|               }
 3973|   375k|            }
 3974|   615k|         }
 3975|   278k|      }
_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|   640k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   640k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   640k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   640k|                        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|   640k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   640k|                           if (ctx.stream_begin) {
 4893|   640k|                              auto is_line_content_start = [&](auto pos) {
 4894|   640k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   640k|                              };
 4896|       |
 4897|   640k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   640k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   640k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   640k|                                 return line != end && *line == ':';
 4901|   640k|                              };
 4902|       |
 4903|   640k|                              if (!is_line_content_start(it) &&
 4904|   640k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   640k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   640k|                                 ctx.error = error_code::syntax_error;
 4907|   640k|                                 return false;
 4908|   640k|                              }
 4909|   640k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   640k|                           }
 4911|   640k|                        }
 4912|       |
 4913|   640k|                        if (*it == '-' &&
 4914|   640k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   640k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   640k|                           ctx.error = error_code::syntax_error;
 4918|   640k|                           return false;
 4919|   640k|                        }
 4920|       |
 4921|   640k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   640k|                           return false;
 4923|   640k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   640k|                        ctx.pop_indent();
 4925|   640k|                     }
 4926|   640k|                     else {
 4927|   640k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   640k|                        if (nested_indent >= 0) {
 4929|   640k|                           yaml::skip_to_content(it, end);
 4930|   640k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   640k|                              ctx.error = error_code::syntax_error;
 4932|   640k|                              return false;
 4933|   640k|                           }
 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|   640k|                           const int32_t value_indent =
 4937|   640k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   640k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   640k|                              return false;
 4940|   640k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   640k|                           ctx.pop_indent();
 4942|   640k|                        }
 4943|   640k|                     }
 4944|   640k|                     return !bool(ctx.error);
 4945|   640k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   640k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 261k, False: 378k]
  |  Branch (4950:37): [True: 261k, False: 668]
  |  Branch (4950:58): [True: 3, False: 261k]
  ------------------
 4951|      3|                     ctx.error = error_code::syntax_error;
 4952|      3|                     return false;
 4953|      3|                  }
 4954|   640k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 261k, False: 378k]
  |  Branch (4954:38): [True: 668, False: 261k]
  |  Branch (4954:57): [True: 42.6k, False: 218k]
  |  Branch (4954:77): [True: 38.5k, False: 180k]
  |  Branch (4954:98): [True: 177k, False: 3.05k]
  ------------------
 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);
  ------------------
  |  Branch (4959:25): [True: 185k, False: 73.4k]
  ------------------
 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 == '&') {
  ------------------
  |  Branch (4977:29): [True: 244k, False: 14.0k]
  |  Branch (4977:47): [True: 17.9k, False: 226k]
  ------------------
 4978|  17.9k|                           auto anchor_probe = content + 1;
 4979|  17.9k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  17.9k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 17.8k, False: 25]
  ------------------
 4981|  17.8k|                              auto after_anchor = anchor_probe;
 4982|  17.8k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  17.8k|                              auto value_indicator = after_anchor;
 4985|  17.8k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 17.3k, False: 522]
  |  Branch (4985:61): [True: 2.26k, False: 15.1k]
  ------------------
 4986|  2.26k|                                 key.clear();
 4987|  2.26k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  2.26k|                                 it = value_indicator;
 4989|  2.26k|                                 handled_anchor_only_empty_key = true;
 4990|  2.26k|                              }
 4991|  15.6k|                              else {
 4992|  15.6k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 15.1k, False: 522]
  |  Branch (4992:64): [True: 1.00k, False: 14.1k]
  ------------------
 4993|  1.00k|                                    yaml::skip_comment(value_indicator, end);
 4994|  1.00k|                                 }
 4995|  15.6k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 14.8k, False: 807]
  |  Branch (4995:65): [True: 2.88k, False: 11.9k]
  |  Branch (4995:93): [True: 2.40k, False: 9.52k]
  ------------------
 4996|  5.29k|                                    yaml::skip_newline(value_indicator, end);
 4997|  5.29k|                                    auto value_line = value_indicator;
 4998|  5.29k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  5.29k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 2, False: 5.29k]
  ------------------
 5000|      2|                                       return false;
 5001|  5.29k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 4.65k, False: 637]
  |  Branch (5001:62): [True: 894, False: 3.76k]
  ------------------
 5002|    894|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 882, False: 12]
  ------------------
 5003|    882|                                       key.clear();
 5004|    882|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|    882|                                       it = value_line;
 5006|    882|                                       handled_anchor_only_empty_key = true;
 5007|    882|                                    }
 5008|  4.40k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 3.77k, False: 637]
  |  Branch (5008:67): [True: 12, False: 3.76k]
  ------------------
 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|     12|                                       ctx.error = error_code::syntax_error;
 5013|     12|                                       return false;
 5014|     12|                                    }
 5015|  5.29k|                                 }
 5016|  15.6k|                              }
 5017|  17.8k|                           }
 5018|  17.9k|                        }
 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) {
  ------------------
  |  Branch (5029:29): [True: 3.14k, False: 255k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  3.14k|                        }
 5032|   255k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 14.0k, False: 241k]
  |  Branch (5032:53): [True: 129k, False: 112k]
  |  Branch (5032:72): [True: 128k, False: 861]
  ------------------
 5033|   142k|                           key.clear();
 5034|   142k|                           it = content;
 5035|   142k|                        }
 5036|   113k|                        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|   113k|                           auto key_node_it = content;
 5042|   113k|                           auto key_node_end = end;
 5043|   113k|                           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|   113k|                              auto scan = content;
 5048|  2.76M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 2.71M, False: 56.1k]
  ------------------
 5049|  49.3M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 49.3M, False: 22.5k]
  |  Branch (5049:56): [True: 47.9M, False: 1.40M]
  |  Branch (5049:73): [True: 46.6M, False: 1.28M]
  ------------------
 5050|  46.6M|                                    ++scan;
 5051|  46.6M|                                 }
 5052|  2.71M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 22.5k, False: 2.68M]
  ------------------
 5053|  22.5k|                                    break;
 5054|  22.5k|                                 }
 5055|       |
 5056|  2.68M|                                 yaml::skip_newline(scan, end);
 5057|  2.68M|                                 auto line_start = scan;
 5058|       |
 5059|  2.68M|                                 int32_t indicator_indent = 0;
 5060|  4.96M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 4.90M, False: 56.1k]
  |  Branch (5060:56): [True: 2.27M, False: 2.63M]
  ------------------
 5061|  2.27M|                                    ++indicator_indent;
 5062|  2.27M|                                    ++scan;
 5063|  2.27M|                                 }
 5064|       |
 5065|  2.68M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 2.63M, False: 56.1k]
  |  Branch (5065:53): [True: 173k, False: 2.46M]
  ------------------
 5066|   173k|                                    const auto after_colon = scan + 1;
 5067|   173k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 549, False: 172k]
  ------------------
 5068|   172k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 112k, False: 60.0k]
  ------------------
 5069|   113k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 34.8k, False: 78.4k]
  ------------------
 5070|  34.8k|                                       key_node_end = line_start;
 5071|  34.8k|                                       break;
 5072|  34.8k|                                    }
 5073|   173k|                                 }
 5074|  2.68M|                              }
 5075|   113k|                           }
 5076|       |
 5077|   113k|                           glz::generic key_node{};
 5078|   113k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   113k|                           ctx.explicit_mapping_key_context = true;
 5080|   113k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   113k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   113k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 4.00k, False: 109k]
  ------------------
 5083|  4.00k|                              return false;
 5084|   109k|                           it = key_node_it;
 5085|   109k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 54, False: 109k]
  ------------------
 5086|     54|                              return false;
 5087|   109k|                        }
 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|   254k|                     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')) {
  ------------------
  |  Branch (5101:26): [True: 215k, False: 43.7k]
  |  Branch (5101:40): [True: 19.0k, False: 196k]
  |  Branch (5101:55): [True: 27.9k, False: 168k]
  ------------------
 5102|  46.9k|                        auto probe = it;
 5103|  46.9k|                        bool found_value_indicator = false;
 5104|       |
 5105|  73.6k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 58.8k, False: 14.7k]
  |  Branch (5105:49): [True: 23.5k, False: 35.2k]
  |  Branch (5105:67): [True: 35.2k, False: 4]
  ------------------
 5106|  58.8k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|  58.8k|                           auto value_line = probe;
 5109|  58.8k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|  58.8k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 3, False: 58.8k]
  ------------------
 5111|      3|                              return false;
 5112|       |
 5113|  58.8k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 14.6k, False: 44.1k]
  |  Branch (5113:53): [True: 2.60k, False: 41.5k]
  |  Branch (5113:76): [True: 6.12k, False: 35.4k]
  ------------------
 5114|  23.3k|                              probe = value_line;
 5115|  23.3k|                              continue; // blank line
 5116|  23.3k|                           }
 5117|  35.4k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 3.27k, False: 32.1k]
  ------------------
 5118|  3.27k|                              yaml::skip_comment(value_line, end);
 5119|  3.27k|                              probe = value_line;
 5120|  3.27k|                              continue; // comment-only line
 5121|  3.27k|                           }
 5122|  32.1k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 9.41k, False: 22.7k]
  |  Branch (5122:54): [True: 6.01k, False: 3.40k]
  ------------------
 5123|  6.01k|                              it = value_line;
 5124|  6.01k|                              found_value_indicator = true;
 5125|  6.01k|                           }
 5126|  32.1k|                           break;
 5127|  35.4k|                        }
 5128|       |
 5129|  46.9k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 6.01k, False: 40.9k]
  ------------------
 5130|  6.01k|                           yaml::skip_inline_ws(it, end);
 5131|  6.01k|                        }
 5132|  46.9k|                     }
 5133|       |
 5134|   258k|                     val_t val{};
 5135|   258k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 215k, False: 43.7k]
  |  Branch (5135:39): [True: 165k, False: 49.2k]
  ------------------
 5136|   165k|                        ++it;
 5137|   165k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 165k, False: 292]
  |  Branch (5137:42): [True: 5, False: 165k]
  ------------------
 5138|      5|                           ctx.error = error_code::syntax_error;
 5139|      5|                           return false;
 5140|      5|                        }
 5141|   165k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 165k, False: 292]
  |  Branch (5141:43): [True: 2.09k, False: 163k]
  |  Branch (5141:58): [True: 132k, False: 31.4k]
  ------------------
 5142|   134k|                           auto probe = it;
 5143|   134k|                           yaml::skip_newline(probe, end);
 5144|   176k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 175k, False: 1.45k]
  |  Branch (5144:51): [True: 42.4k, False: 132k]
  ------------------
 5145|   134k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 132k, False: 1.45k]
  |  Branch (5145:48): [True: 41.3k, False: 91.3k]
  |  Branch (5145:65): [True: 41.2k, False: 103]
  |  Branch (5145:89): [True: 2, False: 41.2k]
  ------------------
 5146|      2|                              ctx.error = error_code::syntax_error;
 5147|      2|                              return false;
 5148|      2|                           }
 5149|   134k|                        }
 5150|   165k|                        yaml::skip_inline_ws(it, end);
 5151|   165k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 343, False: 165k]
  ------------------
 5152|    343|                           return false;
 5153|   165k|                     }
 5154|       |
 5155|   258k|                     value.emplace(std::move(key), std::move(val));
 5156|   258k|                     return true;
 5157|   258k|                  }
 5158|       |
 5159|   381k|                  key_t key{};
 5160|   381k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   381k|                     auto key_probe = it;
 5162|   381k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   381k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 381k, False: 0]
  |  Branch (5163:74): [True: 1.52k, False: 380k]
  |  Branch (5163:95): [True: 738, False: 379k]
  ------------------
 5164|   381k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 2.26k, False: 379k]
  ------------------
 5165|  2.26k|                        glz::generic key_node{};
 5166|  2.26k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  2.26k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 599, False: 1.66k]
  ------------------
 5168|    599|                           return false;
 5169|  1.66k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 2, False: 1.66k]
  ------------------
 5170|      2|                           return false;
 5171|  1.66k|                     }
 5172|   379k|                     else {
 5173|   379k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 1.88k, False: 377k]
  ------------------
 5174|  1.88k|                           return false;
 5175|  1.88k|                        }
 5176|   379k|                     }
 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|   379k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   381k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 3.31k, False: 378k]
  |  Branch (5186:36): [True: 846, False: 377k]
  ------------------
 5187|  1.67k|                     ctx.error = error_code::syntax_error;
 5188|  1.67k|                     return false;
 5189|  1.67k|                  }
 5190|   379k|                  ++it;
 5191|   379k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   379k|                  val_t val{};
 5194|   379k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 16.7k, False: 363k]
  ------------------
 5195|  16.7k|                     return false;
 5196|       |
 5197|   363k|                  value.emplace(std::move(key), std::move(val));
 5198|   363k|                  return true;
 5199|   379k|               });
_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|   258k|                        const bool key_content_spans_lines = [&] {
 5021|   258k|                           auto scan = key_it;
 5022|   265k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 224k, False: 41.6k]
  |  Branch (5022:54): [True: 224k, False: 0]
  ------------------
 5023|   224k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 39.0k, False: 185k]
  |  Branch (5023:52): [True: 178k, False: 7.02k]
  ------------------
 5024|  7.02k|                              ++scan;
 5025|  7.02k|                           }
 5026|  41.6k|                           return false;
 5027|   258k|                        }();
_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|   109k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   109k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   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_E_clESS_:
 4883|   543k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   543k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 534k, False: 9.25k]
  |  Branch (4884:39): [True: 264k, False: 269k]
  ------------------
 4885|   264k|                        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|   264k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   264k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 264k, False: 0]
  ------------------
 4893|   264k|                              auto is_line_content_start = [&](auto pos) {
 4894|   264k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   264k|                              };
 4896|       |
 4897|   264k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   264k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   264k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   264k|                                 return line != end && *line == ':';
 4901|   264k|                              };
 4902|       |
 4903|   264k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 264k, False: 0]
  ------------------
 4904|   264k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 43.3k, False: 221k]
  ------------------
 4905|  43.3k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 390, False: 42.9k]
  ------------------
 4906|    390|                                 ctx.error = error_code::syntax_error;
 4907|    390|                                 return false;
 4908|    390|                              }
 4909|   264k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   264k|                           }
 4911|   264k|                        }
 4912|       |
 4913|   264k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 4.26k, False: 260k]
  ------------------
 4914|  4.26k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 280, False: 3.98k]
  |  Branch (4914:49): [True: 658, False: 3.33k]
  ------------------
 4915|    938|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 14, False: 924]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     14|                           ctx.error = error_code::syntax_error;
 4918|     14|                           return false;
 4919|     14|                        }
 4920|       |
 4921|   264k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 264k]
  ------------------
 4922|      0|                           return false;
 4923|   264k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   264k|                        ctx.pop_indent();
 4925|   264k|                     }
 4926|   278k|                     else {
 4927|   278k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   278k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 40.3k, False: 238k]
  ------------------
 4929|  40.3k|                           yaml::skip_to_content(it, end);
 4930|  40.3k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 40.3k, False: 0]
  |  Branch (4930:45): [True: 0, False: 40.3k]
  |  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|  40.3k|                           const int32_t value_indent =
 4937|  40.3k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 40.3k]
  ------------------
 4938|  40.3k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 40.3k]
  ------------------
 4939|      0|                              return false;
 4940|  40.3k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  40.3k|                           ctx.pop_indent();
 4942|  40.3k|                        }
 4943|   278k|                     }
 4944|   543k|                     return !bool(ctx.error);
 4945|   543k|                  };
_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|   264k|                              auto is_line_content_start = [&](auto pos) {
 4894|   264k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   264k|                              };
_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|   307k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   307k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   985k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 985k, False: 0]
  |  Branch (4899:57): [True: 677k, False: 308k]
  |  Branch (4899:73): [True: 576, False: 307k]
  ------------------
 4900|   307k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 307k, False: 0]
  |  Branch (4900:56): [True: 219k, False: 88.5k]
  ------------------
 4901|   307k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|   302k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   302k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 302k]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|   302k|            }
_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|  82.7k|      {
 6718|  82.7k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|  82.7k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 3, False: 82.6k]
  ------------------
 6720|      3|            return;
 6721|  82.6k|         op<Opts>(value, ctx, it, end);
 6722|  82.6k|      }
_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|  88.0k|      {
  301|  88.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 88.0k]
  |  Branch (301:27): [True: 0, False: 88.0k]
  ------------------
  302|       |
  303|  88.0k|         ++it; // skip '*'
  304|  88.0k|         auto name = parse_anchor_name(it, end);
  305|  88.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 201, False: 87.8k]
  ------------------
  306|    201|            ctx.error = error_code::syntax_error;
  307|    201|            return true;
  308|    201|         }
  309|       |
  310|  87.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  87.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 465, False: 87.4k]
  ------------------
  312|    465|            ctx.error = error_code::syntax_error; // undefined alias
  313|    465|            return true;
  314|    465|         }
  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|  87.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  87.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.83k, False: 85.5k]
  ------------------
  322|  1.83k|            return true;
  323|  1.83k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  85.5k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 52, False: 85.5k]
  ------------------
  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|  85.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  85.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 85.5k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  85.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 8, False: 85.5k]
  ------------------
  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|  85.5k|         auto replay_it = span.begin;
  348|  85.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  85.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  85.5k|         ctx.indent_stack.clear();
  353|  85.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 51.3k, False: 34.1k]
  ------------------
  354|  51.3k|            ctx.push_indent(span.base_indent - 1);
  355|  51.3k|         }
  356|       |
  357|  85.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  85.5k|         using V = std::remove_cvref_t<T>;
  360|  85.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  85.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  85.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  85.5k|         return true;
  367|  85.5k|      }
_ZN3glz4yaml15skip_to_contentIPKcS3_EEvRT_T0_:
 3637|  3.65M|      {
 3638|  6.72M|         while (it != end) {
  ------------------
  |  Branch (3638:17): [True: 6.59M, False: 127k]
  ------------------
 3639|  6.59M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3639:17): [True: 1.20M, False: 5.38M]
  |  Branch (3639:32): [True: 1.67M, False: 3.71M]
  ------------------
 3640|  2.88M|               skip_newline(it, end);
 3641|  2.88M|            }
 3642|  3.71M|            else if (*it == '#') {
  ------------------
  |  Branch (3642:22): [True: 71.7k, False: 3.64M]
  ------------------
 3643|  71.7k|               skip_comment(it, end);
 3644|  71.7k|            }
 3645|  3.64M|            else if (*it == ' ') {
  ------------------
  |  Branch (3645:22): [True: 1.01M, False: 2.62M]
  ------------------
 3646|  1.01M|               auto line_start = it;
 3647|  6.29M|               while (it != end && *it == ' ') ++it;
  ------------------
  |  Branch (3647:23): [True: 6.28M, False: 13.0k]
  |  Branch (3647:36): [True: 5.28M, False: 1.00M]
  ------------------
 3648|  1.01M|               if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3648:20): [True: 13.0k, False: 1.00M]
  |  Branch (3648:33): [True: 28.2k, False: 972k]
  |  Branch (3648:48): [True: 25.4k, False: 946k]
  ------------------
 3649|  66.8k|                  continue; // blank line with trailing spaces
 3650|  66.8k|               }
 3651|   946k|               if (*it == '#') {
  ------------------
  |  Branch (3651:20): [True: 47.6k, False: 898k]
  ------------------
 3652|  47.6k|                  skip_comment(it, end);
 3653|  47.6k|                  continue; // comment-only line
 3654|  47.6k|               }
 3655|   898k|               it = line_start; // content found, restore to start of indent
 3656|   898k|               return;
 3657|   946k|            }
 3658|  2.62M|            else {
 3659|  2.62M|               return; // content at column 0
 3660|  2.62M|            }
 3661|  6.59M|         }
 3662|  3.65M|      }
_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|   127k|      {
 5311|   127k|         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|   127k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   127k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   127k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   127k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 127k, False: 0]
  ------------------
 5321|   127k|            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|   127k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   131k|      {
 1961|   131k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 8.64k, False: 123k]
  ------------------
 1962|  8.64k|            return;
 1963|       |
 1964|   123k|         yaml::node_preamble_state preamble{};
 1965|   123k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 4.37k, False: 118k]
  ------------------
 1966|   123k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  4.37k|            return;
 1968|       |
 1969|   118k|         std::string str;
 1970|   118k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   118k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 118k, False: 0]
  ------------------
 1973|    772|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 772, False: 117k]
  ------------------
 1974|    772|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|    772|            break;
 1976|    682|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 682, False: 117k]
  ------------------
 1977|    682|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|    682|            break;
 1979|    368|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 368, False: 118k]
  ------------------
 1980|  1.46k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 1.10k, False: 117k]
  ------------------
 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.46k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  1.46k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 612, False: 856]
  ------------------
 1986|  1.46k|            break;
 1987|   115k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 115k, False: 2.92k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   115k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   115k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 93.6k, False: 22.0k]
  ------------------
 1992|  93.6k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|  93.6k|               }
 1994|  22.0k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|  22.0k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|  22.0k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   115k|            break;
 2003|   118k|         }
 2004|       |
 2005|   118k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 117k, False: 1.11k]
  ------------------
 2006|   117k|            value = std::move(str);
 2007|   117k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   117k|         }
 2009|   118k|      }
_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|   123k|      {
  466|   123k|         skip_inline_ws(it, end);
  467|       |
  468|   123k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 17, False: 122k]
  ------------------
  469|     17|            if constexpr (!AllowEmptyInput) {
  470|     17|               ctx.error = error_code::unexpected_end;
  471|     17|            }
  472|     17|            return true;
  473|     17|         }
  474|       |
  475|   122k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   122k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 11, False: 122k]
  ------------------
  477|     11|            ctx.error = error_code::syntax_error;
  478|     11|            return true;
  479|     11|         }
  480|   122k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 4, False: 122k]
  ------------------
  481|      4|            ctx.error = error_code::syntax_error;
  482|      4|            return true;
  483|      4|         }
  484|       |
  485|   122k|         skip_inline_ws(it, end);
  486|       |
  487|   122k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 122k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   122k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.33k, False: 118k]
  ------------------
  495|  4.33k|            return true;
  496|  4.33k|         }
  497|       |
  498|   118k|         return false;
  499|   122k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   122k|                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|   122k|      {
  409|   122k|         state.has_anchor = false;
  410|   122k|         state.anchor_name.clear();
  411|   122k|         state.anchor_start = nullptr;
  412|   122k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   122k|         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|   122k|            else {
  421|   122k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.27k, False: 118k]
  ------------------
  422|   122k|            }
  423|   122k|         }
  424|       |
  425|   122k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 118k, False: 4.27k]
  |  Branch (425:27): [True: 5.84k, False: 112k]
  ------------------
  426|  5.84k|            ++it;
  427|  5.84k|            auto name = parse_anchor_name(it, end);
  428|  5.84k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 15, False: 5.82k]
  ------------------
  429|     15|               ctx.error = error_code::syntax_error;
  430|     15|               return true;
  431|     15|            }
  432|  5.82k|            skip_inline_ws(it, end);
  433|  5.82k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 48, False: 5.77k]
  ------------------
  434|     48|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     48|                  ctx.error = error_code::unexpected_end;
  436|     48|               }
  437|     48|               return true;
  438|     48|            }
  439|  5.77k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  5.77k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 2, False: 5.77k]
  ------------------
  441|      2|                  ctx.error = error_code::syntax_error;
  442|      2|                  return true;
  443|      2|               }
  444|  5.77k|            }
  445|  5.77k|            state.has_anchor = true;
  446|  5.77k|            state.anchor_name = std::string(name);
  447|  5.77k|            state.anchor_start = &*it;
  448|  5.77k|         }
  449|       |
  450|   122k|         return false;
  451|   122k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   122k|      {
  301|   122k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 122k]
  |  Branch (301:27): [True: 118k, False: 4.27k]
  ------------------
  302|       |
  303|  4.27k|         ++it; // skip '*'
  304|  4.27k|         auto name = parse_anchor_name(it, end);
  305|  4.27k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 11, False: 4.26k]
  ------------------
  306|     11|            ctx.error = error_code::syntax_error;
  307|     11|            return true;
  308|     11|         }
  309|       |
  310|  4.26k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.26k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 21, False: 4.24k]
  ------------------
  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|  4.24k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  4.24k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 522, False: 3.71k]
  ------------------
  322|    522|            return true;
  323|    522|         }
  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.71k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 17, False: 3.70k]
  ------------------
  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.70k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.70k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 3.69k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  3.69k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.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|  3.69k|         auto replay_it = span.begin;
  348|  3.69k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.69k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.69k|         ctx.indent_stack.clear();
  353|  3.69k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.01k, False: 683]
  ------------------
  354|  3.01k|            ctx.push_indent(span.base_indent - 1);
  355|  3.01k|         }
  356|       |
  357|  3.69k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.69k|         using V = std::remove_cvref_t<T>;
  360|  3.69k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.69k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.69k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.69k|         return true;
  367|  3.69k|      }
_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|  30.4k|      {
 5311|  30.4k|         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|  30.4k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  30.4k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  30.4k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  30.4k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 30.4k, False: 0]
  ------------------
 5321|  30.4k|            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|  30.4k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|  32.0k|      {
 2116|  32.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 32.0k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  32.0k|         yaml::node_preamble_state preamble{};
 2120|  32.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 5.18k, False: 26.8k]
  ------------------
 2121|  32.0k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  32.0k|                   return yaml::tag_valid_for_float(tag);
 2123|  32.0k|                }
 2124|  32.0k|                else {
 2125|  32.0k|                   return yaml::tag_valid_for_int(tag);
 2126|  32.0k|                }
 2127|  32.0k|             }))
 2128|  5.18k|            return;
 2129|       |
 2130|  26.8k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  26.8k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  26.8k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  26.8k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 8.18k, False: 18.6k]
  ------------------
 2138|  8.18k|               ++it;
 2139|  8.18k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 7.72k, False: 458]
  |  Branch (2139:38): [True: 932, False: 6.79k]
  |  Branch (2139:74): [True: 259, False: 6.53k]
  ------------------
 2140|  6.53k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 289, False: 6.24k]
  ------------------
 2141|  1.48k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  1.48k|                  it += 3;
 2143|  1.48k|                  finalize();
 2144|  1.48k|                  return;
 2145|  1.48k|               }
 2146|  6.70k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 6.24k, False: 458]
  |  Branch (2146:38): [True: 1.57k, False: 4.67k]
  |  Branch (2146:74): [True: 218, False: 4.45k]
  ------------------
 2147|  4.45k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 259, False: 4.19k]
  ------------------
 2148|  2.04k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  2.04k|                  it += 3;
 2150|  2.04k|                  finalize();
 2151|  2.04k|                  return;
 2152|  2.04k|               }
 2153|  4.65k|               it = start;
 2154|  4.65k|            }
 2155|       |
 2156|  23.3k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 2.15k, False: 21.2k]
  |  Branch (2156:31): [True: 3.52k, False: 17.6k]
  ------------------
 2157|  5.67k|               const char sign = *it;
 2158|  5.67k|               ++it;
 2159|  5.67k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 5.39k, False: 286]
  |  Branch (2159:33): [True: 1.84k, False: 3.54k]
  ------------------
 2160|  1.84k|                  ++it;
 2161|  1.84k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 1.44k, False: 401]
  |  Branch (2161:41): [True: 334, False: 1.11k]
  |  Branch (2161:77): [True: 422, False: 690]
  ------------------
 2162|    884|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 128, False: 562]
  ------------------
 2163|    884|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 438, False: 446]
  ------------------
 2164|    438|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|    438|                     }
 2166|    446|                     else {
 2167|    446|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    446|                     }
 2169|    884|                     it += 3;
 2170|    884|                     finalize();
 2171|    884|                     return;
 2172|    884|                  }
 2173|  1.84k|               }
 2174|  4.79k|               it = start;
 2175|  4.79k|            }
 2176|  23.3k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  22.4k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  24.2M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 24.2M, False: 8.44k]
  ------------------
 2183|  24.2M|            const char c = *it;
 2184|  24.2M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 5.47k, False: 24.2M]
  |  Branch (2184:29): [True: 1.00k, False: 24.2M]
  |  Branch (2184:42): [True: 2.13k, False: 24.2M]
  |  Branch (2184:55): [True: 1.67k, False: 24.2M]
  |  Branch (2184:68): [True: 1.39k, False: 24.2M]
  |  Branch (2184:80): [True: 620, False: 24.2M]
  |  Branch (2184:92): [True: 562, False: 24.2M]
  |  Branch (2184:104): [True: 2.22k, False: 24.2M]
  ------------------
 2185|  15.0k|               break;
 2186|  15.0k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  24.2M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 9.77k, False: 24.2M]
  ------------------
 2189|  9.77k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 514, False: 9.26k]
  |  Branch (2189:39): [True: 1.92k, False: 7.33k]
  |  Branch (2189:59): [True: 113, False: 7.21k]
  |  Branch (2189:80): [True: 490, False: 6.72k]
  |  Branch (2189:101): [True: 314, False: 6.41k]
  ------------------
 2190|  3.36k|                  break;
 2191|  3.36k|               }
 2192|  9.77k|            }
 2193|  24.2M|            ++it;
 2194|  24.2M|         }
 2195|       |
 2196|  26.8k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  26.8k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 1.56k, False: 25.3k]
  ------------------
 2199|  1.56k|            ctx.error = error_code::parse_number_failure;
 2200|  1.56k|            return;
 2201|  1.56k|         }
 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|  25.3k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  25.3k|            bool negative = false;
 2254|  25.3k|            std::string_view digits = num_str;
 2255|       |
 2256|  25.3k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 20.9k, False: 4.41k]
  |  Branch (2256:37): [True: 3.07k, False: 17.8k]
  |  Branch (2256:62): [True: 1.71k, False: 16.1k]
  ------------------
 2257|  4.79k|               negative = (digits.front() == '-');
 2258|  4.79k|               digits.remove_prefix(1);
 2259|  4.79k|            }
 2260|       |
 2261|  25.3k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 13.9k, False: 11.4k]
  |  Branch (2261:38): [True: 4.65k, False: 9.25k]
  ------------------
 2262|  4.65k|               int base = 10;
 2263|  4.65k|               size_t offset = 0;
 2264|       |
 2265|  4.65k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 1.60k, False: 3.05k]
  |  Branch (2265:40): [True: 307, False: 2.75k]
  ------------------
 2266|  1.90k|                  base = 16;
 2267|  1.90k|                  offset = 2;
 2268|  1.90k|               }
 2269|  2.75k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 311, False: 2.44k]
  |  Branch (2269:45): [True: 327, False: 2.11k]
  ------------------
 2270|    638|                  base = 8;
 2271|    638|                  offset = 2;
 2272|    638|               }
 2273|  2.11k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 271, False: 1.84k]
  |  Branch (2273:45): [True: 102, False: 1.74k]
  ------------------
 2274|    373|                  base = 2;
 2275|    373|                  offset = 2;
 2276|    373|               }
 2277|       |
 2278|  4.65k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 2.91k, False: 1.74k]
  ------------------
 2279|  2.91k|                  auto raw_digits = digits.substr(offset);
 2280|  2.91k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  2.91k|                  std::string clean_storage;
 2283|  2.91k|                  std::string_view clean_view;
 2284|  2.91k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 955, False: 1.96k]
  ------------------
 2285|    955|                     clean_storage.reserve(raw_digits.size());
 2286|  2.35M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 2.35M, False: 955]
  ------------------
 2287|  2.35M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 2.34M, False: 1.90k]
  ------------------
 2288|  2.34M|                           clean_storage.push_back(c);
 2289|  2.34M|                        }
 2290|  2.35M|                     }
 2291|    955|                     clean_view = clean_storage;
 2292|    955|                  }
 2293|  1.96k|                  else {
 2294|  1.96k|                     clean_view = raw_digits;
 2295|  1.96k|                  }
 2296|       |
 2297|  2.91k|                  uint64_t parsed_int{};
 2298|  2.91k|                  auto [ptr, ec] =
 2299|  2.91k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  2.91k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 1.46k, False: 1.45k]
  |  Branch (2300:44): [True: 810, False: 641]
  ------------------
 2301|  2.27k|                     ctx.error = error_code::parse_number_failure;
 2302|  2.27k|                     finalize();
 2303|  2.27k|                     return;
 2304|  2.27k|                  }
 2305|       |
 2306|    641|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|    641|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 286, False: 355]
  ------------------
 2308|    641|                  finalize();
 2309|    641|                  return;
 2310|  2.91k|               }
 2311|  4.65k|            }
 2312|  25.3k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  22.3k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  25.3k|         std::string clean_storage;
 2318|  25.3k|         std::string_view clean_view;
 2319|       |
 2320|  25.3k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 1.75k, False: 23.5k]
  ------------------
 2321|  1.75k|            clean_storage.reserve(num_str.size());
 2322|  11.6M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 11.6M, False: 1.75k]
  ------------------
 2323|  11.6M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 11.6M, False: 6.56k]
  ------------------
 2324|  11.6M|                  clean_storage.push_back(c);
 2325|  11.6M|               }
 2326|  11.6M|            }
 2327|  1.75k|            clean_view = clean_storage;
 2328|  1.75k|         }
 2329|  23.5k|         else {
 2330|  23.5k|            clean_view = num_str;
 2331|  23.5k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  25.3k|         auto parse_view = clean_view;
 2336|  25.3k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 17.8k, False: 7.45k]
  |  Branch (2336:37): [True: 3.07k, False: 14.7k]
  ------------------
 2337|  3.07k|            parse_view.remove_prefix(1);
 2338|  3.07k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 907, False: 2.17k]
  ------------------
 2339|    907|               ctx.error = error_code::parse_number_failure;
 2340|    907|               return;
 2341|    907|            }
 2342|  3.07k|         }
 2343|       |
 2344|  24.4k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  24.4k|            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|  24.4k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 16.4k, False: 7.96k]
  |  Branch (2347:45): [True: 4.22k, False: 3.73k]
  ------------------
 2348|  13.3k|               ctx.error = error_code::parse_number_failure;
 2349|  13.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|  24.4k|         finalize();
 2360|  24.4k|      }
_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|  32.0k|      {
  466|  32.0k|         skip_inline_ws(it, end);
  467|       |
  468|  32.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 291, False: 31.7k]
  ------------------
  469|    291|            if constexpr (!AllowEmptyInput) {
  470|    291|               ctx.error = error_code::unexpected_end;
  471|    291|            }
  472|    291|            return true;
  473|    291|         }
  474|       |
  475|  31.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  31.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 374, False: 31.4k]
  ------------------
  477|    374|            ctx.error = error_code::syntax_error;
  478|    374|            return true;
  479|    374|         }
  480|  31.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 214, False: 31.1k]
  ------------------
  481|    214|            ctx.error = error_code::syntax_error;
  482|    214|            return true;
  483|    214|         }
  484|       |
  485|  31.1k|         skip_inline_ws(it, end);
  486|       |
  487|  31.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 192, False: 30.9k]
  ------------------
  488|    192|            if constexpr (!AllowEmptyInput) {
  489|    192|               ctx.error = error_code::unexpected_end;
  490|    192|            }
  491|    192|            return true;
  492|    192|         }
  493|       |
  494|  30.9k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.11k, False: 26.8k]
  ------------------
  495|  4.11k|            return true;
  496|  4.11k|         }
  497|       |
  498|  26.8k|         return false;
  499|  30.9k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|  31.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  31.4k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  31.4k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  31.4k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  30.9k|      {
  409|  30.9k|         state.has_anchor = false;
  410|  30.9k|         state.anchor_name.clear();
  411|  30.9k|         state.anchor_start = nullptr;
  412|  30.9k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  30.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|  30.9k|            else {
  421|  30.9k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.53k, False: 27.4k]
  ------------------
  422|  30.9k|            }
  423|  30.9k|         }
  424|       |
  425|  30.9k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 27.4k, False: 3.53k]
  |  Branch (425:27): [True: 2.97k, False: 24.4k]
  ------------------
  426|  2.97k|            ++it;
  427|  2.97k|            auto name = parse_anchor_name(it, end);
  428|  2.97k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 332, False: 2.64k]
  ------------------
  429|    332|               ctx.error = error_code::syntax_error;
  430|    332|               return true;
  431|    332|            }
  432|  2.64k|            skip_inline_ws(it, end);
  433|  2.64k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 248, False: 2.39k]
  ------------------
  434|    248|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    248|                  ctx.error = error_code::unexpected_end;
  436|    248|               }
  437|    248|               return true;
  438|    248|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  2.39k|            state.has_anchor = true;
  446|  2.39k|            state.anchor_name = std::string(name);
  447|  2.39k|            state.anchor_start = &*it;
  448|  2.39k|         }
  449|       |
  450|  30.4k|         return false;
  451|  30.9k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  30.9k|      {
  301|  30.9k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 30.9k]
  |  Branch (301:27): [True: 27.4k, False: 3.53k]
  ------------------
  302|       |
  303|  3.53k|         ++it; // skip '*'
  304|  3.53k|         auto name = parse_anchor_name(it, end);
  305|  3.53k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 402, False: 3.13k]
  ------------------
  306|    402|            ctx.error = error_code::syntax_error;
  307|    402|            return true;
  308|    402|         }
  309|       |
  310|  3.13k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.13k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 965, False: 2.16k]
  ------------------
  312|    965|            ctx.error = error_code::syntax_error; // undefined alias
  313|    965|            return true;
  314|    965|         }
  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.16k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.16k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 397, False: 1.76k]
  ------------------
  322|    397|            return true;
  323|    397|         }
  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.76k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 149, False: 1.61k]
  ------------------
  329|    149|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    149|            return true;
  331|    149|         }
  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.61k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.61k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 1.61k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  1.61k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.61k]
  ------------------
  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.61k|         auto replay_it = span.begin;
  348|  1.61k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.61k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.61k|         ctx.indent_stack.clear();
  353|  1.61k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 612, False: 1.00k]
  ------------------
  354|    612|            ctx.push_indent(span.base_indent - 1);
  355|    612|         }
  356|       |
  357|  1.61k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.61k|         using V = std::remove_cvref_t<T>;
  360|  1.61k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.61k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.61k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.61k|         return true;
  367|  1.61k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  24.4k|         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.1k|      {
 5311|  21.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|  21.1k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  21.1k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  21.1k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  21.1k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 21.1k, False: 0]
  ------------------
 5321|  21.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|  21.1k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  25.2k|      {
 2081|  25.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 25.2k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  25.2k|         yaml::node_preamble_state preamble{};
 2085|  25.2k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 5.14k, False: 20.1k]
  ------------------
 2086|  25.2k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  5.14k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  20.1k|         std::string str;
 2091|  20.1k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  20.1k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 7.67k, False: 12.4k]
  |  Branch (2093:31): [True: 1.86k, False: 10.5k]
  |  Branch (2093:48): [True: 658, False: 9.91k]
  |  Branch (2093:65): [True: 265, False: 9.64k]
  |  Branch (2093:81): [True: 370, False: 9.27k]
  |  Branch (2093:97): [True: 325, False: 8.95k]
  ------------------
 2094|  11.8k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 265, False: 8.68k]
  |  Branch (2094:29): [True: 167, False: 8.51k]
  |  Branch (2094:44): [True: 307, False: 8.21k]
  ------------------
 2095|  11.8k|            value = true;
 2096|  11.8k|         }
 2097|  8.21k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 1.33k, False: 6.88k]
  |  Branch (2097:37): [True: 3.90k, False: 2.97k]
  |  Branch (2097:55): [True: 527, False: 2.44k]
  |  Branch (2097:73): [True: 310, False: 2.13k]
  |  Branch (2097:88): [True: 987, False: 1.14k]
  |  Branch (2097:103): [True: 231, False: 918]
  ------------------
 2098|  8.04k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 243, False: 675]
  |  Branch (2098:35): [True: 253, False: 422]
  |  Branch (2098:51): [True: 256, False: 166]
  ------------------
 2099|  8.04k|            value = false;
 2100|  8.04k|         }
 2101|    166|         else {
 2102|    166|            ctx.error = error_code::expected_true_or_false;
 2103|    166|         }
 2104|       |
 2105|  20.1k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  20.1k|      }
_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|  25.2k|      {
  466|  25.2k|         skip_inline_ws(it, end);
  467|       |
  468|  25.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 25.2k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|  25.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  25.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 25.2k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  25.2k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 25.2k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  25.2k|         skip_inline_ws(it, end);
  486|       |
  487|  25.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 25.2k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  25.2k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.12k, False: 20.1k]
  ------------------
  495|  5.12k|            return true;
  496|  5.12k|         }
  497|       |
  498|  20.1k|         return false;
  499|  25.2k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  25.2k|                                             [](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|  25.2k|      {
  409|  25.2k|         state.has_anchor = false;
  410|  25.2k|         state.anchor_name.clear();
  411|  25.2k|         state.anchor_start = nullptr;
  412|  25.2k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  25.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|  25.2k|            else {
  421|  25.2k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.09k, False: 20.1k]
  ------------------
  422|  25.2k|            }
  423|  25.2k|         }
  424|       |
  425|  25.2k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 20.1k, False: 5.09k]
  |  Branch (425:27): [True: 1.45k, False: 18.6k]
  ------------------
  426|  1.45k|            ++it;
  427|  1.45k|            auto name = parse_anchor_name(it, end);
  428|  1.45k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 1.45k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  1.45k|            skip_inline_ws(it, end);
  433|  1.45k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 21, False: 1.43k]
  ------------------
  434|     21|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     21|                  ctx.error = error_code::unexpected_end;
  436|     21|               }
  437|     21|               return true;
  438|     21|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.43k|            state.has_anchor = true;
  446|  1.43k|            state.anchor_name = std::string(name);
  447|  1.43k|            state.anchor_start = &*it;
  448|  1.43k|         }
  449|       |
  450|  25.2k|         return false;
  451|  25.2k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  25.2k|      {
  301|  25.2k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 25.2k]
  |  Branch (301:27): [True: 20.1k, False: 5.09k]
  ------------------
  302|       |
  303|  5.09k|         ++it; // skip '*'
  304|  5.09k|         auto name = parse_anchor_name(it, end);
  305|  5.09k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 13, False: 5.08k]
  ------------------
  306|     13|            ctx.error = error_code::syntax_error;
  307|     13|            return true;
  308|     13|         }
  309|       |
  310|  5.08k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.08k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 27, False: 5.05k]
  ------------------
  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.05k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.05k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 929, False: 4.12k]
  ------------------
  322|    929|            return true;
  323|    929|         }
  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.12k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 4.12k]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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.12k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.12k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.12k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.12k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.12k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.12k|         auto replay_it = span.begin;
  348|  4.12k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.12k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.12k|         ctx.indent_stack.clear();
  353|  4.12k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.49k, False: 2.62k]
  ------------------
  354|  1.49k|            ctx.push_indent(span.base_indent - 1);
  355|  1.49k|         }
  356|       |
  357|  4.12k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.12k|         using V = std::remove_cvref_t<T>;
  360|  4.12k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.12k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.12k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.12k|         return true;
  367|  4.12k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  12.1k|      {
 2467|  12.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 12.1k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  12.1k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  12.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 14, False: 12.1k]
  ------------------
 2473|     14|            ctx.error = error_code::unexpected_end;
 2474|     14|            return;
 2475|     14|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  12.1k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 1.37k, False: 10.7k]
  ------------------
 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|  10.7k|         auto start = it;
 2485|  52.8k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 52.4k, False: 425]
  |  Branch (2485:30): [True: 42.1k, False: 10.3k]
  ------------------
 2486|  42.1k|            ++it;
 2487|  42.1k|         }
 2488|       |
 2489|  10.7k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  10.7k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 23, False: 10.7k]
  ------------------
 2491|     23|            ctx.error = error_code::syntax_error;
 2492|     23|         }
 2493|  10.7k|      }
_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|  70.5k|      {
 5311|  70.5k|         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|  70.5k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  70.5k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  70.5k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  70.5k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 70.5k, False: 0]
  ------------------
 5321|  70.5k|            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|  70.5k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4182|  73.3k|      {
 4183|  73.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 73.3k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|  73.3k|         auto peek = it;
 4188|  73.3k|         yaml::node_preamble_state preamble{};
 4189|  73.3k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 3.67k, False: 69.6k]
  ------------------
 4190|  73.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  3.67k|            it = peek;
 4192|  3.67k|            return;
 4193|  3.67k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|  69.6k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|  69.6k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 3, False: 69.6k]
  ------------------
 4198|      3|            return;
 4199|       |
 4200|  69.6k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 29.1k, False: 40.4k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  29.1k|            it = peek;
 4203|  29.1k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  29.1k|         }
 4205|  40.4k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 40.3k, False: 93]
  ------------------
 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|  40.3k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 302, False: 40.0k]
  |  Branch (4208:57): [True: 756, False: 39.3k]
  ------------------
 4209|  1.05k|               it = peek;
 4210|  1.05k|            }
 4211|  40.3k|            int32_t seq_indent = ctx.current_indent();
 4212|  40.3k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 40.0k, False: 264]
  |  Branch (4212:31): [True: 28.6k, False: 11.4k]
  ------------------
 4213|  28.6k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 11.8k, False: 16.7k]
  |  Branch (4213:62): [True: 6.56k, False: 5.33k]
  ------------------
 4214|  28.6k|                                                          : (ctx.current_indent() + 1);
 4215|  28.6k|            }
 4216|  40.3k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|  40.3k|         }
 4218|     93|         else {
 4219|     93|            ctx.error = error_code::syntax_error;
 4220|     93|         }
 4221|       |
 4222|  69.6k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|  69.6k|      }
_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|  73.3k|      {
  466|  73.3k|         skip_inline_ws(it, end);
  467|       |
  468|  73.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 13, False: 73.3k]
  ------------------
  469|     13|            if constexpr (!AllowEmptyInput) {
  470|     13|               ctx.error = error_code::unexpected_end;
  471|     13|            }
  472|     13|            return true;
  473|     13|         }
  474|       |
  475|  73.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  73.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 73.3k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  73.3k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 73.3k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  73.3k|         skip_inline_ws(it, end);
  486|       |
  487|  73.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 5, False: 73.3k]
  ------------------
  488|      5|            if constexpr (!AllowEmptyInput) {
  489|      5|               ctx.error = error_code::unexpected_end;
  490|      5|            }
  491|      5|            return true;
  492|      5|         }
  493|       |
  494|  73.3k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.65k, False: 69.6k]
  ------------------
  495|  3.65k|            return true;
  496|  3.65k|         }
  497|       |
  498|  69.6k|         return false;
  499|  73.3k|      }
_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|  73.3k|                                             [](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|  73.3k|      {
  409|  73.3k|         state.has_anchor = false;
  410|  73.3k|         state.anchor_name.clear();
  411|  73.3k|         state.anchor_start = nullptr;
  412|  73.3k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  73.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|  73.3k|            else {
  421|  73.3k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.61k, False: 69.6k]
  ------------------
  422|  73.3k|            }
  423|  73.3k|         }
  424|       |
  425|  73.3k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 69.6k, False: 3.61k]
  |  Branch (425:27): [True: 1.11k, False: 68.5k]
  ------------------
  426|  1.11k|            ++it;
  427|  1.11k|            auto name = parse_anchor_name(it, end);
  428|  1.11k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 9, False: 1.10k]
  ------------------
  429|      9|               ctx.error = error_code::syntax_error;
  430|      9|               return true;
  431|      9|            }
  432|  1.10k|            skip_inline_ws(it, end);
  433|  1.10k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 27, False: 1.08k]
  ------------------
  434|     27|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     27|                  ctx.error = error_code::unexpected_end;
  436|     27|               }
  437|     27|               return true;
  438|     27|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.08k|            state.has_anchor = true;
  446|  1.08k|            state.anchor_name = std::string(name);
  447|  1.08k|            state.anchor_start = &*it;
  448|  1.08k|         }
  449|       |
  450|  73.2k|         return false;
  451|  73.3k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  73.3k|      {
  301|  73.3k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 73.3k]
  |  Branch (301:27): [True: 69.6k, False: 3.61k]
  ------------------
  302|       |
  303|  3.61k|         ++it; // skip '*'
  304|  3.61k|         auto name = parse_anchor_name(it, end);
  305|  3.61k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 3.60k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  3.60k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.60k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 17, False: 3.59k]
  ------------------
  312|     17|            ctx.error = error_code::syntax_error; // undefined alias
  313|     17|            return true;
  314|     17|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.59k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.59k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 831, False: 2.76k]
  ------------------
  322|    831|            return true;
  323|    831|         }
  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.76k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 2.73k]
  ------------------
  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|  2.73k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.73k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.73k]
  ------------------
  339|      1|            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.75k, False: 982]
  ------------------
  354|  1.75k|            ctx.push_indent(span.base_indent - 1);
  355|  1.75k|         }
  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|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  29.1k|      {
 2665|  29.1k|         using V = std::remove_cvref_t<T>;
 2666|  29.1k|         using value_type = typename V::value_type;
 2667|       |
 2668|  29.1k|         struct sequence_container_adapter
 2669|  29.1k|         {
 2670|  29.1k|            size_t index = 0;
 2671|       |
 2672|  29.1k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  29.1k|            {
 2674|  29.1k|               if constexpr (!resizable<V>) {
 2675|  29.1k|                  return index >= container.size();
 2676|  29.1k|               }
 2677|  29.1k|               else {
 2678|  29.1k|                  (void)container;
 2679|  29.1k|                  return false;
 2680|  29.1k|               }
 2681|  29.1k|            }
 2682|       |
 2683|  29.1k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  29.1k|            inline void append(V& container, value_type&& element) noexcept
 2686|  29.1k|            {
 2687|  29.1k|               if constexpr (emplace_backable<V>) {
 2688|  29.1k|                  container.emplace_back(std::move(element));
 2689|  29.1k|               }
 2690|  29.1k|               else if constexpr (emplaceable<V>) {
 2691|  29.1k|                  container.emplace(std::move(element));
 2692|  29.1k|               }
 2693|  29.1k|            }
 2694|  29.1k|         };
 2695|       |
 2696|  29.1k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 29.1k]
  |  Branch (2696:27): [True: 0, False: 29.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|  29.1k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  29.1k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  29.1k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  29.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 17, False: 29.1k]
  ------------------
 2709|     17|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  29.1k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 28.6k, False: 556]
  |  Branch (2712:27): [True: 3.20k, False: 25.4k]
  ------------------
 2713|  3.20k|            ++it;
 2714|  3.20k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  3.20k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 11, False: 3.19k]
  ------------------
 2716|     11|               return;
 2717|  3.19k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  3.19k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 392, False: 2.80k]
  ------------------
 2719|    392|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|    392|               }
 2721|  3.19k|            }
 2722|  3.19k|            return;
 2723|  3.20k|         }
 2724|       |
 2725|  25.9k|         bool just_saw_comma = false;
 2726|  25.9k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  25.9k|         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.05k]
  ------------------
 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.44k, False: 598k]
  ------------------
 2741|  3.44k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 3.44k, False: 0]
  ------------------
 2742|  3.44k|                     ++it;
 2743|  3.44k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  3.44k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 5, False: 3.43k]
  ------------------
 2745|      5|                        return;
 2746|  3.43k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  3.43k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 525, False: 2.91k]
  ------------------
 2748|    525|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|    525|                        }
 2750|  3.43k|                     }
 2751|  3.43k|                     return;
 2752|  3.44k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  3.44k|               }
 2756|       |
 2757|   598k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 72, False: 598k]
  |  Branch (2757:34): [True: 20, False: 598k]
  ------------------
 2758|     92|                  ctx.error = error_code::syntax_error;
 2759|     92|                  return;
 2760|     92|               }
 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: 10, False: 585k]
  ------------------
 2772|     10|                  return;
 2773|       |
 2774|   585k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 582k, False: 2.64k]
  |  Branch (2774:33): [True: 3.02k, False: 579k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  3.02k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 47, False: 2.97k]
  ------------------
 2777|     47|                     ctx.error = error_code::syntax_error;
 2778|     47|                     return;
 2779|     47|                  }
 2780|  2.97k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  2.97k|                     glz::generic key_node = std::move(element);
 2782|  2.97k|                     ++it;
 2783|  2.97k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  2.97k|                     glz::generic mapped{};
 2786|  2.97k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  2.97k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 352, False: 2.62k]
  ------------------
 2788|    352|                        return;
 2789|       |
 2790|  2.62k|                     std::string key;
 2791|  2.62k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 3, False: 2.62k]
  ------------------
 2792|      3|                        return;
 2793|       |
 2794|  2.62k|                     glz::generic pair{};
 2795|  2.62k|                     pair[key] = std::move(mapped);
 2796|  2.62k|                     element = std::move(pair);
 2797|       |
 2798|  2.62k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  2.62k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 1, False: 2.62k]
  ------------------
 2800|      1|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  2.97k|               }
 2807|       |
 2808|   585k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   585k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 2.76k, False: 582k]
  ------------------
 2811|  2.76k|                  ctx.error = error_code::unexpected_end;
 2812|  2.76k|                  return;
 2813|  2.76k|               }
 2814|       |
 2815|   582k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 3.87k, False: 578k]
  ------------------
 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: 30, False: 3.84k]
  ------------------
 2819|     30|                     return;
 2820|  3.84k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  3.84k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 586, False: 3.25k]
  ------------------
 2822|    586|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|    586|                     }
 2824|  3.84k|                  }
 2825|  3.84k|                  return;
 2826|  3.87k|               }
 2827|   578k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 577k, False: 1.56k]
  ------------------
 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: 7, False: 577k]
  ------------------
 2832|      7|                     return;
 2833|   577k|               }
 2834|  1.56k|               else {
 2835|  1.56k|                  ctx.error = error_code::syntax_error;
 2836|  1.56k|                  return;
 2837|  1.56k|               }
 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|  25.9k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|  69.5k|      {
 2649|  69.5k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|  69.5k|            if constexpr (!check_append_arrays(Opts)) {
 2652|  69.5k|               value.clear();
 2653|  69.5k|            }
 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|  69.5k|      }
_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|  40.3k|      {
 3160|  40.3k|         using V = std::remove_cvref_t<T>;
 3161|  40.3k|         using value_type = typename V::value_type;
 3162|       |
 3163|  40.3k|         struct sequence_container_adapter
 3164|  40.3k|         {
 3165|  40.3k|            size_t index = 0;
 3166|       |
 3167|  40.3k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|  40.3k|            {
 3169|  40.3k|               if constexpr (!resizable<V>) {
 3170|  40.3k|                  return index >= container.size();
 3171|  40.3k|               }
 3172|  40.3k|               else {
 3173|  40.3k|                  (void)container;
 3174|  40.3k|                  return false;
 3175|  40.3k|               }
 3176|  40.3k|            }
 3177|       |
 3178|  40.3k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|  40.3k|            inline void append(V& container, value_type&& element) noexcept
 3181|  40.3k|            {
 3182|  40.3k|               if constexpr (emplace_backable<V>) {
 3183|  40.3k|                  container.emplace_back(std::move(element));
 3184|  40.3k|               }
 3185|  40.3k|               else if constexpr (emplaceable<V>) {
 3186|  40.3k|                  container.emplace(std::move(element));
 3187|  40.3k|               }
 3188|  40.3k|            }
 3189|  40.3k|         };
 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|  40.3k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|  40.3k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|  40.3k|         bool first_item = true;
 3200|  40.3k|         bool has_pending_item_anchor = false;
 3201|  40.3k|         std::string pending_item_anchor_name{};
 3202|  40.3k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   161k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 144k, False: 17.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|   144k|            int32_t line_indent = 0;
 3215|   144k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   144k|            auto line_start = it;
 3217|       |
 3218|   274k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 265k, False: 8.75k]
  ------------------
 3219|   265k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 9.52k, False: 255k]
  ------------------
 3220|  9.52k|                  skip_comment(it, end);
 3221|  9.52k|                  skip_newline(it, end);
 3222|  9.52k|                  line_start = it;
 3223|  9.52k|                  line_indent = 0;
 3224|  9.52k|               }
 3225|   255k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 27.6k, False: 228k]
  |  Branch (3225:40): [True: 71.1k, False: 157k]
  ------------------
 3226|  98.7k|                  skip_newline(it, end);
 3227|  98.7k|                  line_start = it;
 3228|  98.7k|                  line_indent = 0;
 3229|  98.7k|               }
 3230|   157k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 25.5k, False: 131k]
  ------------------
 3231|  25.5k|                  line_start = it;
 3232|  25.5k|                  line_indent = 0;
 3233|  78.7k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 78.2k, False: 467]
  |  Branch (3233:39): [True: 53.1k, False: 25.0k]
  ------------------
 3234|  53.1k|                     ++line_indent;
 3235|  53.1k|                     ++it;
 3236|  53.1k|                  }
 3237|       |
 3238|  25.5k|                  bool saw_tab = false;
 3239|  27.6k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 27.0k, False: 606]
  |  Branch (3239:40): [True: 510, False: 26.5k]
  |  Branch (3239:54): [True: 1.54k, False: 24.9k]
  ------------------
 3240|  2.05k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 1.43k, False: 628]
  |  Branch (3240:43): [True: 628, False: 0]
  ------------------
 3241|  2.05k|                     ++it;
 3242|  2.05k|                  }
 3243|       |
 3244|  25.5k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 606, False: 24.9k]
  |  Branch (3244:36): [True: 1.05k, False: 23.9k]
  |  Branch (3244:51): [True: 14.3k, False: 9.55k]
  |  Branch (3244:66): [True: 3.71k, False: 5.84k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  19.7k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 19.1k, False: 606]
  |  Branch (3246:39): [True: 3.71k, False: 15.4k]
  ------------------
 3247|  3.71k|                        skip_comment(it, end);
 3248|  3.71k|                     }
 3249|  19.7k|                     line_indent = 0;
 3250|  19.7k|                     continue;
 3251|  19.7k|                  }
 3252|       |
 3253|  5.84k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 6, False: 5.84k]
  ------------------
 3254|      6|                     ctx.error = error_code::syntax_error;
 3255|      6|                     return;
 3256|      6|                  }
 3257|  5.84k|                  break; // Found content
 3258|  5.84k|               }
 3259|   131k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 1.54k, False: 129k]
  ------------------
 3260|  1.54k|                  line_start = it;
 3261|  4.47k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 4.20k, False: 265]
  |  Branch (3261:40): [True: 580, False: 3.62k]
  |  Branch (3261:54): [True: 2.34k, False: 1.28k]
  ------------------
 3262|  1.54k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 265, False: 1.28k]
  |  Branch (3262:36): [True: 356, False: 927]
  |  Branch (3262:51): [True: 347, False: 580]
  |  Branch (3262:66): [True: 568, False: 12]
  ------------------
 3263|  1.53k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 1.27k, False: 265]
  |  Branch (3263:39): [True: 568, False: 703]
  ------------------
 3264|    568|                        skip_comment(it, end);
 3265|    568|                     }
 3266|  1.53k|                     line_indent = 0;
 3267|  1.53k|                     continue;
 3268|  1.53k|                  }
 3269|     12|                  ctx.error = error_code::syntax_error;
 3270|     12|                  return;
 3271|  1.54k|               }
 3272|   129k|               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|   129k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 40.3k, False: 89.6k]
  |  Branch (3276:37): [True: 40.0k, False: 264]
  ------------------
 3277|  40.0k|                     line_indent = sequence_indent;
 3278|  40.0k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  40.0k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 40.0k, False: 0]
  |  Branch (3279:49): [True: 39.4k, False: 685]
  ------------------
 3280|  39.4k|                           auto probe = it;
 3281|  39.4k|                           int32_t leading_ws = 0;
 3282|  39.4k|                           bool saw_tab = false;
 3283|   125k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 125k, False: 113]
  |  Branch (3283:64): [True: 84.5k, False: 40.8k]
  |  Branch (3283:87): [True: 1.57k, False: 39.2k]
  ------------------
 3284|  86.1k|                              --probe;
 3285|  86.1k|                              ++leading_ws;
 3286|  86.1k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 555, False: 85.5k]
  |  Branch (3286:52): [True: 1.07k, False: 84.4k]
  ------------------
 3287|  86.1k|                           }
 3288|  39.4k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 113, False: 39.2k]
  |  Branch (3288:61): [True: 8.60k, False: 30.6k]
  |  Branch (3288:85): [True: 9.08k, False: 21.6k]
  ------------------
 3289|  17.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 24, False: 17.7k]
  ------------------
 3290|     24|                                 ctx.error = error_code::syntax_error;
 3291|     24|                                 return;
 3292|     24|                              }
 3293|  17.7k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  17.7k|                           }
 3295|  39.4k|                        }
 3296|  40.0k|                     }
 3297|  40.0k|                  }
 3298|  40.0k|                  break;
 3299|   129k|               }
 3300|   265k|            }
 3301|       |
 3302|   144k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 8.75k, False: 135k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   135k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 1.34k, False: 134k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   134k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 3.47k, False: 131k]
  ------------------
 3309|  3.47k|               it = line_start;
 3310|  3.47k|               return;
 3311|  3.47k|            }
 3312|       |
 3313|   131k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 4.47k, 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|  4.47k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 6, False: 4.47k]
  ------------------
 3318|      6|                  ctx.error = error_code::syntax_error;
 3319|      6|                  return;
 3320|      6|               }
 3321|       |
 3322|  4.47k|               ++it;
 3323|  4.47k|               auto pending_name = parse_anchor_name(it, end);
 3324|  4.47k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 10, False: 4.46k]
  ------------------
 3325|     10|                  ctx.error = error_code::syntax_error;
 3326|     10|                  return;
 3327|     10|               }
 3328|  4.46k|               skip_inline_ws(it, end);
 3329|  4.46k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 4.40k, False: 57]
  |  Branch (3329:33): [True: 682, False: 3.72k]
  ------------------
 3330|    682|                  skip_comment(it, end);
 3331|    682|               }
 3332|       |
 3333|  4.46k|               has_pending_item_anchor = true;
 3334|  4.46k|               pending_item_anchor_name = std::string(pending_name);
 3335|  4.46k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  4.46k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 68, False: 4.39k]
  |  Branch (3337:34): [True: 2.33k, False: 2.06k]
  |  Branch (3337:49): [True: 25, False: 2.30k]
  ------------------
 3338|     93|                  ctx.error = error_code::syntax_error;
 3339|     93|                  return;
 3340|     93|               }
 3341|       |
 3342|  4.36k|               skip_newline(it, end);
 3343|  4.36k|               continue;
 3344|  4.46k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   126k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 6.35k, False: 120k]
  ------------------
 3348|  6.35k|               it = line_start;
 3349|  6.35k|               return;
 3350|  6.35k|            }
 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|   120k|            dash_col = line_indent;
 3356|   120k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   120k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 120k, False: 24]
  ------------------
 3358|   120k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   120k|               }
 3360|   120k|            }
 3361|       |
 3362|   120k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   120k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 118k, False: 1.23k]
  |  Branch (3365:30): [True: 2.24k, False: 116k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  2.24k|               it = line_start;
 3368|  2.24k|               return;
 3369|  2.24k|            }
 3370|       |
 3371|   117k|            bool saw_tab_after_dash = false;
 3372|   193k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 192k, False: 1.82k]
  |  Branch (3372:34): [True: 64.9k, False: 127k]
  |  Branch (3372:48): [True: 10.9k, False: 116k]
  ------------------
 3373|  75.9k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 1.35k, False: 74.5k]
  |  Branch (3373:59): [True: 9.72k, False: 64.8k]
  ------------------
 3374|  75.9k|               ++it;
 3375|  75.9k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   117k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 9.72k, False: 108k]
  |  Branch (3377:39): [True: 9.45k, False: 274]
  |  Branch (3377:52): [True: 364, False: 9.09k]
  ------------------
 3378|    364|               const auto after_dash = it + 1;
 3379|    364|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 7, False: 357]
  |  Branch (3379:41): [True: 4, False: 353]
  ------------------
 3380|     11|                  ctx.error = error_code::syntax_error;
 3381|     11|                  return;
 3382|     11|               }
 3383|    364|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   117k|            auto parse_element = [&](auto& element) {
 3387|   117k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   117k|               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|   117k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   117k|                     return;
 3397|   117k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   117k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   117k|                  ctx.sequence_item_value_context = true;
 3400|   117k|                  ctx.sequence_dash_indent = dash_col;
 3401|   117k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   117k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   117k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   117k|                  ctx.pop_indent();
 3405|   117k|               }
 3406|   117k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   117k|                  skip_ws_and_comment(it, end);
 3409|   117k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   117k|                  auto nested_start = it;
 3413|   117k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   117k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   117k|                     return;
 3416|   117k|                  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|   117k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   117k|                  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|   117k|                     const int32_t element_indent =
 3428|   117k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   117k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   117k|                        return;
 3431|   117k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   117k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   117k|                     ctx.sequence_item_value_context = true;
 3434|   117k|                     ctx.sequence_dash_indent = dash_col;
 3435|   117k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   117k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   117k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   117k|                     ctx.pop_indent();
 3439|   117k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   117k|               }
 3442|       |
 3443|   117k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   117k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   117k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   117k|                                                                      pending_item_anchor_indent};
 3447|   117k|                  has_pending_item_anchor = false;
 3448|   117k|               }
 3449|   117k|            };
 3450|       |
 3451|   117k|            if constexpr (emplace_backable<V>) {
 3452|   117k|               auto& element = value.emplace_back();
 3453|   117k|               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|   117k|            first_item = false;
 3472|       |
 3473|   117k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 917, False: 117k]
  ------------------
 3474|    917|               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|   117k|         }
 3479|  40.3k|      }
_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|   117k|            auto parse_element = [&](auto& element) {
 3387|   117k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 116k, False: 1.79k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   117k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 116k, False: 1.79k]
  |  Branch (3390:33): [True: 47.7k, False: 68.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|  47.7k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 47.7k]
  ------------------
 3396|      0|                     return;
 3397|  47.7k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|  47.7k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|  47.7k|                  ctx.sequence_item_value_context = true;
 3400|  47.7k|                  ctx.sequence_dash_indent = dash_col;
 3401|  47.7k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|  47.7k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|  47.7k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|  47.7k|                  ctx.pop_indent();
 3405|  47.7k|               }
 3406|  70.1k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  70.1k|                  skip_ws_and_comment(it, end);
 3409|  70.1k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  70.1k|                  auto nested_start = it;
 3413|  70.1k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  70.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 4, False: 70.1k]
  ------------------
 3415|      4|                     return;
 3416|  70.1k|                  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|  70.1k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 1.28k, False: 68.9k]
  ------------------
 3422|  70.1k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 57.1k, False: 13.0k]
  ------------------
 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|  57.1k|                     const int32_t element_indent =
 3428|  57.1k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 57.1k]
  ------------------
 3429|  57.1k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 57.1k]
  ------------------
 3430|      0|                        return;
 3431|  57.1k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  57.1k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  57.1k|                     ctx.sequence_item_value_context = true;
 3434|  57.1k|                     ctx.sequence_dash_indent = dash_col;
 3435|  57.1k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  57.1k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  57.1k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  57.1k|                     ctx.pop_indent();
 3439|  57.1k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  70.1k|               }
 3442|       |
 3443|   117k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 1.55k, False: 116k]
  |  Branch (3443:47): [True: 1.45k, False: 96]
  ------------------
 3444|  1.45k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 802, False: 657]
  ------------------
 3445|  1.45k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  1.45k|                                                                      pending_item_anchor_indent};
 3447|  1.45k|                  has_pending_item_anchor = false;
 3448|  1.45k|               }
 3449|   117k|            };
_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|   222k|   {
 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|   222k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 114k, False: 107k]
  ------------------
 5601|   114k|         return;
 5602|   114k|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|   107k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 6.59k, False: 101k]
  ------------------
 5605|  6.59k|         return;
 5606|  6.59k|      }
 5607|   101k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   101k|   }
_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.14k, False: 32.3k]
  ------------------
 5964|  2.14k|                  return true;
 5965|  2.14k|               }
 5966|  32.3k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 8.01k, False: 24.3k]
  ------------------
 5967|  8.01k|                  auto next = ptr + 1;
 5968|  8.01k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 2.84k, False: 5.16k]
  |  Branch (5968:43): [True: 1.08k, False: 4.07k]
  |  Branch (5968:59): [True: 1.29k, False: 2.78k]
  |  Branch (5968:76): [True: 908, False: 1.87k]
  |  Branch (5968:93): [True: 1.17k, False: 707]
  ------------------
 5969|  8.01k|               }
 5970|  24.3k|               return is_plain_scalar_boundary(*ptr);
 5971|  32.3k|            };
_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|  24.3k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  24.3k|               switch (ch) {
 5890|    540|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 540, False: 23.7k]
  ------------------
 5891|  1.15k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 614, False: 23.7k]
  ------------------
 5892|  6.18k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 5.02k, False: 19.2k]
  ------------------
 5893|  20.6k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 14.4k, False: 9.89k]
  ------------------
 5894|  20.9k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 301, False: 24.0k]
  ------------------
 5895|  21.2k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 310, False: 24.0k]
  ------------------
 5896|  21.4k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 272, False: 24.0k]
  ------------------
 5897|  21.4k|                  return true;
 5898|  2.82k|               default:
  ------------------
  |  Branch (5898:16): [True: 2.82k, False: 21.4k]
  ------------------
 5899|  2.82k|                  return false;
 5900|  24.3k|               }
 5901|  24.3k|            };
_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.9k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5905|       |                  return false;
 5906|       |               }
 5907|  30.9k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 3.38k, False: 27.5k]
  ------------------
 5908|  3.38k|                  return false;
 5909|  3.38k|               }
 5910|  27.5k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 1.47k, False: 26.0k]
  |  Branch (5910:40): [True: 21.0k, False: 5.02k]
  |  Branch (5910:61): [True: 6.71k, False: 14.3k]
  ------------------
 5911|  8.19k|                  return false;
 5912|  8.19k|               }
 5913|       |
 5914|  19.3k|               auto look = word_end;
 5915|  19.3k|               yaml::skip_newline(look, end);
 5916|  59.9k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 52.8k, False: 7.15k]
  ------------------
 5917|  52.8k|                  int32_t line_indent = 0;
 5918|   133k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 133k, False: 355]
  |  Branch (5918:41): [True: 80.5k, False: 52.4k]
  ------------------
 5919|  80.5k|                     ++line_indent;
 5920|  80.5k|                     ++look;
 5921|  80.5k|                  }
 5922|  52.8k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 52.4k, False: 355]
  |  Branch (5922:38): [True: 706, False: 51.7k]
  ------------------
 5923|    706|                     return false;
 5924|    706|                  }
 5925|  52.0k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 355, False: 51.7k]
  |  Branch (5925:38): [True: 32.2k, False: 19.4k]
  |  Branch (5925:55): [True: 4.52k, False: 14.9k]
  ------------------
 5926|  37.1k|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 36.7k, False: 355]
  ------------------
 5927|  36.7k|                        yaml::skip_newline(look, end);
 5928|  36.7k|                        continue;
 5929|  36.7k|                     }
 5930|    355|                     return false;
 5931|  37.1k|                  }
 5932|  14.9k|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 4.08k, False: 10.8k]
  ------------------
 5933|  4.08k|                     yaml::skip_comment(look, end);
 5934|  4.08k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 3.80k, False: 281]
  |  Branch (5934:42): [True: 1.71k, False: 2.09k]
  |  Branch (5934:59): [True: 2.08k, False: 5]
  ------------------
 5935|  3.80k|                        yaml::skip_newline(look, end);
 5936|  3.80k|                        continue;
 5937|  3.80k|                     }
 5938|    286|                     return false;
 5939|  4.08k|                  }
 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|  10.8k|                  {
 5945|  10.8k|                     auto scan = look;
 5946|   101k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 101k, False: 334]
  |  Branch (5946:44): [True: 96.2k, False: 5.06k]
  |  Branch (5946:61): [True: 95.1k, False: 1.13k]
  ------------------
 5947|  95.1k|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 7.77k, False: 87.3k]
  ------------------
 5948|  7.77k|                           auto after_colon = scan + 1;
 5949|  7.77k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 239, False: 7.53k]
  |  Branch (5949:54): [True: 2.70k, False: 4.83k]
  |  Branch (5949:77): [True: 377, False: 4.46k]
  ------------------
 5950|  4.46k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 457, False: 4.00k]
  |  Branch (5950:56): [True: 561, False: 3.44k]
  ------------------
 5951|  4.33k|                              return false;
 5952|  4.33k|                           }
 5953|  7.77k|                        }
 5954|  90.8k|                        ++scan;
 5955|  90.8k|                     }
 5956|  10.8k|                  }
 5957|       |
 5958|  6.52k|                  return line_indent > ctx.current_indent();
 5959|  10.8k|               }
 5960|  7.15k|               return false;
 5961|  19.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_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5484|   247k|   {
 5485|   247k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   247k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   247k|         const bool could_be_mapping = [&] {
 5493|   247k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   247k|               return line_could_be_flow_mapping(it, end);
 5495|   247k|            }
 5496|   247k|            else {
 5497|   247k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   247k|            }
 5499|   247k|         }();
 5500|   247k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 108k, False: 138k]
  ------------------
 5501|   108k|            return false;
 5502|   108k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   138k|         auto temp_ctx = ctx.make_speculative();
 5505|   138k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   138k|                                                                                               end);
 5507|   138k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   138k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   138k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 123k, False: 15.3k]
  ------------------
 5510|   123k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   123k|            return true;
 5512|   123k|         }
 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|   138k|      }
 5520|   247k|   }
_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|   247k|         const bool could_be_mapping = [&] {
 5493|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5494|       |               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|   247k|            else {
 5497|   247k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   247k|            }
 5499|   247k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    445|               auto is_document_start = [&](auto pos) {
  146|    445|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 321, False: 124]
  |  Branch (146:41): [True: 162, False: 159]
  |  Branch (146:58): [True: 144, False: 18]
  |  Branch (146:75): [True: 137, False: 7]
  ------------------
  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: 50, False: 76]
  |  Branch (148:62): [True: 51, 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|    308|                  return false;
  152|    445|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6732|  82.2k|   {
 6733|  82.2k|      if (buffer.size() == 0) {
  ------------------
  |  Branch (6733:11): [True: 0, False: 82.2k]
  ------------------
 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|  82.2k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6746|  82.2k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|   123k|      {
   70|   123k|         if constexpr (requires { ctx.stream_begin; }) {
   71|   123k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 123k, False: 0]
  |  Branch (71:38): [True: 123k, False: 0]
  ------------------
   72|   123k|               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|   123k|               if constexpr (requires { ctx.reset_read_state(); }) {
   76|   123k|                  ctx.reset_read_state();
   77|   123k|               }
   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|   123k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|   123k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|   123k|                  ctx.alias_expansion_budget =
   84|   123k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 901, False: 122k]
  ------------------
   85|   123k|               }
   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|   123k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|   123k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|   123k|                  ctx.key_expansion_budget =
   91|   123k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 901, False: 122k]
  ------------------
   92|   123k|               }
   93|   123k|            }
   94|   123k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|   123k|         yaml::skip_document_start(it, end, ctx);
   97|   123k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 788, False: 122k]
  ------------------
   98|    788|            return;
   99|    788|         }
  100|       |
  101|   122k|         using V = std::remove_cvref_t<T>;
  102|   122k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 69, False: 122k]
  ------------------
  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|   122k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 86, False: 122k]
  |  Branch (120:50): [True: 31, False: 122k]
  ------------------
  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|   122k|         if constexpr (!check_partial_read(Opts)) {
  144|   122k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 13.6k, False: 108k]
  |  Branch (144:37): [True: 13.6k, False: 0]
  ------------------
  145|  13.6k|               auto is_document_start = [&](auto pos) {
  146|  13.6k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  13.6k|                     auto after = pos + 3;
  148|  13.6k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  13.6k|                            *after == '#';
  150|  13.6k|                  }
  151|  13.6k|                  return false;
  152|  13.6k|               };
  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.6k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  13.6k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 5.19k, False: 8.50k]
  |  Branch (162:23): [True: 3.40k, False: 10.2k]
  |  Branch (162:36): [True: 3.40k, False: 1.78k]
  ------------------
  163|  3.40k|                     auto rest = it;
  164|  9.08k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 9.03k, False: 50]
  |  Branch (164:45): [True: 4.61k, False: 4.42k]
  |  Branch (164:61): [True: 1.06k, False: 3.35k]
  ------------------
  165|  3.40k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 3.35k, False: 50]
  |  Branch (165:41): [True: 2.89k, False: 461]
  |  Branch (165:58): [True: 2.22k, False: 678]
  |  Branch (165:75): [True: 1.91k, False: 307]
  ------------------
  166|  1.91k|                        ctx.error = error_code::syntax_error;
  167|  1.91k|                        return;
  168|  1.91k|                     }
  169|  3.40k|                  }
  170|  13.6k|               }
  171|       |
  172|  11.7k|               auto tail_scan = it;
  173|  13.6k|               bool seen_document_end_marker = false;
  174|   106k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 95.7k, False: 11.2k]
  ------------------
  175|  95.7k|                  auto line = tail_scan;
  176|   149k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 149k, False: 84]
  |  Branch (176:42): [True: 52.8k, False: 96.3k]
  |  Branch (176:58): [True: 753, False: 95.6k]
  ------------------
  177|  95.7k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 3.22k, False: 92.4k]
  |  Branch (177:44): [True: 3.14k, False: 84]
  |  Branch (177:59): [True: 2.25k, False: 889]
  |  Branch (177:76): [True: 1.71k, False: 540]
  |  Branch (177:93): [True: 385, False: 1.32k]
  ------------------
  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|    385|                     const char first = *line;
  182|    385|                     const bool explicit_or_structural_start =
  183|    385|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 22, False: 363]
  |  Branch (183:42): [True: 4, False: 359]
  |  Branch (183:58): [True: 10, False: 349]
  |  Branch (183:74): [True: 6, False: 343]
  |  Branch (183:90): [True: 7, False: 336]
  |  Branch (183:106): [True: 13, False: 323]
  ------------------
  184|    323|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 4, False: 319]
  |  Branch (184:42): [True: 7, False: 312]
  |  Branch (184:58): [True: 4, False: 308]
  |  Branch (184:75): [True: 41, False: 267]
  ------------------
  185|    385|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 267, False: 118]
  ------------------
  186|    267|                        auto scan = line;
  187|  3.76k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 3.56k, False: 202]
  |  Branch (187:47): [True: 3.54k, False: 15]
  |  Branch (187:64): [True: 3.53k, False: 9]
  ------------------
  188|  3.53k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 776, False: 2.76k]
  ------------------
  189|    776|                              auto after = scan + 1;
  190|    776|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 17, False: 759]
  |  Branch (190:51): [True: 9, False: 750]
  |  Branch (190:68): [True: 6, False: 744]
  |  Branch (190:86): [True: 6, False: 738]
  |  Branch (190:104): [True: 3, False: 735]
  ------------------
  191|     41|                                 ctx.error = error_code::syntax_error;
  192|     41|                                 return;
  193|     41|                              }
  194|    776|                           }
  195|  3.49k|                           ++scan;
  196|  3.49k|                        }
  197|    267|                     }
  198|    344|                     return;
  199|    385|                  }
  200|  95.3k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 84, False: 95.2k]
  ------------------
  201|     84|                     return;
  202|     84|                  }
  203|  95.2k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 74, False: 95.1k]
  |  Branch (203:39): [True: 43, False: 95.1k]
  ------------------
  204|    117|                     return; // Explicit key/value continuation.
  205|    117|                  }
  206|  95.1k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 2.44k, False: 92.6k]
  |  Branch (206:40): [True: 28.1k, False: 64.5k]
  ------------------
  207|  30.5k|                     tail_scan = line;
  208|  30.5k|                     yaml::skip_newline(tail_scan, end);
  209|  30.5k|                     continue;
  210|  30.5k|                  }
  211|  64.5k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 49.1k, False: 15.4k]
  ------------------
  212|   382k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 382k, False: 438]
  |  Branch (212:49): [True: 371k, False: 10.4k]
  |  Branch (212:71): [True: 333k, False: 38.2k]
  ------------------
  213|  49.1k|                     yaml::skip_newline(tail_scan, end);
  214|  49.1k|                     continue;
  215|  49.1k|                  }
  216|  15.4k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 13.5k, False: 1.86k]
  ------------------
  217|  13.5k|                     seen_document_end_marker = true;
  218|  85.1k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 85.0k, False: 139]
  |  Branch (218:49): [True: 75.6k, False: 9.39k]
  |  Branch (218:71): [True: 71.6k, False: 4.00k]
  ------------------
  219|  13.5k|                     yaml::skip_newline(tail_scan, end);
  220|  13.5k|                     continue;
  221|  13.5k|                  }
  222|  1.86k|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 361, False: 1.50k]
  ------------------
  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.49k, False: 26]
  |  Branch (228:47): [True: 1.26k, False: 1.23k]
  |  Branch (228:65): [True: 901, False: 335]
  ------------------
  229|    361|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 335, False: 26]
  |  Branch (229:43): [True: 164, False: 171]
  ------------------
  230|    164|                        auto tag_end = header + 1;
  231|  9.65M|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 9.65M, False: 54]
  |  Branch (231:50): [True: 9.65M, False: 88]
  |  Branch (231:69): [True: 9.65M, False: 4]
  |  Branch (231:89): [True: 9.65M, False: 3]
  ------------------
  232|  9.65M|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 9.65M, False: 6]
  |  Branch (232:52): [True: 9.65M, False: 9]
  ------------------
  233|  9.65M|                           ++tag_end;
  234|  9.65M|                        }
  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: 128, False: 36]
  ------------------
  238|    128|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|    128|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 128, False: 0]
  |  Branch (239:49): [True: 124, False: 4]
  ------------------
  240|    124|                              ctx.error = error_code::syntax_error;
  241|    124|                              return;
  242|    124|                           }
  243|    128|                        }
  244|    164|                     }
  245|    237|                     return; // Additional documents are allowed in the stream tail.
  246|    361|                  }
  247|  1.50k|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 1.50k, False: 0]
  |  Branch (247:38): [True: 16, False: 1.48k]
  ------------------
  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.48k|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 210, False: 1.27k]
  ------------------
  257|    210|                     return; // Implicit next document after explicit document end marker.
  258|    210|                  }
  259|  1.27k|                  ctx.error = error_code::syntax_error;
  260|  1.27k|                  return;
  261|  1.48k|               }
  262|  13.6k|            }
  263|   122k|         }
  264|   122k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.69M|      {
  275|  1.69M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.69M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.69M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.69M|      }
_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.19M|      {
 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.19M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  2.19M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  2.19M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  2.19M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  2.19M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 2.19M]
  ------------------
 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.19M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 413k, False: 1.78M]
  ------------------
 5769|   413k|            yaml::skip_ws_newlines_comments(it, end);
 5770|   413k|         }
 5771|  1.78M|         else {
 5772|  1.78M|            yaml::skip_inline_ws(it, end);
 5773|  1.78M|         }
 5774|       |
 5775|  2.19M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 134, False: 2.19M]
  ------------------
 5776|    134|            ctx.error = error_code::unexpected_end;
 5777|    134|            return;
 5778|    134|         }
 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.19M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  2.19M|            using V = std::remove_cvref_t<T>;
 5886|  2.19M|            using counts = yaml_variant_type_count<V>;
 5887|  2.19M|            const char c = *it;
 5888|  2.19M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  2.19M|               switch (ch) {
 5890|  2.19M|               case ' ':
 5891|  2.19M|               case '\t':
 5892|  2.19M|               case '\n':
 5893|  2.19M|               case '\r':
 5894|  2.19M|               case ',':
 5895|  2.19M|               case ']':
 5896|  2.19M|               case '}':
 5897|  2.19M|                  return true;
 5898|  2.19M|               default:
 5899|  2.19M|                  return false;
 5900|  2.19M|               }
 5901|  2.19M|            };
 5902|       |
 5903|  2.19M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  2.19M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  2.19M|                  return false;
 5906|  2.19M|               }
 5907|  2.19M|               if (ctx.current_indent() < 0) {
 5908|  2.19M|                  return false;
 5909|  2.19M|               }
 5910|  2.19M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  2.19M|                  return false;
 5912|  2.19M|               }
 5913|       |
 5914|  2.19M|               auto look = word_end;
 5915|  2.19M|               yaml::skip_newline(look, end);
 5916|  2.19M|               while (look != end) {
 5917|  2.19M|                  int32_t line_indent = 0;
 5918|  2.19M|                  while (look != end && *look == ' ') {
 5919|  2.19M|                     ++line_indent;
 5920|  2.19M|                     ++look;
 5921|  2.19M|                  }
 5922|  2.19M|                  if (look != end && *look == '\t') {
 5923|  2.19M|                     return false;
 5924|  2.19M|                  }
 5925|  2.19M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  2.19M|                     if (look != end) {
 5927|  2.19M|                        yaml::skip_newline(look, end);
 5928|  2.19M|                        continue;
 5929|  2.19M|                     }
 5930|  2.19M|                     return false;
 5931|  2.19M|                  }
 5932|  2.19M|                  if (*look == '#') {
 5933|  2.19M|                     yaml::skip_comment(look, end);
 5934|  2.19M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  2.19M|                        yaml::skip_newline(look, end);
 5936|  2.19M|                        continue;
 5937|  2.19M|                     }
 5938|  2.19M|                     return false;
 5939|  2.19M|                  }
 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.19M|                  {
 5945|  2.19M|                     auto scan = look;
 5946|  2.19M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  2.19M|                        if (*scan == ':') {
 5948|  2.19M|                           auto after_colon = scan + 1;
 5949|  2.19M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  2.19M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  2.19M|                              return false;
 5952|  2.19M|                           }
 5953|  2.19M|                        }
 5954|  2.19M|                        ++scan;
 5955|  2.19M|                     }
 5956|  2.19M|                  }
 5957|       |
 5958|  2.19M|                  return line_indent > ctx.current_indent();
 5959|  2.19M|               }
 5960|  2.19M|               return false;
 5961|  2.19M|            };
 5962|  2.19M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  2.19M|               if (ptr == end) {
 5964|  2.19M|                  return true;
 5965|  2.19M|               }
 5966|  2.19M|               if (*ptr == ':') {
 5967|  2.19M|                  auto next = ptr + 1;
 5968|  2.19M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  2.19M|               }
 5970|  2.19M|               return is_plain_scalar_boundary(*ptr);
 5971|  2.19M|            };
 5972|       |
 5973|  2.19M|            switch (c) {
 5974|   371k|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 371k, False: 1.82M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|   371k|               ++it;
 5977|   371k|               auto aname = yaml::parse_anchor_name(it, end);
 5978|   371k|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 411, False: 370k]
  ------------------
 5979|    411|                  ctx.error = error_code::syntax_error;
 5980|    411|                  return;
 5981|    411|               }
 5982|   370k|               yaml::skip_inline_ws(it, end);
 5983|   370k|               bool anchor_on_same_line = true;
 5984|   370k|               bool value_is_indentless_sequence = false;
 5985|   370k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 4.39k, False: 366k]
  |  Branch (5985:33): [True: 21.7k, False: 344k]
  |  Branch (5985:48): [True: 32.4k, False: 312k]
  |  Branch (5985:63): [True: 22.2k, False: 289k]
  ------------------
 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|  80.8k|                  bool value_on_next_line = false;
 5989|  80.8k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 76.4k, False: 4.39k]
  ------------------
 5990|  76.4k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|  76.4k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 22.2k, False: 54.2k]
  ------------------
 5993|   312k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 310k, False: 1.54k]
  |  Branch (5993:47): [True: 303k, False: 7.64k]
  |  Branch (5993:64): [True: 290k, False: 13.0k]
  ------------------
 5994|  22.2k|                     }
 5995|       |                     // Skip newline
 5996|  76.4k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 74.8k, False: 1.54k]
  |  Branch (5996:42): [True: 29.3k, False: 45.4k]
  |  Branch (5996:59): [True: 45.4k, False: 0]
  ------------------
 5997|  74.8k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   137k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 132k, False: 4.78k]
  |  Branch (5999:48): [True: 46.5k, False: 86.2k]
  |  Branch (5999:65): [True: 16.1k, False: 70.0k]
  ------------------
 6000|  62.7k|                           yaml::skip_newline(peek, end);
 6001|  62.7k|                        }
 6002|       |                        // Measure indent of next content line
 6003|  74.8k|                        int32_t next_indent = 0;
 6004|   315k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 309k, False: 5.71k]
  |  Branch (6004:47): [True: 240k, False: 69.1k]
  ------------------
 6005|   240k|                           ++next_indent;
 6006|   240k|                           ++peek;
 6007|   240k|                        }
 6008|  74.8k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 69.1k, False: 5.71k]
  |  Branch (6008:44): [True: 67.7k, False: 1.42k]
  |  Branch (6008:61): [True: 65.7k, False: 1.98k]
  ------------------
 6009|  65.7k|                           const bool indentless_sequence =
 6010|  65.7k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 58.1k, False: 7.54k]
  |  Branch (6010:69): [True: 27.6k, False: 30.5k]
  ------------------
 6011|  27.6k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 814, False: 26.7k]
  ------------------
 6012|  26.7k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 25.3k, False: 1.45k]
  ------------------
 6013|  26.1k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 12.7k, False: 13.3k]
  ------------------
 6014|  13.3k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 9.51k, False: 3.86k]
  |  Branch (6014:61): [True: 5.20k, False: 4.30k]
  ------------------
 6015|  65.7k|                           value_is_indentless_sequence = indentless_sequence;
 6016|  65.7k|                           const bool same_indent_property_node =
 6017|  65.7k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 25.8k, False: 39.8k]
  ------------------
 6018|  25.8k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 2.72k, False: 23.1k]
  |  Branch (6018:48): [True: 4.47k, False: 18.6k]
  |  Branch (6018:64): [True: 798, False: 17.8k]
  |  Branch (6018:80): [True: 674, 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: 989, False: 14.2k]
  |  Branch (6019:65): [True: 759, False: 13.4k]
  |  Branch (6019:81): [True: 186, False: 13.2k]
  ------------------
 6020|  65.7k|                           value_on_next_line =
 6021|  65.7k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 24.7k, False: 40.9k]
  |  Branch (6021:71): [True: 17.9k, False: 22.9k]
  |  Branch (6021:94): [True: 12.5k, False: 10.3k]
  ------------------
 6022|  65.7k|                        }
 6023|  74.8k|                     }
 6024|  76.4k|                  }
 6025|  80.8k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 25.4k, False: 55.3k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  25.4k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  25.4k|                     return;
 6029|  25.4k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|  55.3k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 15.6k, False: 39.6k]
  ------------------
 6032|   208k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 208k, False: 0]
  |  Branch (6032:42): [True: 202k, False: 5.59k]
  |  Branch (6032:57): [True: 192k, False: 10.0k]
  ------------------
 6033|  15.6k|                  }
 6034|  55.3k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 55.3k, False: 0]
  ------------------
 6035|   107k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 107k, False: 0]
  |  Branch (6035:40): [True: 43.7k, False: 63.9k]
  |  Branch (6035:55): [True: 8.58k, False: 55.3k]
  ------------------
 6036|  52.3k|                     yaml::skip_newline(it, end);
 6037|  52.3k|                  }
 6038|  55.3k|                  yaml::skip_inline_ws(it, end);
 6039|  55.3k|                  anchor_on_same_line = false;
 6040|  55.3k|               }
 6041|       |
 6042|   345k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6043|   345k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6043:23): [True: 289k, False: 55.3k]
  |  Branch (6043:46): [True: 17.4k, False: 272k]
  ------------------
 6044|  17.4k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6044:24): [True: 7, False: 17.4k]
  |  Branch (6044:43): [True: 22, False: 17.3k]
  ------------------
 6045|       |                     // "&anchor - item" is malformed in block context.
 6046|     29|                     ctx.error = error_code::syntax_error;
 6047|     29|                     return;
 6048|     29|                  }
 6049|   345k|               }
 6050|       |
 6051|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6052|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6053|   345k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 345k, False: 52]
  |  Branch (6053:33): [True: 2.53k, False: 342k]
  |  Branch (6053:47): [True: 317, False: 2.22k]
  ------------------
 6054|    317|                  ctx.error = error_code::syntax_error;
 6055|    317|                  return;
 6056|    317|               }
 6057|       |
 6058|   344k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6059|   344k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6059:23): [True: 55.2k, False: 289k]
  |  Branch (6059:47): [True: 55.2k, False: 23]
  |  Branch (6059:60): [True: 6.48k, False: 48.7k]
  ------------------
 6060|  6.48k|                     auto probe = it + 1;
 6061|  6.48k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6062|  6.48k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6062:26): [True: 48, False: 6.43k]
  ------------------
 6063|     48|                        ctx.error = error_code::syntax_error;
 6064|     48|                        return;
 6065|     48|                     }
 6066|  6.43k|                     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.43k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6070:26): [True: 208, False: 6.22k]
  ------------------
 6071|    208|                        ctx.error = error_code::syntax_error;
 6072|    208|                        return;
 6073|    208|                     }
 6074|  6.43k|                  }
 6075|   344k|               }
 6076|       |
 6077|   344k|               const char* anchor_start = &*it;
 6078|   344k|               const int32_t anchor_indent = ctx.current_indent();
 6079|       |
 6080|   344k|               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|   344k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6084:23): [True: 289k, False: 55.3k]
  |  Branch (6084:46): [True: 140k, False: 149k]
  ------------------
 6085|   140k|                     auto key_start = it;
 6086|   140k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6086:26): [True: 2.62k, False: 137k]
  ------------------
 6087|  2.62k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6088|  2.62k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6088:29): [True: 8, False: 2.61k]
  |  Branch (6088:67): [True: 10, False: 2.60k]
  ------------------
 6089|     18|                           ctx.error = error_code::syntax_error;
 6090|     18|                           return;
 6091|     18|                        }
 6092|  2.60k|                        yaml::skip_inline_ws(key_start, end);
 6093|  2.60k|                        if (key_start == end) {
  ------------------
  |  Branch (6093:29): [True: 6, False: 2.60k]
  ------------------
 6094|      6|                           ctx.error = error_code::unexpected_end;
 6095|      6|                           return;
 6096|      6|                        }
 6097|  2.60k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6097:29): [True: 3, False: 2.60k]
  |  Branch (6097:51): [True: 3, False: 2.59k]
  ------------------
 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.59k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6106:29): [True: 497, False: 2.10k]
  |  Branch (6106:50): [True: 10, False: 487]
  ------------------
 6107|     10|                           ctx.error = error_code::syntax_error;
 6108|     10|                           return;
 6109|     10|                        }
 6110|  2.59k|                     }
 6111|       |
 6112|       |                     // Find the key span by scanning to the key-value separator
 6113|   140k|                     auto key_scan = key_start;
 6114|   140k|                     auto key_end = key_start;
 6115|   140k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6115:26): [True: 1.71k, False: 138k]
  |  Branch (6115:46): [True: 991, False: 137k]
  ------------------
 6116|       |                        // Quoted key: skip to closing quote
 6117|  2.70k|                        const char quote = *key_scan;
 6118|  2.70k|                        ++key_scan;
 6119|  19.9k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6119:32): [True: 19.9k, False: 8]
  |  Branch (6119:51): [True: 17.2k, False: 2.69k]
  ------------------
 6120|  17.2k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6120:32): [True: 1.27k, False: 15.9k]
  |  Branch (6120:53): [True: 678, False: 601]
  ------------------
 6121|    678|                              ++key_scan;
 6122|    678|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6122:35): [True: 678, False: 0]
  ------------------
 6123|    678|                           }
 6124|  16.5k|                           else {
 6125|  16.5k|                              ++key_scan;
 6126|  16.5k|                           }
 6127|  17.2k|                        }
 6128|  2.70k|                        if (key_scan == end) {
  ------------------
  |  Branch (6128:29): [True: 8, False: 2.69k]
  ------------------
 6129|      8|                           ctx.error = error_code::syntax_error;
 6130|      8|                           return;
 6131|      8|                        }
 6132|  2.69k|                        ++key_scan; // past closing quote
 6133|  2.69k|                        key_end = key_scan;
 6134|  2.69k|                        yaml::skip_inline_ws(key_scan, end);
 6135|  2.69k|                     }
 6136|   137k|                     else {
 6137|       |                        // Plain key: scan to ':'
 6138|  2.35M|                        while (key_scan != end) {
  ------------------
  |  Branch (6138:32): [True: 2.35M, False: 7]
  ------------------
 6139|  2.35M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6139:32): [True: 261k, False: 2.09M]
  ------------------
 6140|   261k|                              auto next = key_scan + 1;
 6141|   261k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6141:35): [True: 15.8k, False: 245k]
  |  Branch (6141:50): [True: 100k, False: 144k]
  |  Branch (6141:66): [True: 4.26k, False: 139k]
  |  Branch (6141:83): [True: 9.99k, False: 129k]
  |  Branch (6141:100): [True: 6.36k, False: 123k]
  ------------------
 6142|   137k|                                 break;
 6143|   137k|                              }
 6144|   261k|                           }
 6145|  2.22M|                           ++key_scan;
 6146|  2.22M|                        }
 6147|   137k|                        key_end = key_scan;
 6148|   160k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6148:32): [True: 151k, False: 8.60k]
  |  Branch (6148:57): [True: 21.3k, False: 130k]
  |  Branch (6148:82): [True: 1.38k, False: 128k]
  ------------------
 6149|  22.7k|                           --key_end;
 6150|  22.7k|                        }
 6151|   137k|                     }
 6152|   140k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6152:26): [True: 8, False: 140k]
  |  Branch (6152:45): [True: 54, False: 140k]
  ------------------
 6153|     62|                        ctx.error = error_code::syntax_error;
 6154|     62|                        return;
 6155|     62|                     }
 6156|       |                     // Store anchor with just the key text span
 6157|   140k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6158|   140k|                     it = key_start;
 6159|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6160|   140k|                     if constexpr (counts::n_object > 0) {
 6161|   140k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|   140k|                                                                                                        end);
 6163|       |                     }
 6164|       |                     else {
 6165|       |                        redispatch<Opts>(value, ctx, it, end);
 6166|       |                     }
 6167|   140k|                     return;
 6168|   140k|                  }
 6169|   344k|               }
 6170|       |
 6171|   204k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|   344k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|   344k|               redispatch<Opts>(value, ctx, it, end);
 6174|   344k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|   344k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 190k, False: 154k]
  ------------------
 6176|   190k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|   190k|               }
 6178|   344k|               return;
 6179|   345k|            }
 6180|   273k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 273k, False: 1.92M]
  ------------------
 6181|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6182|   273k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6183|   273k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6183:23): [True: 19.9k, False: 254k]
  ------------------
 6184|  19.9k|                     if constexpr (counts::n_object > 0) {
 6185|  19.9k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6186|  19.9k|                                                                                                        end);
 6187|  19.9k|                        return;
 6188|       |                     }
 6189|       |                     else {
 6190|       |                        ctx.error = error_code::syntax_error;
 6191|       |                        return;
 6192|       |                     }
 6193|  19.9k|                  }
 6194|   273k|               }
 6195|       |
 6196|       |               // Alias value: look up anchor and replay
 6197|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   273k|               return;
 6199|   345k|            }
 6200|   218k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 218k, False: 1.97M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   218k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   218k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 330, False: 218k]
  ------------------
 6204|    330|                  ctx.error = error_code::syntax_error;
 6205|    330|                  return;
 6206|    330|               }
 6207|   218k|               yaml::skip_inline_ws(it, end);
 6208|   218k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 216k, False: 1.53k]
  |  Branch (6208:33): [True: 26.7k, False: 189k]
  ------------------
 6209|  26.7k|                  yaml::skip_comment(it, end);
 6210|  26.7k|               }
 6211|   218k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 215k, False: 2.47k]
  |  Branch (6211:34): [True: 40.7k, False: 174k]
  |  Branch (6211:49): [True: 28.5k, False: 146k]
  ------------------
 6212|  69.2k|                  auto content = it;
 6213|  69.2k|                  yaml::skip_newline(content, end);
 6214|  69.2k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|  69.2k|                  bool consume_following_content = false;
 6217|  69.2k|                  auto content_token = content;
 6218|  69.2k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 64.5k, False: 4.78k]
  ------------------
 6219|  64.5k|                     auto indent_probe = content;
 6220|  64.5k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  64.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 9, False: 64.5k]
  ------------------
 6222|      9|                        return;
 6223|  64.5k|                     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|  64.5k|                     bool tagged_indentless_sequence = false;
 6228|  64.5k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 7.34k, False: 57.1k]
  |  Branch (6228:56): [True: 7.34k, False: 0]
  |  Branch (6228:79): [True: 6.19k, False: 1.15k]
  ------------------
 6229|  6.19k|                        const auto after_dash = indent_probe + 1;
 6230|  6.19k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 731, False: 5.46k]
  ------------------
 6231|  5.48k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 4.74k, False: 716]
  ------------------
 6232|  5.48k|                           tagged_indentless_sequence =
 6233|  5.48k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 1.80k, False: 3.67k]
  ------------------
 6234|  3.67k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 1.82k, False: 1.85k]
  |  Branch (6234:60): [True: 1.43k, False: 393]
  ------------------
 6235|  5.48k|                        }
 6236|  6.19k|                     }
 6237|       |
 6238|  64.5k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 5.36k, False: 59.1k]
  ------------------
 6239|  59.1k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 13.6k, False: 45.5k]
  |  Branch (6239:93): [True: 3.23k, False: 42.2k]
  ------------------
 6240|  64.5k|                  }
 6241|       |
 6242|  69.2k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 22.2k, False: 47.0k]
  ------------------
 6243|  22.2k|                     it = content_token;
 6244|  22.2k|                  }
 6245|  47.0k|                  else {
 6246|  47.0k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 7.82k, False: 39.2k]
  ------------------
 6247|  7.82k|                        if constexpr (counts::n_str > 0) {
 6248|  7.82k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  7.82k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  7.82k|                           value = StrType{};
 6251|  7.82k|                           return;
 6252|  7.82k|                        }
 6253|  7.82k|                     }
 6254|  47.0k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 783, False: 46.2k]
  ------------------
 6255|    783|                        if constexpr (counts::n_null > 0) {
 6256|    783|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    783|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    783|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 783]
  ------------------
 6259|    783|                           return;
 6260|    783|                        }
 6261|    783|                     }
 6262|  47.0k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 36.7k, False: 10.3k]
  ------------------
 6263|  36.7k|                        if constexpr (counts::n_null > 0) {
 6264|  36.7k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  36.7k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  36.7k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 36.7k]
  ------------------
 6267|  36.7k|                           return;
 6268|  36.7k|                        }
 6269|  36.7k|                     }
 6270|  47.0k|                  }
 6271|  69.2k|               }
 6272|   218k|               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|   218k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6275:23): [True: 170k, False: 47.8k]
  |  Branch (6275:36): [True: 32, False: 170k]
  ------------------
 6276|     32|                     ctx.error = error_code::syntax_error;
 6277|     32|                     return;
 6278|     32|                  }
 6279|   218k|                  if constexpr (counts::n_object > 0) {
 6280|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6281|   218k|                     const bool starts_block_sequence_entry =
 6282|   218k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6282:26): [True: 170k, False: 47.8k]
  |  Branch (6282:39): [True: 10.7k, False: 159k]
  ------------------
 6283|  10.7k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6283:26): [True: 1.54k, False: 9.16k]
  |  Branch (6283:45): [True: 7.15k, False: 2.00k]
  ------------------
 6284|   218k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6284:26): [True: 163k, False: 54.0k]
  |  Branch (6284:58): [True: 43.6k, False: 120k]
  ------------------
 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|  43.6k|                        redispatch<Opts>(value, ctx, it, end);
 6288|  43.6k|                        return;
 6289|  43.6k|                     }
 6290|   218k|                  }
 6291|   218k|               }
 6292|   218k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 2.47k, False: 215k]
  ------------------
 6293|  2.47k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 794, False: 1.67k]
  ------------------
 6294|    794|                     if constexpr (counts::n_str > 0) {
 6295|    794|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|    794|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|    794|                        value = StrType{};
 6298|    794|                        return;
 6299|    794|                     }
 6300|    794|                  }
 6301|  2.47k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 1.64k, False: 825]
  ------------------
 6302|  1.64k|                     if constexpr (counts::n_null > 0) {
 6303|  1.64k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  1.64k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  1.64k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 1.64k]
  ------------------
 6306|  1.64k|                        return;
 6307|  1.64k|                     }
 6308|  1.64k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  2.47k|                  return;
 6311|  2.47k|               }
 6312|   215k|               switch (tag) {
 6313|  3.29k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 3.29k, False: 212k]
  ------------------
 6314|  3.29k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  3.29k|                  return;
 6316|  3.78k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 3.78k, False: 211k]
  ------------------
 6317|  4.22k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 437, False: 215k]
  ------------------
 6318|  4.22k|                  if constexpr (counts::n_num > 0) {
 6319|  4.22k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  4.22k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  31.1k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 26.9k, False: 188k]
  ------------------
 6327|  31.1k|                  if constexpr (counts::n_bool > 0) {
 6328|  31.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  31.1k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  32.0k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 905, False: 214k]
  ------------------
 6336|  32.0k|                  if constexpr (counts::n_null > 0) {
 6337|  32.0k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  32.0k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  32.0k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 32.0k]
  ------------------
 6340|  32.0k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  32.0k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|  47.0k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 14.9k, False: 200k]
  ------------------
 6348|  47.0k|                  if constexpr (counts::n_object > 0) {
 6349|  47.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|  47.0k|                                                                                                     end);
 6351|  47.0k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|  66.3k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 19.3k, False: 196k]
  ------------------
 6358|  66.3k|                  if constexpr (counts::n_array > 0) {
 6359|  66.3k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6360|  66.3k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6361|  66.3k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6361:29): [True: 19.3k, False: 47.0k]
  |  Branch (6361:42): [True: 5.62k, False: 13.7k]
  ------------------
 6362|  5.62k|                           ctx.allow_indentless_sequence = true;
 6363|  5.62k|                        }
 6364|  66.3k|                     }
 6365|  66.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|  66.3k|                                                                                                    end);
 6367|  66.3k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|  66.3k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   123k|               default: {
  ------------------
  |  Branch (6374:16): [True: 56.9k, False: 158k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   123k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 56.9k, False: 66.3k]
  |  Branch (6377:36): [True: 11.0k, False: 45.8k]
  ------------------
 6378|  11.0k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|  11.0k|                     return;
 6380|  11.0k|                  }
 6381|       |
 6382|   112k|                  if constexpr (counts::n_array > 0) {
 6383|   112k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 45.8k, False: 66.3k]
  |  Branch (6383:39): [True: 1.01k, False: 44.8k]
  ------------------
 6384|  1.01k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  1.01k|                                                                                                       end);
 6386|  1.01k|                        return;
 6387|  1.01k|                     }
 6388|   112k|                  }
 6389|   112k|                  if constexpr (counts::n_object > 0) {
 6390|   112k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 44.8k, False: 67.3k]
  |  Branch (6390:39): [True: 973, False: 43.8k]
  ------------------
 6391|    973|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|    973|                                                                                                        end);
 6393|    973|                        return;
 6394|    973|                     }
 6395|   112k|                  }
 6396|       |
 6397|   112k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6398|   112k|                     if constexpr (counts::n_array > 0) {
 6399|   112k|                        const bool starts_block_sequence_entry =
 6400|   112k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6400:29): [True: 43.8k, False: 68.3k]
  |  Branch (6400:42): [True: 3.99k, False: 39.8k]
  ------------------
 6401|  3.99k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6401:29): [True: 810, False: 3.18k]
  |  Branch (6401:48): [True: 2.33k, False: 848]
  ------------------
 6402|   112k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6402:29): [True: 3.14k, False: 109k]
  ------------------
 6403|  3.14k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6404|  3.14k|                                                                                                          it, end);
 6405|  3.14k|                           return;
 6406|  3.14k|                        }
 6407|   112k|                     }
 6408|   112k|                     if constexpr (counts::n_object > 0) {
 6409|   112k|                        const bool starts_explicit_mapping_indicator =
 6410|   112k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6410:29): [True: 40.7k, False: 71.4k]
  |  Branch (6410:43): [True: 4.32k, False: 36.4k]
  |  Branch (6410:57): [True: 1.73k, False: 34.6k]
  ------------------
 6411|  6.05k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6411:29): [True: 971, False: 5.08k]
  |  Branch (6411:48): [True: 3.13k, False: 1.95k]
  ------------------
 6412|   112k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6412:29): [True: 4.10k, False: 108k]
  ------------------
 6413|  4.10k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6414|  4.10k|                                                                                                           it, end);
 6415|  4.10k|                           return;
 6416|  4.10k|                        }
 6417|   108k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6417:29): [True: 0, False: 108k]
  ------------------
 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|   108k|                     }
 6423|   112k|                  }
 6424|       |
 6425|   112k|                  if constexpr (counts::n_str > 0) {
 6426|   112k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   112k|                     return;
 6428|   112k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   112k|                  return;
 6433|   123k|               }
 6434|   215k|               }
 6435|      0|               return;
 6436|   215k|            }
 6437|  63.6k|            case '{':
  ------------------
  |  Branch (6437:13): [True: 63.6k, False: 2.13M]
  ------------------
 6438|  63.6k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6439|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6440|  63.6k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6440:23): [True: 28.6k, False: 35.0k]
  |  Branch (6440:51): [True: 2.29k, False: 26.3k]
  ------------------
 6441|  2.29k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6442|  2.29k|                                                                                                     end);
 6443|  2.29k|                     return;
 6444|  2.29k|                  }
 6445|  63.6k|               }
 6446|       |               // Flow mapping - object type
 6447|  61.3k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6448|  63.6k|               return;
 6449|  87.6k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 87.6k, False: 2.10M]
  ------------------
 6450|  87.6k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6451|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6452|  87.6k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6452:23): [True: 58.5k, False: 29.1k]
  |  Branch (6452:51): [True: 1.54k, False: 56.9k]
  ------------------
 6453|  1.54k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6454|  1.54k|                                                                                                     end);
 6455|  1.54k|                     return;
 6456|  1.54k|                  }
 6457|  87.6k|               }
 6458|       |               // Flow sequence - array type
 6459|  86.1k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|  87.6k|               return;
 6461|   271k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 271k, False: 1.92M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   271k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 271k, False: 871]
  |  Branch (6463:39): [True: 9, False: 271k]
  ------------------
 6464|      9|                  ctx.error = error_code::syntax_error;
 6465|      9|                  return;
 6466|      9|               }
 6467|   271k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 271k, False: 871]
  |  Branch (6467:40): [True: 87.0k, False: 183k]
  |  Branch (6467:56): [True: 78.5k, False: 105k]
  |  Branch (6467:73): [True: 80.6k, False: 24.8k]
  ------------------
 6468|   246k|                  if constexpr (counts::n_object > 0) {
 6469|   246k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   246k|                                                                                                     end);
 6471|   246k|                     return;
 6472|   246k|                  }
 6473|   246k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   271k|               return;
 6476|     27|            case '%':
  ------------------
  |  Branch (6476:13): [True: 27, False: 2.19M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     27|               ctx.error = error_code::syntax_error;
 6479|     27|               return;
 6480|  5.31k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 5.31k, False: 2.19M]
  ------------------
 6481|  8.22k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 2.90k, False: 2.19M]
  ------------------
 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.22k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  8.22k|               return;
 6486|  32.2k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 32.2k, False: 2.16M]
  ------------------
 6487|  45.2k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 13.0k, False: 2.18M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  45.2k|               if constexpr (counts::n_bool > 0) {
 6490|  45.2k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 43.6k, False: 1.62k]
  |  Branch (6490:44): [True: 35.9k, False: 7.66k]
  |  Branch (6490:60): [True: 32.6k, False: 3.31k]
  |  Branch (6490:76): [True: 30.0k, False: 2.67k]
  ------------------
 6491|  32.5k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 4.17k, False: 9.47k]
  |  Branch (6491:60): [True: 3.33k, False: 838]
  |  Branch (6491:76): [True: 2.54k, False: 794]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  32.5k|                     const auto after_true = it + 4;
 6494|  32.5k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  32.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 31.0k, False: 1.54k]
  ------------------
 6497|  31.0k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 745, False: 30.2k]
  ------------------
 6498|    745|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6499|    745|                           return;
 6500|    745|                        }
 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.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 25.4k, False: 4.78k]
  |  Branch (6503:47): [True: 11.0k, False: 14.3k]
  ------------------
 6504|  11.0k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 6.97k, False: 4.12k]
  |  Branch (6504:47): [True: 1.50k, False: 2.62k]
  |  Branch (6504:63): [True: 783, False: 1.84k]
  |  Branch (6504:80): [True: 802, False: 1.03k]
  |  Branch (6504:97): [True: 1.03k, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  11.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  11.0k|                           return;
 6508|  11.0k|                        }
 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|  30.2k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  32.5k|                  }
 6515|  45.2k|               }
 6516|  14.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  45.2k|               return;
 6518|  30.5k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 30.5k, False: 2.16M]
  ------------------
 6519|  52.5k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 21.9k, False: 2.17M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  52.5k|               if constexpr (counts::n_bool > 0) {
 6522|  52.5k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 51.4k, False: 1.09k]
  |  Branch (6522:44): [True: 36.3k, False: 15.1k]
  |  Branch (6522:60): [True: 34.1k, False: 2.12k]
  |  Branch (6522:76): [True: 26.9k, False: 7.25k]
  |  Branch (6522:92): [True: 24.7k, False: 2.13k]
  ------------------
 6523|  26.6k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 5.16k, False: 21.4k]
  |  Branch (6523:60): [True: 3.94k, False: 1.21k]
  |  Branch (6523:76): [True: 2.74k, False: 1.20k]
  |  Branch (6523:92): [True: 1.86k, False: 888]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  26.6k|                     const auto after_false = it + 5;
 6526|  26.6k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  26.6k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 24.1k, False: 2.49k]
  ------------------
 6529|  24.1k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 1.54k, False: 22.6k]
  ------------------
 6530|  1.54k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6531|  1.54k|                           return;
 6532|  1.54k|                        }
 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|  22.6k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 22.2k, False: 367]
  |  Branch (6535:47): [True: 5.34k, False: 16.8k]
  ------------------
 6536|  5.34k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 761, False: 4.58k]
  |  Branch (6536:47): [True: 654, False: 3.93k]
  |  Branch (6536:63): [True: 1.46k, False: 2.46k]
  |  Branch (6536:80): [True: 782, False: 1.68k]
  |  Branch (6536:97): [True: 1.68k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  5.34k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  5.34k|                           return;
 6540|  5.34k|                        }
 6541|  17.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  17.2k|                                                                                                      end);
 6543|  17.2k|                        return;
 6544|  22.6k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  26.6k|                  }
 6547|  52.5k|               }
 6548|  28.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  52.5k|               return;
 6550|  13.9k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 13.9k, False: 2.18M]
  ------------------
 6551|  53.0k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 39.0k, False: 2.15M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  53.0k|               if constexpr (counts::n_null > 0) {
 6554|  53.0k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 52.0k, False: 1.00k]
  |  Branch (6554:44): [True: 18.3k, False: 33.6k]
  |  Branch (6554:60): [True: 16.3k, False: 1.99k]
  |  Branch (6554:76): [True: 15.5k, False: 870]
  ------------------
 6555|  43.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 30.3k, False: 6.09k]
  |  Branch (6555:60): [True: 29.1k, False: 1.29k]
  |  Branch (6555:76): [True: 28.3k, False: 736]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  43.8k|                     const auto after_null = it + 4;
 6558|  43.8k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  43.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 37.3k, False: 6.56k]
  ------------------
 6561|  37.3k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 789, False: 36.5k]
  ------------------
 6562|    789|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6563|    789|                           return;
 6564|    789|                        }
 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|  36.5k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 35.2k, False: 1.24k]
  |  Branch (6567:47): [True: 5.41k, False: 29.8k]
  ------------------
 6568|  5.41k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 781, False: 4.63k]
  |  Branch (6568:47): [True: 1.10k, False: 3.53k]
  |  Branch (6568:63): [True: 1.62k, False: 1.90k]
  |  Branch (6568:80): [True: 1.11k, False: 787]
  |  Branch (6568:97): [True: 787, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  5.41k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  5.41k|                           return;
 6572|  5.41k|                        }
 6573|  31.1k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  31.1k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  31.1k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 31.1k]
  ------------------
 6576|  31.1k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  31.1k|                        return;
 6578|  36.5k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  43.8k|                  }
 6581|  53.0k|               }
 6582|  15.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  53.0k|               return;
 6584|  4.12k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 4.12k, False: 2.19M]
  ------------------
 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|   132k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 132k, False: 2.06M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   132k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 1.79k, False: 130k]
  |  Branch (6596:41): [True: 100k, False: 30.1k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   102k|                  if constexpr (counts::n_array > 0) {
 6599|   102k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   102k|                                                                                                    end);
 6601|   102k|                     return;
 6602|   102k|                  }
 6603|   102k|               }
 6604|   132k|               if constexpr (counts::n_num > 0) {
 6605|   132k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 30.1k, False: 102k]
  |  Branch (6605:43): [True: 2.27k, False: 27.8k]
  |  Branch (6605:94): [True: 2.64k, False: 25.2k]
  ------------------
 6606|  4.92k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  4.92k|                     return;
 6608|  4.92k|                  }
 6609|   132k|               }
 6610|   127k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   132k|               return;
 6612|  10.1k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 10.1k, False: 2.18M]
  ------------------
 6613|  32.4k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 22.2k, False: 2.17M]
  ------------------
 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|  32.4k|               if constexpr (counts::n_num > 0) {
 6617|  32.4k|                  auto start_it = it;
 6618|  32.4k|                  auto temp_ctx = ctx.make_speculative();
 6619|  32.4k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  32.4k|                                                                                               end);
 6621|  32.4k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  32.4k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  32.4k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 10.1k, False: 22.3k]
  ------------------
 6624|  10.1k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  10.1k|                     return; // Successfully parsed as number
 6626|  10.1k|                  }
 6627|  22.3k|                  it = start_it; // Restore and fall through to string
 6628|  22.3k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  32.4k|               return;
 6631|   580k|            default:
  ------------------
  |  Branch (6631:13): [True: 580k, False: 1.61M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|   580k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 329k, False: 251k]
  |  Branch (6633:32): [True: 75.8k, False: 253k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  75.8k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 25.2k, False: 50.6k]
  ------------------
 6636|  25.2k|                     return;
 6637|  25.2k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  50.6k|                  if constexpr (counts::n_num > 0) {
 6640|  50.6k|                     auto start_it = it;
 6641|  50.6k|                     auto temp_ctx = ctx.make_speculative();
 6642|  50.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  50.6k|                                                                                                  end);
 6644|  50.6k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  50.6k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  50.6k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 6.75k, False: 43.8k]
  ------------------
 6647|  6.75k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  6.75k|                        return; // Successfully parsed as number
 6649|  6.75k|                     }
 6650|  43.8k|                     it = start_it; // Restore and fall through to string
 6651|  43.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|  50.6k|                  return;
 6655|  75.8k|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   504k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   504k|               return;
 6659|  2.19M|            }
 6660|  2.19M|         }
 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.19M|         error_code expansion_error{};
 6670|  2.19M|         std::string_view expansion_message{};
 6671|       |
 6672|  2.19M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  2.19M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  2.19M|            auto start = it;
 6675|       |
 6676|  2.19M|            V v{};
 6677|  2.19M|            auto temp_ctx = ctx.make_speculative();
 6678|  2.19M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  2.19M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  2.19M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  2.19M|            if (!bool(temp_ctx.error)) {
 6683|  2.19M|               value = std::move(v);
 6684|  2.19M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  2.19M|               return true;
 6686|  2.19M|            }
 6687|       |
 6688|  2.19M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  2.19M|               expansion_error = temp_ctx.error;
 6690|  2.19M|               expansion_message = temp_ctx.custom_error_message;
 6691|  2.19M|            }
 6692|  2.19M|            it = start;
 6693|  2.19M|            return false;
 6694|  2.19M|         };
 6695|       |
 6696|  2.19M|         bool parsed = false;
 6697|  2.19M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  2.19M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  2.19M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  2.19M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 2.19M]
  ------------------
 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.19M|      }
_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|   906k|      {
 5311|   906k|         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|   906k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   906k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   906k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   906k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 906k, False: 0]
  ------------------
 5321|   906k|            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|   906k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4616|   915k|      {
 4617|   915k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 915k]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|   915k|         yaml::node_preamble_state preamble{};
 4621|   915k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 11.9k, False: 903k]
  ------------------
 4622|   915k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  11.9k|            return;
 4624|       |
 4625|   903k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|   903k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 18, False: 903k]
  ------------------
 4627|     18|            return;
 4628|       |
 4629|   903k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|   903k|         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|   903k|         std::remove_cvref_t<T> preexisting_entries;
 4643|   903k|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 903k]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|   903k|         struct merge_restore_guard
 4648|   903k|         {
 4649|   903k|            std::remove_cvref_t<T>& target;
 4650|   903k|            std::remove_cvref_t<T>& saved;
 4651|   903k|            ~merge_restore_guard()
 4652|   903k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   903k|               for (auto& entry : saved) {
 4656|   903k|                  target.emplace(entry.first, std::move(entry.second));
 4657|   903k|               }
 4658|   903k|            }
 4659|   903k|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|   903k|         const bool treat_as_block_mapping =
 4662|   903k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [True: 903k, Folded]
  |  Branch (4662:48): [True: 75.4k, False: 827k]
  |  Branch (4662:62): [True: 1.11k, False: 74.3k]
  ------------------
 4663|       |
 4664|   903k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 75.4k, False: 827k]
  |  Branch (4664:28): [True: 74.3k, False: 1.11k]
  ------------------
 4665|       |            // Flow mapping
 4666|  74.3k|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  74.3k|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  74.3k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 72.6k, False: 1.77k]
  |  Branch (4670:30): [True: 12.2k, False: 60.4k]
  ------------------
 4671|  12.2k|               ++it;
 4672|  12.2k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  12.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 51, False: 12.1k]
  ------------------
 4674|     51|                  return;
 4675|  12.1k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  12.1k|               return;
 4677|  12.2k|            }
 4678|       |
 4679|   219k|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 213k, False: 5.97k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|   213k|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|   213k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 213k, False: 0]
  |  Branch (4683:33): [True: 9.50k, False: 203k]
  ------------------
 4684|  9.50k|                  ++it;
 4685|  9.50k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  9.50k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 49, False: 9.45k]
  ------------------
 4687|     49|                     return;
 4688|  9.45k|                  break;
 4689|  9.50k|               }
 4690|       |
 4691|   203k|               bool explicit_flow_key = false;
 4692|   203k|               auto explicit_probe = it;
 4693|   203k|               yaml::skip_inline_ws(explicit_probe, end);
 4694|   203k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 203k, False: 0]
  |  Branch (4694:45): [True: 7.53k, False: 196k]
  ------------------
 4695|  7.53k|                  const auto after_q = explicit_probe + 1;
 4696|  7.53k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 10, False: 7.52k]
  |  Branch (4696:41): [True: 3.00k, False: 4.52k]
  ------------------
 4697|  5.43k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 1.22k, False: 3.30k]
  |  Branch (4697:42): [True: 1.19k, False: 2.10k]
  ------------------
 4698|  5.43k|                     explicit_flow_key = true;
 4699|  5.43k|                     it = explicit_probe + 1;
 4700|  5.43k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  5.43k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 6, False: 5.42k]
  ------------------
 4702|      6|                        return;
 4703|  5.43k|                  }
 4704|  7.53k|               }
 4705|       |               // Parse key
 4706|   203k|               key_t key{};
 4707|   203k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|   203k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 5.42k, False: 198k]
  |  Branch (4708:44): [True: 5.40k, False: 22]
  |  Branch (4708:58): [True: 725, False: 4.67k]
  |  Branch (4708:72): [True: 1.98k, False: 2.69k]
  |  Branch (4708:86): [True: 1.42k, False: 1.27k]
  ------------------
 4709|  4.13k|                     key.clear();
 4710|  4.13k|                  }
 4711|   199k|                  else {
 4712|   199k|                     auto key_probe = it;
 4713|   199k|                     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|   199k|                     bool parse_complex_flow_key = false;
 4718|   199k|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 199k, False: 22]
  ------------------
 4719|   199k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 2.05k, False: 197k]
  |  Branch (4719:50): [True: 8.36k, False: 189k]
  ------------------
 4720|  10.4k|                           parse_complex_flow_key = true;
 4721|  10.4k|                        }
 4722|   189k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 20.6k, False: 168k]
  ------------------
 4723|  20.6k|                           ++key_probe;
 4724|  20.6k|                           yaml::parse_anchor_name(key_probe, end);
 4725|  20.6k|                           yaml::skip_inline_ws(key_probe, end);
 4726|  20.6k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 20.4k, False: 160]
  |  Branch (4726:53): [True: 1.18k, False: 19.2k]
  |  Branch (4726:74): [True: 1.70k, False: 17.5k]
  ------------------
 4727|  2.88k|                              parse_complex_flow_key = true;
 4728|  2.88k|                           }
 4729|  20.6k|                        }
 4730|   199k|                     }
 4731|       |
 4732|   199k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 13.3k, False: 186k]
  ------------------
 4733|  13.3k|                        glz::generic key_node{};
 4734|  13.3k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|  13.3k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 2.97k, False: 10.3k]
  ------------------
 4736|  2.97k|                           return;
 4737|  10.3k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 9, False: 10.3k]
  ------------------
 4738|      9|                           return;
 4739|  10.3k|                     }
 4740|   186k|                     else {
 4741|   186k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 7.07k, False: 179k]
  ------------------
 4742|  7.07k|                           return;
 4743|  7.07k|                        }
 4744|   186k|                     }
 4745|   199k|                  }
 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|   193k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|   203k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 23, False: 203k]
  ------------------
 4761|     23|                  return;
 4762|       |
 4763|   203k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|   203k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|   203k|                     val = {};
 4766|   203k|                     return true;
 4767|   203k|                  }
 4768|   203k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   203k|                     val = glz::generic{};
 4770|   203k|                     return true;
 4771|   203k|                  }
 4772|   203k|                  else {
 4773|   203k|                     static constexpr std::string_view null_value{"null"};
 4774|   203k|                     auto null_it = null_value.data();
 4775|   203k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|   203k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|   203k|                     return !bool(ctx.error);
 4778|   203k|                  }
 4779|   203k|               };
 4780|       |
 4781|   203k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 192k, False: 11.2k]
  |  Branch (4781:34): [True: 119k, False: 72.5k]
  |  Branch (4781:48): [True: 17.2k, False: 55.2k]
  ------------------
 4782|   137k|                  val_t val{};
 4783|   137k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 137k]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|   137k|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|   137k|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 17.2k, False: 119k]
  ------------------
 4789|  17.2k|                     ++it;
 4790|  17.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|  17.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 110, False: 17.1k]
  ------------------
 4792|    110|                        return;
 4793|  17.1k|                     break;
 4794|  17.2k|                  }
 4795|       |
 4796|   119k|                  ++it; // skip comma
 4797|   119k|                  yaml::skip_ws_and_newlines(it, end);
 4798|   119k|                  continue;
 4799|   137k|               }
 4800|       |
 4801|  66.5k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 11.2k, False: 55.2k]
  |  Branch (4801:33): [True: 1.01k, False: 54.2k]
  ------------------
 4802|  2.20k|                  ctx.error = error_code::syntax_error;
 4803|  2.20k|                  return;
 4804|  2.20k|               }
 4805|  64.3k|               ++it;
 4806|       |
 4807|  64.3k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  64.3k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 12, False: 64.3k]
  ------------------
 4809|     12|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  64.3k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 54.1k, False: 10.1k]
  |  Branch (4812:34): [True: 9.93k, False: 44.2k]
  |  Branch (4812:48): [True: 9.46k, False: 34.7k]
  ------------------
 4813|  19.3k|                  val_t val{};
 4814|  19.3k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 19.3k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|  19.3k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|  19.3k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 9.46k, False: 9.93k]
  ------------------
 4820|  9.46k|                     ++it;
 4821|  9.46k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  9.46k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 16, False: 9.44k]
  ------------------
 4823|     16|                        return;
 4824|  9.44k|                     break;
 4825|  9.46k|                  }
 4826|       |
 4827|  9.93k|                  ++it; // skip comma
 4828|  9.93k|                  yaml::skip_ws_and_newlines(it, end);
 4829|  9.93k|                  continue;
 4830|  19.3k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  44.9k|               val_t val{};
 4834|  44.9k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  44.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 1.49k, False: 43.4k]
  ------------------
 4836|  1.49k|                  return;
 4837|       |
 4838|  43.4k|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  43.4k|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  43.4k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 33.0k, False: 10.3k]
  |  Branch (4842:33): [True: 4.65k, False: 28.4k]
  ------------------
 4843|  4.65k|                  ++it;
 4844|  4.65k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|  4.65k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 64, False: 4.59k]
  ------------------
 4846|     64|                     return;
 4847|  4.59k|                  break;
 4848|  4.65k|               }
 4849|  38.7k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 28.4k, False: 10.3k]
  |  Branch (4849:38): [True: 23.9k, False: 4.44k]
  ------------------
 4850|  23.9k|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  23.9k|                  yaml::skip_ws_and_newlines(it, end);
 4853|  23.9k|               }
 4854|  14.7k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 4.44k, False: 10.3k]
  |  Branch (4854:39): [True: 2.08k, False: 2.35k]
  |  Branch (4854:54): [True: 2.11k, False: 236]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  4.20k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  4.20k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 4.13k, False: 74]
  |  Branch (4858:36): [True: 832, False: 3.29k]
  ------------------
 4859|    832|                     ++it;
 4860|    832|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|    832|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 6, False: 826]
  ------------------
 4862|      6|                        return;
 4863|    826|                     break;
 4864|    832|                  }
 4865|  3.37k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 3.29k, False: 74]
  |  Branch (4865:36): [True: 3.19k, False: 108]
  ------------------
 4866|  3.19k|                     ++it;
 4867|  3.19k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  3.19k|                     continue;
 4869|  3.19k|                  }
 4870|    182|                  ctx.error = error_code::syntax_error;
 4871|    182|                  return;
 4872|  3.37k|               }
 4873|  10.5k|               else {
 4874|  10.5k|                  ctx.error = error_code::syntax_error;
 4875|  10.5k|                  return;
 4876|  10.5k|               }
 4877|  43.4k|            }
 4878|  62.1k|         }
 4879|   828k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   828k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   828k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   828k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   828k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   828k|                        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|   828k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   828k|                           if (ctx.stream_begin) {
 4893|   828k|                              auto is_line_content_start = [&](auto pos) {
 4894|   828k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   828k|                              };
 4896|       |
 4897|   828k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   828k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   828k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   828k|                                 return line != end && *line == ':';
 4901|   828k|                              };
 4902|       |
 4903|   828k|                              if (!is_line_content_start(it) &&
 4904|   828k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   828k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   828k|                                 ctx.error = error_code::syntax_error;
 4907|   828k|                                 return false;
 4908|   828k|                              }
 4909|   828k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   828k|                           }
 4911|   828k|                        }
 4912|       |
 4913|   828k|                        if (*it == '-' &&
 4914|   828k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   828k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   828k|                           ctx.error = error_code::syntax_error;
 4918|   828k|                           return false;
 4919|   828k|                        }
 4920|       |
 4921|   828k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   828k|                           return false;
 4923|   828k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   828k|                        ctx.pop_indent();
 4925|   828k|                     }
 4926|   828k|                     else {
 4927|   828k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   828k|                        if (nested_indent >= 0) {
 4929|   828k|                           yaml::skip_to_content(it, end);
 4930|   828k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   828k|                              ctx.error = error_code::syntax_error;
 4932|   828k|                              return false;
 4933|   828k|                           }
 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|   828k|                           const int32_t value_indent =
 4937|   828k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   828k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   828k|                              return false;
 4940|   828k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   828k|                           ctx.pop_indent();
 4942|   828k|                        }
 4943|   828k|                     }
 4944|   828k|                     return !bool(ctx.error);
 4945|   828k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   828k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   828k|                     ctx.error = error_code::syntax_error;
 4952|   828k|                     return false;
 4953|   828k|                  }
 4954|   828k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   828k|                     ++it; // skip '?'
 4956|   828k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   828k|                     const int32_t explicit_value_indicator_indent =
 4959|   828k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   828k|                     key_t key{};
 4962|   828k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   828k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   828k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   828k|                        };
 4966|       |
 4967|   828k|                        auto key_it = it;
 4968|   828k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   828k|                        auto content = key_it;
 4971|   828k|                        yaml::skip_to_content(content, end);
 4972|   828k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   828k|                        if (content != end && *content == '&') {
 4978|   828k|                           auto anchor_probe = content + 1;
 4979|   828k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   828k|                           if (!anchor_name.empty()) {
 4981|   828k|                              auto after_anchor = anchor_probe;
 4982|   828k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   828k|                              auto value_indicator = after_anchor;
 4985|   828k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   828k|                                 key.clear();
 4987|   828k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   828k|                                 it = value_indicator;
 4989|   828k|                                 handled_anchor_only_empty_key = true;
 4990|   828k|                              }
 4991|   828k|                              else {
 4992|   828k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   828k|                                    yaml::skip_comment(value_indicator, end);
 4994|   828k|                                 }
 4995|   828k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   828k|                                    yaml::skip_newline(value_indicator, end);
 4997|   828k|                                    auto value_line = value_indicator;
 4998|   828k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   828k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   828k|                                       return false;
 5001|   828k|                                    if (value_line != end && *value_line == ':' &&
 5002|   828k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   828k|                                       key.clear();
 5004|   828k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   828k|                                       it = value_line;
 5006|   828k|                                       handled_anchor_only_empty_key = true;
 5007|   828k|                                    }
 5008|   828k|                                    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|   828k|                                       ctx.error = error_code::syntax_error;
 5013|   828k|                                       return false;
 5014|   828k|                                    }
 5015|   828k|                                 }
 5016|   828k|                              }
 5017|   828k|                           }
 5018|   828k|                        }
 5019|       |
 5020|   828k|                        const bool key_content_spans_lines = [&] {
 5021|   828k|                           auto scan = key_it;
 5022|   828k|                           while (scan != content && scan != end) {
 5023|   828k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   828k|                              ++scan;
 5025|   828k|                           }
 5026|   828k|                           return false;
 5027|   828k|                        }();
 5028|       |
 5029|   828k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   828k|                        }
 5032|   828k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   828k|                           key.clear();
 5034|   828k|                           it = content;
 5035|   828k|                        }
 5036|   828k|                        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|   828k|                           auto key_node_it = content;
 5042|   828k|                           auto key_node_end = end;
 5043|   828k|                           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|   828k|                              auto scan = content;
 5048|   828k|                              while (scan != end) {
 5049|   828k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   828k|                                    ++scan;
 5051|   828k|                                 }
 5052|   828k|                                 if (scan == end) {
 5053|   828k|                                    break;
 5054|   828k|                                 }
 5055|       |
 5056|   828k|                                 yaml::skip_newline(scan, end);
 5057|   828k|                                 auto line_start = scan;
 5058|       |
 5059|   828k|                                 int32_t indicator_indent = 0;
 5060|   828k|                                 while (scan != end && *scan == ' ') {
 5061|   828k|                                    ++indicator_indent;
 5062|   828k|                                    ++scan;
 5063|   828k|                                 }
 5064|       |
 5065|   828k|                                 if (scan != end && *scan == ':') {
 5066|   828k|                                    const auto after_colon = scan + 1;
 5067|   828k|                                    if ((after_colon == end ||
 5068|   828k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   828k|                                        indicator_indent <= line_indent) {
 5070|   828k|                                       key_node_end = line_start;
 5071|   828k|                                       break;
 5072|   828k|                                    }
 5073|   828k|                                 }
 5074|   828k|                              }
 5075|   828k|                           }
 5076|       |
 5077|   828k|                           glz::generic key_node{};
 5078|   828k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   828k|                           ctx.explicit_mapping_key_context = true;
 5080|   828k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   828k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   828k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   828k|                              return false;
 5084|   828k|                           it = key_node_it;
 5085|   828k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   828k|                              return false;
 5087|   828k|                        }
 5088|   828k|                     }
 5089|   828k|                     else {
 5090|   828k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   828k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   828k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   828k|                              return false;
 5094|   828k|                        }
 5095|   828k|                     }
 5096|       |
 5097|   828k|                     yaml::skip_inline_ws(it, end);
 5098|   828k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   828k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   828k|                        auto probe = it;
 5103|   828k|                        bool found_value_indicator = false;
 5104|       |
 5105|   828k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   828k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   828k|                           auto value_line = probe;
 5109|   828k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   828k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   828k|                              return false;
 5112|       |
 5113|   828k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   828k|                              probe = value_line;
 5115|   828k|                              continue; // blank line
 5116|   828k|                           }
 5117|   828k|                           if (*value_line == '#') {
 5118|   828k|                              yaml::skip_comment(value_line, end);
 5119|   828k|                              probe = value_line;
 5120|   828k|                              continue; // comment-only line
 5121|   828k|                           }
 5122|   828k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   828k|                              it = value_line;
 5124|   828k|                              found_value_indicator = true;
 5125|   828k|                           }
 5126|   828k|                           break;
 5127|   828k|                        }
 5128|       |
 5129|   828k|                        if (found_value_indicator) {
 5130|   828k|                           yaml::skip_inline_ws(it, end);
 5131|   828k|                        }
 5132|   828k|                     }
 5133|       |
 5134|   828k|                     val_t val{};
 5135|   828k|                     if (it != end && *it == ':') {
 5136|   828k|                        ++it;
 5137|   828k|                        if (it != end && *it == '\t') {
 5138|   828k|                           ctx.error = error_code::syntax_error;
 5139|   828k|                           return false;
 5140|   828k|                        }
 5141|   828k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   828k|                           auto probe = it;
 5143|   828k|                           yaml::skip_newline(probe, end);
 5144|   828k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   828k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   828k|                              ctx.error = error_code::syntax_error;
 5147|   828k|                              return false;
 5148|   828k|                           }
 5149|   828k|                        }
 5150|   828k|                        yaml::skip_inline_ws(it, end);
 5151|   828k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   828k|                           return false;
 5153|   828k|                     }
 5154|       |
 5155|   828k|                     value.emplace(std::move(key), std::move(val));
 5156|   828k|                     return true;
 5157|   828k|                  }
 5158|       |
 5159|   828k|                  key_t key{};
 5160|   828k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   828k|                     auto key_probe = it;
 5162|   828k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   828k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   828k|                     if (complex_flow_key) {
 5165|   828k|                        glz::generic key_node{};
 5166|   828k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   828k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   828k|                           return false;
 5169|   828k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   828k|                           return false;
 5171|   828k|                     }
 5172|   828k|                     else {
 5173|   828k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   828k|                           return false;
 5175|   828k|                        }
 5176|   828k|                     }
 5177|   828k|                  }
 5178|   828k|                  else {
 5179|   828k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   828k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   828k|                        return false;
 5182|   828k|                  }
 5183|       |
 5184|   828k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   828k|                  if (it == end || *it != ':') {
 5187|   828k|                     ctx.error = error_code::syntax_error;
 5188|   828k|                     return false;
 5189|   828k|                  }
 5190|   828k|                  ++it;
 5191|   828k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   828k|                  val_t val{};
 5194|   828k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   828k|                     return false;
 5196|       |
 5197|   828k|                  value.emplace(std::move(key), std::move(val));
 5198|   828k|                  return true;
 5199|   828k|               });
 5200|   828k|         }
 5201|       |
 5202|   876k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|   876k|      }
_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|   915k|      {
  466|   915k|         skip_inline_ws(it, end);
  467|       |
  468|   915k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 915k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|   915k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   915k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 915k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|   915k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 915k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   915k|         skip_inline_ws(it, end);
  486|       |
  487|   915k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 13, False: 915k]
  ------------------
  488|     13|            if constexpr (!AllowEmptyInput) {
  489|     13|               ctx.error = error_code::unexpected_end;
  490|     13|            }
  491|     13|            return true;
  492|     13|         }
  493|       |
  494|   915k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.9k, False: 903k]
  ------------------
  495|  11.9k|            return true;
  496|  11.9k|         }
  497|       |
  498|   903k|         return false;
  499|   915k|      }
_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|   915k|                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|   915k|      {
  409|   915k|         state.has_anchor = false;
  410|   915k|         state.anchor_name.clear();
  411|   915k|         state.anchor_start = nullptr;
  412|   915k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   915k|         if constexpr (Policy.allow_alias) {
  415|   915k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   915k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 893k, False: 21.9k]
  ------------------
  417|   893k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 11.8k, False: 881k]
  ------------------
  418|   893k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   915k|         }
  424|       |
  425|   915k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 903k, False: 11.8k]
  |  Branch (425:27): [True: 63.9k, False: 839k]
  ------------------
  426|  63.9k|            ++it;
  427|  63.9k|            auto name = parse_anchor_name(it, end);
  428|  63.9k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 43, False: 63.9k]
  ------------------
  429|     43|               ctx.error = error_code::syntax_error;
  430|     43|               return true;
  431|     43|            }
  432|  63.9k|            skip_inline_ws(it, end);
  433|  63.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 13, False: 63.9k]
  ------------------
  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|  63.9k|            state.has_anchor = true;
  446|  63.9k|            state.anchor_name = std::string(name);
  447|  63.9k|            state.anchor_start = &*it;
  448|  63.9k|         }
  449|       |
  450|   915k|         return false;
  451|   915k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   893k|      {
  301|   893k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 893k]
  |  Branch (301:27): [True: 881k, False: 11.8k]
  ------------------
  302|       |
  303|  11.8k|         ++it; // skip '*'
  304|  11.8k|         auto name = parse_anchor_name(it, end);
  305|  11.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 33, False: 11.8k]
  ------------------
  306|     33|            ctx.error = error_code::syntax_error;
  307|     33|            return true;
  308|     33|         }
  309|       |
  310|  11.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 96, False: 11.7k]
  ------------------
  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|  11.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.73k, False: 9.01k]
  ------------------
  322|  2.73k|            return true;
  323|  2.73k|         }
  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.01k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 48, False: 8.96k]
  ------------------
  329|     48|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     48|            return true;
  331|     48|         }
  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.96k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.96k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 8.95k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  8.95k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 8.95k]
  ------------------
  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.95k|         auto replay_it = span.begin;
  348|  8.95k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.95k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.95k|         ctx.indent_stack.clear();
  353|  8.95k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 7.10k, False: 1.84k]
  ------------------
  354|  7.10k|            ctx.push_indent(span.base_indent - 1);
  355|  7.10k|         }
  356|       |
  357|  8.95k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.95k|         using V = std::remove_cvref_t<T>;
  360|  8.95k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.95k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.95k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.95k|         return true;
  367|  8.95k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  5.96M|      {
  275|  5.96M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  5.96M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  5.96M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  5.96M|      }
_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|  8.13M|      {
 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|  8.13M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5756|  8.13M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5757|  8.13M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5758|  8.13M|                       "the internally tagged shape, so it is rejected here instead.");
 5759|  8.13M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5759:14): [True: 0, False: 8.13M]
  ------------------
 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|  8.13M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5768:14): [True: 6.69M, False: 1.44M]
  ------------------
 5769|  6.69M|            yaml::skip_ws_newlines_comments(it, end);
 5770|  6.69M|         }
 5771|  1.44M|         else {
 5772|  1.44M|            yaml::skip_inline_ws(it, end);
 5773|  1.44M|         }
 5774|       |
 5775|  8.13M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5775:14): [True: 467, False: 8.13M]
  ------------------
 5776|    467|            ctx.error = error_code::unexpected_end;
 5777|    467|            return;
 5778|    467|         }
 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|  8.13M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5885|  8.13M|            using V = std::remove_cvref_t<T>;
 5886|  8.13M|            using counts = yaml_variant_type_count<V>;
 5887|  8.13M|            const char c = *it;
 5888|  8.13M|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  8.13M|               switch (ch) {
 5890|  8.13M|               case ' ':
 5891|  8.13M|               case '\t':
 5892|  8.13M|               case '\n':
 5893|  8.13M|               case '\r':
 5894|  8.13M|               case ',':
 5895|  8.13M|               case ']':
 5896|  8.13M|               case '}':
 5897|  8.13M|                  return true;
 5898|  8.13M|               default:
 5899|  8.13M|                  return false;
 5900|  8.13M|               }
 5901|  8.13M|            };
 5902|       |
 5903|  8.13M|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  8.13M|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  8.13M|                  return false;
 5906|  8.13M|               }
 5907|  8.13M|               if (ctx.current_indent() < 0) {
 5908|  8.13M|                  return false;
 5909|  8.13M|               }
 5910|  8.13M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5911|  8.13M|                  return false;
 5912|  8.13M|               }
 5913|       |
 5914|  8.13M|               auto look = word_end;
 5915|  8.13M|               yaml::skip_newline(look, end);
 5916|  8.13M|               while (look != end) {
 5917|  8.13M|                  int32_t line_indent = 0;
 5918|  8.13M|                  while (look != end && *look == ' ') {
 5919|  8.13M|                     ++line_indent;
 5920|  8.13M|                     ++look;
 5921|  8.13M|                  }
 5922|  8.13M|                  if (look != end && *look == '\t') {
 5923|  8.13M|                     return false;
 5924|  8.13M|                  }
 5925|  8.13M|                  if (look == end || *look == '\n' || *look == '\r') {
 5926|  8.13M|                     if (look != end) {
 5927|  8.13M|                        yaml::skip_newline(look, end);
 5928|  8.13M|                        continue;
 5929|  8.13M|                     }
 5930|  8.13M|                     return false;
 5931|  8.13M|                  }
 5932|  8.13M|                  if (*look == '#') {
 5933|  8.13M|                     yaml::skip_comment(look, end);
 5934|  8.13M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5935|  8.13M|                        yaml::skip_newline(look, end);
 5936|  8.13M|                        continue;
 5937|  8.13M|                     }
 5938|  8.13M|                     return false;
 5939|  8.13M|                  }
 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|  8.13M|                  {
 5945|  8.13M|                     auto scan = look;
 5946|  8.13M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5947|  8.13M|                        if (*scan == ':') {
 5948|  8.13M|                           auto after_colon = scan + 1;
 5949|  8.13M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5950|  8.13M|                               *after_colon == '\n' || *after_colon == '\r') {
 5951|  8.13M|                              return false;
 5952|  8.13M|                           }
 5953|  8.13M|                        }
 5954|  8.13M|                        ++scan;
 5955|  8.13M|                     }
 5956|  8.13M|                  }
 5957|       |
 5958|  8.13M|                  return line_indent > ctx.current_indent();
 5959|  8.13M|               }
 5960|  8.13M|               return false;
 5961|  8.13M|            };
 5962|  8.13M|            auto is_word_boundary = [&](const auto ptr) {
 5963|  8.13M|               if (ptr == end) {
 5964|  8.13M|                  return true;
 5965|  8.13M|               }
 5966|  8.13M|               if (*ptr == ':') {
 5967|  8.13M|                  auto next = ptr + 1;
 5968|  8.13M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5969|  8.13M|               }
 5970|  8.13M|               return is_plain_scalar_boundary(*ptr);
 5971|  8.13M|            };
 5972|       |
 5973|  8.13M|            switch (c) {
 5974|  1.62M|            case '&': {
  ------------------
  |  Branch (5974:13): [True: 1.62M, False: 6.51M]
  ------------------
 5975|       |               // Anchor before value: parse name, then re-dispatch
 5976|  1.62M|               ++it;
 5977|  1.62M|               auto aname = yaml::parse_anchor_name(it, end);
 5978|  1.62M|               if (aname.empty()) {
  ------------------
  |  Branch (5978:20): [True: 457, False: 1.62M]
  ------------------
 5979|    457|                  ctx.error = error_code::syntax_error;
 5980|    457|                  return;
 5981|    457|               }
 5982|  1.62M|               yaml::skip_inline_ws(it, end);
 5983|  1.62M|               bool anchor_on_same_line = true;
 5984|  1.62M|               bool value_is_indentless_sequence = false;
 5985|  1.62M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5985:20): [True: 16.3k, False: 1.60M]
  |  Branch (5985:33): [True: 64.1k, False: 1.54M]
  |  Branch (5985:48): [True: 119k, False: 1.42M]
  |  Branch (5985:63): [True: 15.4k, False: 1.40M]
  ------------------
 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|   215k|                  bool value_on_next_line = false;
 5989|   215k|                  if (it != end) {
  ------------------
  |  Branch (5989:23): [True: 198k, False: 16.3k]
  ------------------
 5990|   198k|                     auto peek = it;
 5991|       |                     // Skip comment if present
 5992|   198k|                     if (*peek == '#') {
  ------------------
  |  Branch (5992:26): [True: 15.4k, False: 183k]
  ------------------
 5993|   119k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5993:32): [True: 118k, False: 807]
  |  Branch (5993:47): [True: 112k, False: 6.73k]
  |  Branch (5993:64): [True: 104k, False: 7.88k]
  ------------------
 5994|  15.4k|                     }
 5995|       |                     // Skip newline
 5996|   198k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5996:26): [True: 198k, False: 807]
  |  Branch (5996:42): [True: 70.9k, False: 127k]
  |  Branch (5996:59): [True: 127k, False: 0]
  ------------------
 5997|   198k|                        yaml::skip_newline(peek, end);
 5998|       |                        // Skip blank lines
 5999|   362k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5999:32): [True: 357k, False: 5.41k]
  |  Branch (5999:48): [True: 76.8k, False: 280k]
  |  Branch (5999:65): [True: 87.9k, False: 192k]
  ------------------
 6000|   164k|                           yaml::skip_newline(peek, end);
 6001|   164k|                        }
 6002|       |                        // Measure indent of next content line
 6003|   198k|                        int32_t next_indent = 0;
 6004|   536k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (6004:32): [True: 528k, False: 7.80k]
  |  Branch (6004:47): [True: 338k, False: 190k]
  ------------------
 6005|   338k|                           ++next_indent;
 6006|   338k|                           ++peek;
 6007|   338k|                        }
 6008|   198k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (6008:29): [True: 190k, False: 7.80k]
  |  Branch (6008:44): [True: 184k, False: 5.31k]
  |  Branch (6008:61): [True: 183k, False: 1.47k]
  ------------------
 6009|   183k|                           const bool indentless_sequence =
 6010|   183k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (6010:31): [True: 180k, False: 2.97k]
  |  Branch (6010:69): [True: 43.7k, False: 136k]
  ------------------
 6011|  43.7k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (6011:32): [True: 1.28k, False: 42.4k]
  ------------------
 6012|  42.4k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (6012:32): [True: 40.7k, False: 1.74k]
  ------------------
 6013|  42.0k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (6013:32): [True: 3.50k, False: 38.5k]
  ------------------
 6014|  38.5k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (6014:33): [True: 24.7k, False: 13.7k]
  |  Branch (6014:61): [True: 22.7k, False: 2.04k]
  ------------------
 6015|   183k|                           value_is_indentless_sequence = indentless_sequence;
 6016|   183k|                           const bool same_indent_property_node =
 6017|   183k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (6017:31): [True: 21.5k, False: 161k]
  ------------------
 6018|  21.5k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (6018:32): [True: 1.20k, False: 20.3k]
  |  Branch (6018:48): [True: 3.70k, False: 16.6k]
  |  Branch (6018:64): [True: 1.01k, False: 15.6k]
  |  Branch (6018:80): [True: 1.05k, False: 14.6k]
  |  Branch (6018:96): [True: 897, False: 13.7k]
  ------------------
 6019|  13.7k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (6019:32): [True: 920, False: 12.7k]
  |  Branch (6019:48): [True: 1.73k, False: 11.0k]
  |  Branch (6019:65): [True: 663, False: 10.3k]
  |  Branch (6019:81): [True: 960, False: 9.43k]
  ------------------
 6020|   183k|                           value_on_next_line =
 6021|   183k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (6021:31): [True: 114k, False: 68.5k]
  |  Branch (6021:71): [True: 26.2k, False: 42.3k]
  |  Branch (6021:94): [True: 12.1k, False: 30.2k]
  ------------------
 6022|   183k|                        }
 6023|   198k|                     }
 6024|   198k|                  }
 6025|   215k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6025:23): [True: 61.9k, False: 153k]
  ------------------
 6026|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6027|  61.9k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6028|  61.9k|                     return;
 6029|  61.9k|                  }
 6030|       |                  // Value is on next line — advance past newline/blank lines to the content
 6031|   153k|                  if (*it == '#') {
  ------------------
  |  Branch (6031:23): [True: 8.49k, False: 144k]
  ------------------
 6032|  58.7k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6032:29): [True: 58.7k, False: 0]
  |  Branch (6032:42): [True: 53.1k, False: 5.65k]
  |  Branch (6032:57): [True: 50.2k, False: 2.84k]
  ------------------
 6033|  8.49k|                  }
 6034|   153k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6034:23): [True: 153k, False: 0]
  ------------------
 6035|   260k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6035:26): [True: 260k, False: 0]
  |  Branch (6035:40): [True: 31.9k, False: 228k]
  |  Branch (6035:55): [True: 74.9k, False: 153k]
  ------------------
 6036|   106k|                     yaml::skip_newline(it, end);
 6037|   106k|                  }
 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.56M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6053:20): [True: 1.56M, False: 23]
  |  Branch (6053:33): [True: 1.47k, False: 1.55M]
  |  Branch (6053:47): [True: 211, False: 1.26k]
  ------------------
 6054|    211|                  ctx.error = error_code::syntax_error;
 6055|    211|                  return;
 6056|    211|               }
 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.56M|               const char* anchor_start = &*it;
 6078|  1.56M|               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.56M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6172|  1.56M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6173|  1.56M|               redispatch<Opts>(value, ctx, it, end);
 6174|  1.56M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6175|  1.56M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6175:20): [True: 1.52M, False: 32.8k]
  ------------------
 6176|  1.52M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6177|  1.52M|               }
 6178|  1.56M|               return;
 6179|  1.56M|            }
 6180|   534k|            case '*': {
  ------------------
  |  Branch (6180:13): [True: 534k, False: 7.60M]
  ------------------
 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|   534k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6198|   534k|               return;
 6199|  1.56M|            }
 6200|   567k|            case '!': {
  ------------------
  |  Branch (6200:13): [True: 567k, False: 7.56M]
  ------------------
 6201|       |               // Tag - parse it and dispatch based on tag type
 6202|   567k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6203|   567k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6203:20): [True: 76, False: 567k]
  ------------------
 6204|     76|                  ctx.error = error_code::syntax_error;
 6205|     76|                  return;
 6206|     76|               }
 6207|   567k|               yaml::skip_inline_ws(it, end);
 6208|   567k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6208:20): [True: 565k, False: 2.74k]
  |  Branch (6208:33): [True: 26.7k, False: 538k]
  ------------------
 6209|  26.7k|                  yaml::skip_comment(it, end);
 6210|  26.7k|               }
 6211|   567k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6211:20): [True: 563k, False: 4.48k]
  |  Branch (6211:34): [True: 42.0k, False: 521k]
  |  Branch (6211:49): [True: 66.4k, False: 454k]
  ------------------
 6212|   108k|                  auto content = it;
 6213|   108k|                  yaml::skip_newline(content, end);
 6214|   108k|                  yaml::skip_to_content(content, end);
 6215|       |
 6216|   108k|                  bool consume_following_content = false;
 6217|   108k|                  auto content_token = content;
 6218|   108k|                  if (content != end) {
  ------------------
  |  Branch (6218:23): [True: 97.4k, False: 11.0k]
  ------------------
 6219|  97.4k|                     auto indent_probe = content;
 6220|  97.4k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6221|  97.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6221:26): [True: 6, False: 97.4k]
  ------------------
 6222|      6|                        return;
 6223|  97.4k|                     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.4k|                     bool tagged_indentless_sequence = false;
 6228|  97.4k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6228:26): [True: 13.7k, False: 83.6k]
  |  Branch (6228:56): [True: 13.7k, False: 0]
  |  Branch (6228:79): [True: 12.0k, False: 1.69k]
  ------------------
 6229|  12.0k|                        const auto after_dash = indent_probe + 1;
 6230|  12.0k|                        if (after_dash == end ||
  ------------------
  |  Branch (6230:29): [True: 842, False: 11.2k]
  ------------------
 6231|  11.3k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6231:29): [True: 10.4k, False: 745]
  ------------------
 6232|  11.3k|                           tagged_indentless_sequence =
 6233|  11.3k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6233:31): [True: 933, False: 10.3k]
  ------------------
 6234|  10.3k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6234:32): [True: 5.18k, False: 5.19k]
  |  Branch (6234:60): [True: 1.06k, False: 4.12k]
  ------------------
 6235|  11.3k|                        }
 6236|  12.0k|                     }
 6237|       |
 6238|  97.4k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6238:50): [True: 48.1k, False: 49.2k]
  ------------------
 6239|  49.2k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6239:50): [True: 21.1k, False: 28.1k]
  |  Branch (6239:93): [True: 1.99k, False: 26.1k]
  ------------------
 6240|  97.4k|                  }
 6241|       |
 6242|   108k|                  if (consume_following_content) {
  ------------------
  |  Branch (6242:23): [True: 71.3k, False: 37.1k]
  ------------------
 6243|  71.3k|                     it = content_token;
 6244|  71.3k|                  }
 6245|  37.1k|                  else {
 6246|  37.1k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6246:26): [True: 1.02k, False: 36.1k]
  ------------------
 6247|  1.02k|                        if constexpr (counts::n_str > 0) {
 6248|  1.02k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6249|  1.02k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6250|  1.02k|                           value = StrType{};
 6251|  1.02k|                           return;
 6252|  1.02k|                        }
 6253|  1.02k|                     }
 6254|  37.1k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6254:26): [True: 949, False: 36.2k]
  ------------------
 6255|    949|                        if constexpr (counts::n_null > 0) {
 6256|    949|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6257|    949|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6258|    949|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6258:32): [True: 0, False: 949]
  ------------------
 6259|    949|                           return;
 6260|    949|                        }
 6261|    949|                     }
 6262|  37.1k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6262:26): [True: 28.4k, False: 8.67k]
  ------------------
 6263|  28.4k|                        if constexpr (counts::n_null > 0) {
 6264|  28.4k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6265|  28.4k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6266|  28.4k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6266:32): [True: 0, False: 28.4k]
  ------------------
 6267|  28.4k|                           return;
 6268|  28.4k|                        }
 6269|  28.4k|                     }
 6270|  37.1k|                  }
 6271|   108k|               }
 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|   567k|               if (it == end) {
  ------------------
  |  Branch (6292:20): [True: 4.48k, False: 563k]
  ------------------
 6293|  4.48k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6293:23): [True: 1.17k, False: 3.30k]
  ------------------
 6294|  1.17k|                     if constexpr (counts::n_str > 0) {
 6295|  1.17k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6296|  1.17k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6297|  1.17k|                        value = StrType{};
 6298|  1.17k|                        return;
 6299|  1.17k|                     }
 6300|  1.17k|                  }
 6301|  4.48k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6301:23): [True: 3.29k, False: 1.19k]
  ------------------
 6302|  3.29k|                     if constexpr (counts::n_null > 0) {
 6303|  3.29k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6304|  3.29k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6305|  3.29k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6305:29): [True: 0, False: 3.29k]
  ------------------
 6306|  3.29k|                        return;
 6307|  3.29k|                     }
 6308|  3.29k|                  }
 6309|      0|                  ctx.error = error_code::unexpected_end;
 6310|  4.48k|                  return;
 6311|  4.48k|               }
 6312|   563k|               switch (tag) {
 6313|  1.08k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6313:16): [True: 1.08k, False: 562k]
  ------------------
 6314|  1.08k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6315|  1.08k|                  return;
 6316|  6.44k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6316:16): [True: 6.44k, False: 556k]
  ------------------
 6317|  15.0k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6317:16): [True: 8.60k, False: 554k]
  ------------------
 6318|  15.0k|                  if constexpr (counts::n_num > 0) {
 6319|  15.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6320|  15.0k|                     return;
 6321|       |                  }
 6322|       |                  else { // else used to fix MSVC unreachable code warning
 6323|       |                     ctx.error = error_code::syntax_error;
 6324|       |                     return;
 6325|       |                  }
 6326|  58.2k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6326:16): [True: 43.1k, False: 520k]
  ------------------
 6327|  58.2k|                  if constexpr (counts::n_bool > 0) {
 6328|  58.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6329|  58.2k|                     return;
 6330|       |                  }
 6331|       |                  else { // else used to fix MSVC unreachable code warning
 6332|       |                     ctx.error = error_code::syntax_error;
 6333|       |                     return;
 6334|       |                  }
 6335|  59.4k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6335:16): [True: 1.23k, False: 562k]
  ------------------
 6336|  59.4k|                  if constexpr (counts::n_null > 0) {
 6337|  59.4k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6338|  59.4k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6339|  59.4k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6339:26): [True: 0, False: 59.4k]
  ------------------
 6340|  59.4k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6341|  59.4k|                     return;
 6342|       |                  }
 6343|       |                  else { // else used to fix MSVC unreachable code warning
 6344|       |                     ctx.error = error_code::syntax_error;
 6345|       |                     return;
 6346|       |                  }
 6347|   120k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6347:16): [True: 60.6k, False: 502k]
  ------------------
 6348|   120k|                  if constexpr (counts::n_object > 0) {
 6349|   120k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6350|   120k|                                                                                                     end);
 6351|   120k|                     return;
 6352|       |                  }
 6353|       |                  else { // else used to fix MSVC unreachable code warning
 6354|       |                     ctx.error = error_code::syntax_error;
 6355|       |                     return;
 6356|       |                  }
 6357|   159k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6357:16): [True: 39.6k, False: 523k]
  ------------------
 6358|   159k|                  if constexpr (counts::n_array > 0) {
 6359|   159k|                     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|   159k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6366|   159k|                                                                                                    end);
 6367|   159k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6368|   159k|                     return;
 6369|       |                  }
 6370|       |                  else { // else used to fix MSVC unreachable code warning
 6371|       |                     ctx.error = error_code::syntax_error;
 6372|       |                     return;
 6373|       |                  }
 6374|   531k|               default: {
  ------------------
  |  Branch (6374:16): [True: 371k, False: 191k]
  ------------------
 6375|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6376|       |                  // Preserve collection kinds, otherwise treat as string content.
 6377|   531k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6377:23): [True: 371k, False: 159k]
  |  Branch (6377:36): [True: 171k, False: 199k]
  ------------------
 6378|   171k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6379|   171k|                     return;
 6380|   171k|                  }
 6381|       |
 6382|   359k|                  if constexpr (counts::n_array > 0) {
 6383|   359k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6383:26): [True: 199k, False: 159k]
  |  Branch (6383:39): [True: 2.56k, False: 197k]
  ------------------
 6384|  2.56k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6385|  2.56k|                                                                                                       end);
 6386|  2.56k|                        return;
 6387|  2.56k|                     }
 6388|   359k|                  }
 6389|   359k|                  if constexpr (counts::n_object > 0) {
 6390|   359k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6390:26): [True: 197k, False: 162k]
  |  Branch (6390:39): [True: 2.50k, False: 194k]
  ------------------
 6391|  2.50k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6392|  2.50k|                                                                                                        end);
 6393|  2.50k|                        return;
 6394|  2.50k|                     }
 6395|   359k|                  }
 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|   359k|                  if constexpr (counts::n_str > 0) {
 6426|   359k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6427|   359k|                     return;
 6428|   359k|                  }
 6429|       |
 6430|       |                  // Fall back if no string alternative exists.
 6431|      0|                  redispatch<Opts>(value, ctx, it, end);
 6432|   359k|                  return;
 6433|   531k|               }
 6434|   563k|               }
 6435|      0|               return;
 6436|   563k|            }
 6437|  1.23M|            case '{':
  ------------------
  |  Branch (6437:13): [True: 1.23M, False: 6.89M]
  ------------------
 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|   130k|            case '[':
  ------------------
  |  Branch (6449:13): [True: 130k, False: 8.00M]
  ------------------
 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|   130k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6460|   130k|               return;
 6461|   331k|            case '?':
  ------------------
  |  Branch (6461:13): [True: 331k, False: 7.80M]
  ------------------
 6462|       |               // Explicit mapping key indicator ("? key")
 6463|   331k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6463:20): [True: 329k, False: 2.04k]
  |  Branch (6463:39): [True: 18, False: 329k]
  ------------------
 6464|     18|                  ctx.error = error_code::syntax_error;
 6465|     18|                  return;
 6466|     18|               }
 6467|   331k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6467:20): [True: 329k, False: 2.04k]
  |  Branch (6467:40): [True: 100k, False: 228k]
  |  Branch (6467:56): [True: 166k, False: 62.3k]
  |  Branch (6467:73): [True: 28.7k, False: 33.6k]
  ------------------
 6468|   295k|                  if constexpr (counts::n_object > 0) {
 6469|   295k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6470|   295k|                                                                                                     end);
 6471|   295k|                     return;
 6472|   295k|                  }
 6473|   295k|               }
 6474|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|   331k|               return;
 6476|     38|            case '%':
  ------------------
  |  Branch (6476:13): [True: 38, False: 8.13M]
  ------------------
 6477|       |               // Reserved directive indicator is not a plain scalar start.
 6478|     38|               ctx.error = error_code::syntax_error;
 6479|     38|               return;
 6480|  20.6k|            case '"':
  ------------------
  |  Branch (6480:13): [True: 20.6k, False: 8.11M]
  ------------------
 6481|  28.0k|            case '\'':
  ------------------
  |  Branch (6481:13): [True: 7.42k, False: 8.12M]
  ------------------
 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|  28.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6485|  28.0k|               return;
 6486|  35.6k|            case 't':
  ------------------
  |  Branch (6486:13): [True: 35.6k, False: 8.10M]
  ------------------
 6487|  76.7k|            case 'T':
  ------------------
  |  Branch (6487:13): [True: 41.0k, False: 8.09M]
  ------------------
 6488|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6489|  76.7k|               if constexpr (counts::n_bool > 0) {
 6490|  76.7k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6490:23): [True: 74.5k, False: 2.18k]
  |  Branch (6490:44): [True: 48.7k, False: 25.7k]
  |  Branch (6490:60): [True: 46.2k, False: 2.53k]
  |  Branch (6490:76): [True: 37.7k, False: 8.48k]
  ------------------
 6491|  40.3k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6491:44): [True: 5.87k, False: 30.8k]
  |  Branch (6491:60): [True: 3.59k, False: 2.28k]
  |  Branch (6491:76): [True: 2.59k, False: 991]
  ------------------
 6492|       |                     // Check what follows the word "true"
 6493|  40.3k|                     const auto after_true = it + 4;
 6494|  40.3k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6495|       |
 6496|  40.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6496:26): [True: 37.8k, False: 2.53k]
  ------------------
 6497|  37.8k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6497:29): [True: 0, False: 37.8k]
  ------------------
 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|  37.8k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6503:29): [True: 36.8k, False: 1.03k]
  |  Branch (6503:47): [True: 28.0k, False: 8.78k]
  ------------------
 6504|  28.0k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6504:30): [True: 752, False: 27.2k]
  |  Branch (6504:47): [True: 19.7k, False: 7.54k]
  |  Branch (6504:63): [True: 4.73k, False: 2.81k]
  |  Branch (6504:80): [True: 699, False: 2.11k]
  |  Branch (6504:97): [True: 2.11k, False: 0]
  ------------------
 6505|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6506|  28.0k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|  28.0k|                           return;
 6508|  28.0k|                        }
 6509|  9.81k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6510|  9.81k|                                                                                                      end);
 6511|  9.81k|                        return;
 6512|  37.8k|                     }
 6513|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6514|  40.3k|                  }
 6515|  76.7k|               }
 6516|  38.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6517|  76.7k|               return;
 6518|  69.9k|            case 'f':
  ------------------
  |  Branch (6518:13): [True: 69.9k, False: 8.06M]
  ------------------
 6519|  95.9k|            case 'F':
  ------------------
  |  Branch (6519:13): [True: 25.9k, False: 8.11M]
  ------------------
 6520|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6521|  95.9k|               if constexpr (counts::n_bool > 0) {
 6522|  95.9k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6522:23): [True: 94.4k, False: 1.47k]
  |  Branch (6522:44): [True: 38.6k, False: 55.8k]
  |  Branch (6522:60): [True: 26.1k, False: 12.5k]
  |  Branch (6522:76): [True: 23.5k, False: 2.58k]
  |  Branch (6522:92): [True: 22.2k, False: 1.32k]
  ------------------
 6523|  72.2k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6523:44): [True: 5.97k, False: 66.2k]
  |  Branch (6523:60): [True: 4.63k, False: 1.34k]
  |  Branch (6523:76): [True: 3.55k, False: 1.08k]
  |  Branch (6523:92): [True: 975, False: 2.57k]
  ------------------
 6524|       |                     // Check what follows the word "false"
 6525|  23.2k|                     const auto after_false = it + 5;
 6526|  23.2k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6527|       |
 6528|  23.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6528:26): [True: 19.4k, False: 3.83k]
  ------------------
 6529|  19.4k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6529:29): [True: 0, False: 19.4k]
  ------------------
 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|  19.4k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6535:29): [True: 18.0k, False: 1.31k]
  |  Branch (6535:47): [True: 14.1k, False: 3.91k]
  ------------------
 6536|  14.1k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6536:30): [True: 699, False: 13.4k]
  |  Branch (6536:47): [True: 1.64k, False: 11.8k]
  |  Branch (6536:63): [True: 5.20k, False: 6.62k]
  |  Branch (6536:80): [True: 2.35k, False: 4.26k]
  |  Branch (6536:97): [True: 4.26k, False: 0]
  ------------------
 6537|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6538|  14.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  14.1k|                           return;
 6540|  14.1k|                        }
 6541|  5.22k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6542|  5.22k|                                                                                                      end);
 6543|  5.22k|                        return;
 6544|  19.4k|                     }
 6545|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6546|  23.2k|                  }
 6547|  95.9k|               }
 6548|  76.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6549|  95.9k|               return;
 6550|  40.6k|            case 'n':
  ------------------
  |  Branch (6550:13): [True: 40.6k, False: 8.09M]
  ------------------
 6551|  66.8k|            case 'N':
  ------------------
  |  Branch (6551:13): [True: 26.1k, False: 8.11M]
  ------------------
 6552|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6553|  66.8k|               if constexpr (counts::n_null > 0) {
 6554|  66.8k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6554:23): [True: 65.4k, False: 1.42k]
  |  Branch (6554:44): [True: 37.0k, False: 28.3k]
  |  Branch (6554:60): [True: 31.1k, False: 5.89k]
  |  Branch (6554:76): [True: 28.7k, False: 2.35k]
  ------------------
 6555|  36.6k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6555:44): [True: 7.39k, False: 29.2k]
  |  Branch (6555:60): [True: 5.47k, False: 1.91k]
  |  Branch (6555:76): [True: 4.54k, False: 931]
  ------------------
 6556|       |                     // Check what follows the word "null"
 6557|  33.3k|                     const auto after_null = it + 4;
 6558|  33.3k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6559|       |
 6560|  33.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6560:26): [True: 26.9k, False: 6.37k]
  ------------------
 6561|  26.9k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6561:29): [True: 0, False: 26.9k]
  ------------------
 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|  26.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6567:29): [True: 25.8k, False: 1.08k]
  |  Branch (6567:47): [True: 14.1k, False: 11.7k]
  ------------------
 6568|  14.1k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6568:30): [True: 1.09k, False: 13.0k]
  |  Branch (6568:47): [True: 786, False: 12.2k]
  |  Branch (6568:63): [True: 10.0k, False: 2.19k]
  |  Branch (6568:80): [True: 819, False: 1.37k]
  |  Branch (6568:97): [True: 1.37k, False: 0]
  ------------------
 6569|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6570|  14.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6571|  14.1k|                           return;
 6572|  14.1k|                        }
 6573|  12.8k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6574|  12.8k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6575|  12.8k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6575:29): [True: 0, False: 12.8k]
  ------------------
 6576|  12.8k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6577|  12.8k|                        return;
 6578|  26.9k|                     }
 6579|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6580|  33.3k|                  }
 6581|  66.8k|               }
 6582|  39.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6583|  66.8k|               return;
 6584|  7.06k|            case '~':
  ------------------
  |  Branch (6584:13): [True: 7.06k, False: 8.12M]
  ------------------
 6585|       |               // Null indicator
 6586|  7.06k|               if constexpr (counts::n_null > 0) {
 6587|  7.06k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6588|  7.06k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6589|  7.06k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6589:23): [True: 0, False: 7.06k]
  ------------------
 6590|  7.06k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6591|  7.06k|                  return;
 6592|  7.06k|               }
 6593|      0|               break; // Fall through to try other types
 6594|   248k|            case '-':
  ------------------
  |  Branch (6594:13): [True: 248k, False: 7.88M]
  ------------------
 6595|       |               // Could be negative number or block sequence indicator
 6596|   248k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6596:20): [True: 11.1k, False: 237k]
  |  Branch (6596:41): [True: 156k, False: 81.1k]
  ------------------
 6597|       |                  // Block sequence indicator "- "
 6598|   167k|                  if constexpr (counts::n_array > 0) {
 6599|   167k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6600|   167k|                                                                                                    end);
 6601|   167k|                     return;
 6602|   167k|                  }
 6603|   167k|               }
 6604|   248k|               if constexpr (counts::n_num > 0) {
 6605|   248k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6605:23): [True: 81.1k, False: 167k]
  |  Branch (6605:43): [True: 5.75k, False: 75.4k]
  |  Branch (6605:94): [True: 3.17k, False: 72.2k]
  ------------------
 6606|  8.92k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6607|  8.92k|                     return;
 6608|  8.92k|                  }
 6609|   248k|               }
 6610|   239k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6611|   248k|               return;
 6612|  26.4k|            case '+':
  ------------------
  |  Branch (6612:13): [True: 26.4k, False: 8.10M]
  ------------------
 6613|  75.8k|            case '.':
  ------------------
  |  Branch (6613:13): [True: 49.4k, False: 8.08M]
  ------------------
 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|  75.8k|               if constexpr (counts::n_num > 0) {
 6617|  75.8k|                  auto start_it = it;
 6618|  75.8k|                  auto temp_ctx = ctx.make_speculative();
 6619|  75.8k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6620|  75.8k|                                                                                               end);
 6621|  75.8k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6622|  75.8k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6623|  75.8k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6623:23): [True: 7.45k, False: 68.4k]
  ------------------
 6624|  7.45k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6625|  7.45k|                     return; // Successfully parsed as number
 6626|  7.45k|                  }
 6627|  68.4k|                  it = start_it; // Restore and fall through to string
 6628|  68.4k|               }
 6629|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6630|  75.8k|               return;
 6631|  3.11M|            default:
  ------------------
  |  Branch (6631:13): [True: 3.11M, False: 5.02M]
  ------------------
 6632|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6633|  3.11M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6633:20): [True: 2.78M, False: 323k]
  |  Branch (6633:32): [True: 2.38M, False: 404k]
  ------------------
 6634|       |                  // Try block mapping first (e.g., "123key: value")
 6635|  2.38M|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6635:23): [True: 18.4k, False: 2.36M]
  ------------------
 6636|  18.4k|                     return;
 6637|  18.4k|                  }
 6638|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6639|  2.36M|                  if constexpr (counts::n_num > 0) {
 6640|  2.36M|                     auto start_it = it;
 6641|  2.36M|                     auto temp_ctx = ctx.make_speculative();
 6642|  2.36M|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6643|  2.36M|                                                                                                  end);
 6644|  2.36M|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6645|  2.36M|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6646|  2.36M|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6646:26): [True: 2.24M, False: 119k]
  ------------------
 6647|  2.24M|                        ctx.anchors = std::move(temp_ctx.anchors);
 6648|  2.24M|                        return; // Successfully parsed as number
 6649|  2.24M|                     }
 6650|   119k|                     it = start_it; // Restore and fall through to string
 6651|   119k|                  }
 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.36M|                  return;
 6655|  2.38M|               }
 6656|       |               // Plain scalar - try block mapping, then string
 6657|   728k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6658|   728k|               return;
 6659|  8.13M|            }
 6660|  8.13M|         }
 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|  8.13M|         error_code expansion_error{};
 6670|  8.13M|         std::string_view expansion_message{};
 6671|       |
 6672|  8.13M|         auto try_parse = [&]<size_t I>() -> bool {
 6673|  8.13M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6674|  8.13M|            auto start = it;
 6675|       |
 6676|  8.13M|            V v{};
 6677|  8.13M|            auto temp_ctx = ctx.make_speculative();
 6678|  8.13M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6679|  8.13M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6680|  8.13M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6681|       |
 6682|  8.13M|            if (!bool(temp_ctx.error)) {
 6683|  8.13M|               value = std::move(v);
 6684|  8.13M|               ctx.anchors = std::move(temp_ctx.anchors);
 6685|  8.13M|               return true;
 6686|  8.13M|            }
 6687|       |
 6688|  8.13M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6689|  8.13M|               expansion_error = temp_ctx.error;
 6690|  8.13M|               expansion_message = temp_ctx.custom_error_message;
 6691|  8.13M|            }
 6692|  8.13M|            it = start;
 6693|  8.13M|            return false;
 6694|  8.13M|         };
 6695|       |
 6696|  8.13M|         bool parsed = false;
 6697|  8.13M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6698|  8.13M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6699|  8.13M|         }(std::make_index_sequence<N>{});
 6700|       |
 6701|  8.13M|         if (!parsed) {
  ------------------
  |  Branch (6701:14): [True: 0, False: 8.13M]
  ------------------
 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|  8.13M|      }
_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.56M|      {
 6718|  1.56M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|  1.56M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 33, False: 1.56M]
  ------------------
 6720|     33|            return;
 6721|  1.56M|         op<Opts>(value, ctx, it, end);
 6722|  1.56M|      }
_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|   706k|      {
  301|   706k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 706k]
  |  Branch (301:27): [True: 0, False: 706k]
  ------------------
  302|       |
  303|   706k|         ++it; // skip '*'
  304|   706k|         auto name = parse_anchor_name(it, end);
  305|   706k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 358, False: 706k]
  ------------------
  306|    358|            ctx.error = error_code::syntax_error;
  307|    358|            return true;
  308|    358|         }
  309|       |
  310|   706k|         auto anchor_it = ctx.anchors.find(name);
  311|   706k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 3.07k, False: 703k]
  ------------------
  312|  3.07k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  3.07k|            return true;
  314|  3.07k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   703k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   703k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 94.2k, False: 608k]
  ------------------
  322|  94.2k|            return true;
  323|  94.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|   608k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 40, False: 608k]
  ------------------
  329|     40|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     40|            return true;
  331|     40|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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|   608k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   608k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 608k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   608k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 48, False: 608k]
  ------------------
  342|     48|            ctx.error = error_code::exceeded_max_expansion;
  343|     48|            ctx.custom_error_message = "alias expansion";
  344|     48|            return true;
  345|     48|         }
  346|       |
  347|   608k|         auto replay_it = span.begin;
  348|   608k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   608k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   608k|         ctx.indent_stack.clear();
  353|   608k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 40.1k, False: 568k]
  ------------------
  354|  40.1k|            ctx.push_indent(span.base_indent - 1);
  355|  40.1k|         }
  356|       |
  357|   608k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   608k|         using V = std::remove_cvref_t<T>;
  360|   608k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   608k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   608k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   608k|         return true;
  367|   608k|      }
_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|  1.02M|      {
 5311|  1.02M|         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.02M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  1.02M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  1.02M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  1.02M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 1.02M, False: 0]
  ------------------
 5321|  1.02M|            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.02M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1960|  1.04M|      {
 1961|  1.04M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 16.5k, False: 1.02M]
  ------------------
 1962|  16.5k|            return;
 1963|       |
 1964|  1.02M|         yaml::node_preamble_state preamble{};
 1965|  1.02M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 25.3k, False: 1.00M]
  ------------------
 1966|  1.02M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  25.3k|            return;
 1968|       |
 1969|  1.00M|         std::string str;
 1970|  1.00M|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|  1.00M|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 1.00M, False: 0]
  ------------------
 1973|  11.4k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 11.4k, False: 990k]
  ------------------
 1974|  11.4k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  11.4k|            break;
 1976|  4.21k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 4.21k, False: 998k]
  ------------------
 1977|  4.21k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  4.21k|            break;
 1979|  1.63k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 1.63k, False: 1.00M]
  ------------------
 1980|  13.5k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 11.9k, False: 990k]
  ------------------
 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.5k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  13.5k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 3.50k, False: 10.0k]
  ------------------
 1986|  13.5k|            break;
 1987|   973k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 973k, False: 29.1k]
  ------------------
 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|   973k|            else {
 2000|   973k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|   973k|            }
 2002|   973k|            break;
 2003|  1.00M|         }
 2004|       |
 2005|  1.00M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 991k, False: 10.3k]
  ------------------
 2006|   991k|            value = std::move(str);
 2007|   991k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   991k|         }
 2009|  1.00M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.02M|      {
  466|  1.02M|         skip_inline_ws(it, end);
  467|       |
  468|  1.02M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 17, False: 1.02M]
  ------------------
  469|     17|            if constexpr (!AllowEmptyInput) {
  470|     17|               ctx.error = error_code::unexpected_end;
  471|     17|            }
  472|     17|            return true;
  473|     17|         }
  474|       |
  475|  1.02M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.02M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 36, False: 1.02M]
  ------------------
  477|     36|            ctx.error = error_code::syntax_error;
  478|     36|            return true;
  479|     36|         }
  480|  1.02M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.02M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.02M|         skip_inline_ws(it, end);
  486|       |
  487|  1.02M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 21, False: 1.02M]
  ------------------
  488|     21|            if constexpr (!AllowEmptyInput) {
  489|     21|               ctx.error = error_code::unexpected_end;
  490|     21|            }
  491|     21|            return true;
  492|     21|         }
  493|       |
  494|  1.02M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 25.2k, False: 1.00M]
  ------------------
  495|  25.2k|            return true;
  496|  25.2k|         }
  497|       |
  498|  1.00M|         return false;
  499|  1.02M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1966|  1.02M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.02M|      {
  409|  1.02M|         state.has_anchor = false;
  410|  1.02M|         state.anchor_name.clear();
  411|  1.02M|         state.anchor_start = nullptr;
  412|  1.02M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.02M|         if constexpr (Policy.allow_alias) {
  415|       |            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.02M|            else {
  421|  1.02M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 25.1k, False: 1.00M]
  ------------------
  422|  1.02M|            }
  423|  1.02M|         }
  424|       |
  425|  1.02M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.00M, False: 25.1k]
  |  Branch (425:27): [True: 37.7k, False: 964k]
  ------------------
  426|  37.7k|            ++it;
  427|  37.7k|            auto name = parse_anchor_name(it, end);
  428|  37.7k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 42, False: 37.6k]
  ------------------
  429|     42|               ctx.error = error_code::syntax_error;
  430|     42|               return true;
  431|     42|            }
  432|  37.6k|            skip_inline_ws(it, end);
  433|  37.6k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 49, False: 37.6k]
  ------------------
  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|  37.6k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  37.6k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 37.6k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  37.6k|            }
  445|  37.6k|            state.has_anchor = true;
  446|  37.6k|            state.anchor_name = std::string(name);
  447|  37.6k|            state.anchor_start = &*it;
  448|  37.6k|         }
  449|       |
  450|  1.02M|         return false;
  451|  1.02M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  1.02M|      {
  301|  1.02M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.02M]
  |  Branch (301:27): [True: 1.00M, False: 25.1k]
  ------------------
  302|       |
  303|  25.1k|         ++it; // skip '*'
  304|  25.1k|         auto name = parse_anchor_name(it, end);
  305|  25.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 34, False: 25.1k]
  ------------------
  306|     34|            ctx.error = error_code::syntax_error;
  307|     34|            return true;
  308|     34|         }
  309|       |
  310|  25.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  25.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 122, False: 25.0k]
  ------------------
  312|    122|            ctx.error = error_code::syntax_error; // undefined alias
  313|    122|            return true;
  314|    122|         }
  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.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  25.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 3.69k, False: 21.3k]
  ------------------
  322|  3.69k|            return true;
  323|  3.69k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  21.3k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 34, False: 21.2k]
  ------------------
  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|  21.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  21.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 21.2k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  21.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 21, False: 21.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|  21.2k|         auto replay_it = span.begin;
  348|  21.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  21.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  21.2k|         ctx.indent_stack.clear();
  353|  21.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.21k, False: 19.0k]
  ------------------
  354|  2.21k|            ctx.push_indent(span.base_indent - 1);
  355|  2.21k|         }
  356|       |
  357|  21.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  21.2k|         using V = std::remove_cvref_t<T>;
  360|  21.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  21.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  21.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  21.2k|         return true;
  367|  21.2k|      }
_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.46M|      {
 5311|  2.46M|         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.46M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  2.46M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  2.46M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  2.46M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 2.46M, False: 0]
  ------------------
 5321|  2.46M|            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.46M|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2115|  2.47M|      {
 2116|  2.47M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 2.47M]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  2.47M|         yaml::node_preamble_state preamble{};
 2120|  2.47M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 18.0k, False: 2.45M]
  ------------------
 2121|  2.47M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  2.47M|                   return yaml::tag_valid_for_float(tag);
 2123|  2.47M|                }
 2124|  2.47M|                else {
 2125|  2.47M|                   return yaml::tag_valid_for_int(tag);
 2126|  2.47M|                }
 2127|  2.47M|             }))
 2128|  18.0k|            return;
 2129|       |
 2130|  2.45M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  2.45M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  2.45M|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  2.45M|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 52.4k, False: 2.40M]
  ------------------
 2138|  52.4k|               ++it;
 2139|  52.4k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 48.6k, False: 3.81k]
  |  Branch (2139:38): [True: 2.16k, False: 46.4k]
  |  Branch (2139:74): [True: 743, False: 45.7k]
  ------------------
 2140|  45.7k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 1.29k, False: 44.4k]
  ------------------
 2141|  4.19k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  4.19k|                  it += 3;
 2143|  4.19k|                  finalize();
 2144|  4.19k|                  return;
 2145|  4.19k|               }
 2146|  48.2k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 44.4k, False: 3.81k]
  |  Branch (2146:38): [True: 698, False: 43.7k]
  |  Branch (2146:74): [True: 768, False: 42.9k]
  ------------------
 2147|  42.9k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 2.35k, False: 40.6k]
  ------------------
 2148|  3.82k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  3.82k|                  it += 3;
 2150|  3.82k|                  finalize();
 2151|  3.82k|                  return;
 2152|  3.82k|               }
 2153|  44.4k|               it = start;
 2154|  44.4k|            }
 2155|       |
 2156|  2.44M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 10.2k, False: 2.43M]
  |  Branch (2156:31): [True: 26.4k, False: 2.40M]
  ------------------
 2157|  36.7k|               const char sign = *it;
 2158|  36.7k|               ++it;
 2159|  36.7k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 35.3k, False: 1.43k]
  |  Branch (2159:33): [True: 8.21k, False: 27.0k]
  ------------------
 2160|  8.21k|                  ++it;
 2161|  8.21k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 6.97k, False: 1.23k]
  |  Branch (2161:41): [True: 1.60k, False: 5.37k]
  |  Branch (2161:77): [True: 1.86k, False: 3.51k]
  ------------------
 2162|  4.47k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 1.00k, False: 2.50k]
  ------------------
 2163|  4.47k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 3.51k, False: 958]
  ------------------
 2164|  3.51k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  3.51k|                     }
 2166|    958|                     else {
 2167|    958|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    958|                     }
 2169|  4.47k|                     it += 3;
 2170|  4.47k|                     finalize();
 2171|  4.47k|                     return;
 2172|  4.47k|                  }
 2173|  8.21k|               }
 2174|  32.2k|               it = start;
 2175|  32.2k|            }
 2176|  2.44M|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  2.44M|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  83.6M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 83.6M, False: 23.0k]
  ------------------
 2183|  83.6M|            const char c = *it;
 2184|  83.6M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 43.1k, False: 83.6M]
  |  Branch (2184:29): [True: 21.3k, False: 83.5M]
  |  Branch (2184:42): [True: 21.7k, False: 83.5M]
  |  Branch (2184:55): [True: 6.17k, False: 83.5M]
  |  Branch (2184:68): [True: 2.28M, False: 81.2M]
  |  Branch (2184:80): [True: 9.88k, False: 81.2M]
  |  Branch (2184:92): [True: 5.03k, False: 81.2M]
  |  Branch (2184:104): [True: 25.0k, False: 81.2M]
  ------------------
 2185|  2.41M|               break;
 2186|  2.41M|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  81.2M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 1.40M, False: 79.8M]
  ------------------
 2189|  1.40M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 1.65k, False: 1.40M]
  |  Branch (2189:39): [True: 5.99k, False: 1.40M]
  |  Branch (2189:59): [True: 1.74k, False: 1.39M]
  |  Branch (2189:80): [True: 1.59k, False: 1.39M]
  |  Branch (2189:101): [True: 2.19k, False: 1.39M]
  ------------------
 2190|  13.1k|                  break;
 2191|  13.1k|               }
 2192|  1.40M|            }
 2193|  81.2M|            ++it;
 2194|  81.2M|         }
 2195|       |
 2196|  2.45M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  2.45M|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 3.27k, False: 2.45M]
  ------------------
 2199|  3.27k|            ctx.error = error_code::parse_number_failure;
 2200|  3.27k|            return;
 2201|  3.27k|         }
 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.45M|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  2.45M|            bool negative = false;
 2254|  2.45M|            std::string_view digits = num_str;
 2255|       |
 2256|  2.45M|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 2.43M, False: 12.4k]
  |  Branch (2256:37): [True: 25.5k, False: 2.41M]
  |  Branch (2256:62): [True: 6.73k, False: 2.40M]
  ------------------
 2257|  32.2k|               negative = (digits.front() == '-');
 2258|  32.2k|               digits.remove_prefix(1);
 2259|  32.2k|            }
 2260|       |
 2261|  2.45M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 396k, False: 2.05M]
  |  Branch (2261:38): [True: 53.4k, False: 342k]
  ------------------
 2262|  53.4k|               int base = 10;
 2263|  53.4k|               size_t offset = 0;
 2264|       |
 2265|  53.4k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 5.69k, False: 47.7k]
  |  Branch (2265:40): [True: 1.83k, False: 45.9k]
  ------------------
 2266|  7.53k|                  base = 16;
 2267|  7.53k|                  offset = 2;
 2268|  7.53k|               }
 2269|  45.9k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 1.92k, False: 43.9k]
  |  Branch (2269:45): [True: 1.41k, False: 42.5k]
  ------------------
 2270|  3.33k|                  base = 8;
 2271|  3.33k|                  offset = 2;
 2272|  3.33k|               }
 2273|  42.5k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 1.37k, False: 41.2k]
  |  Branch (2273:45): [True: 1.59k, False: 39.6k]
  ------------------
 2274|  2.97k|                  base = 2;
 2275|  2.97k|                  offset = 2;
 2276|  2.97k|               }
 2277|       |
 2278|  53.4k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 13.8k, False: 39.6k]
  ------------------
 2279|  13.8k|                  auto raw_digits = digits.substr(offset);
 2280|  13.8k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  13.8k|                  std::string clean_storage;
 2283|  13.8k|                  std::string_view clean_view;
 2284|  13.8k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 3.71k, False: 10.1k]
  ------------------
 2285|  3.71k|                     clean_storage.reserve(raw_digits.size());
 2286|  9.79M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 9.79M, False: 3.71k]
  ------------------
 2287|  9.79M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 9.79M, False: 8.28k]
  ------------------
 2288|  9.79M|                           clean_storage.push_back(c);
 2289|  9.79M|                        }
 2290|  9.79M|                     }
 2291|  3.71k|                     clean_view = clean_storage;
 2292|  3.71k|                  }
 2293|  10.1k|                  else {
 2294|  10.1k|                     clean_view = raw_digits;
 2295|  10.1k|                  }
 2296|       |
 2297|  13.8k|                  uint64_t parsed_int{};
 2298|  13.8k|                  auto [ptr, ec] =
 2299|  13.8k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  13.8k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 6.54k, False: 7.30k]
  |  Branch (2300:44): [True: 2.40k, False: 4.90k]
  ------------------
 2301|  8.94k|                     ctx.error = error_code::parse_number_failure;
 2302|  8.94k|                     finalize();
 2303|  8.94k|                     return;
 2304|  8.94k|                  }
 2305|       |
 2306|  4.90k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  4.90k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 2.48k, False: 2.42k]
  ------------------
 2308|  4.90k|                  finalize();
 2309|  4.90k|                  return;
 2310|  13.8k|               }
 2311|  53.4k|            }
 2312|  2.45M|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  2.43M|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  2.45M|         std::string clean_storage;
 2318|  2.45M|         std::string_view clean_view;
 2319|       |
 2320|  2.45M|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 5.55k, False: 2.44M]
  ------------------
 2321|  5.55k|            clean_storage.reserve(num_str.size());
 2322|  34.5M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 34.5M, False: 5.55k]
  ------------------
 2323|  34.5M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 34.5M, False: 29.0k]
  ------------------
 2324|  34.5M|                  clean_storage.push_back(c);
 2325|  34.5M|               }
 2326|  34.5M|            }
 2327|  5.55k|            clean_view = clean_storage;
 2328|  5.55k|         }
 2329|  2.44M|         else {
 2330|  2.44M|            clean_view = num_str;
 2331|  2.44M|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  2.45M|         auto parse_view = clean_view;
 2336|  2.45M|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 2.42M, False: 26.6k]
  |  Branch (2336:37): [True: 25.5k, False: 2.39M]
  ------------------
 2337|  25.5k|            parse_view.remove_prefix(1);
 2338|  25.5k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 9.94k, False: 15.5k]
  ------------------
 2339|  9.94k|               ctx.error = error_code::parse_number_failure;
 2340|  9.94k|               return;
 2341|  9.94k|            }
 2342|  25.5k|         }
 2343|       |
 2344|  2.44M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  2.44M|            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.44M|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 85.3k, False: 2.35M]
  |  Branch (2347:45): [True: 100k, False: 2.25M]
  ------------------
 2348|   159k|               ctx.error = error_code::parse_number_failure;
 2349|   159k|            }
 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.44M|         finalize();
 2360|  2.44M|      }
_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.47M|      {
  466|  2.47M|         skip_inline_ws(it, end);
  467|       |
  468|  2.47M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 736, False: 2.47M]
  ------------------
  469|    736|            if constexpr (!AllowEmptyInput) {
  470|    736|               ctx.error = error_code::unexpected_end;
  471|    736|            }
  472|    736|            return true;
  473|    736|         }
  474|       |
  475|  2.47M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.47M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 395, False: 2.47M]
  ------------------
  477|    395|            ctx.error = error_code::syntax_error;
  478|    395|            return true;
  479|    395|         }
  480|  2.47M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 414, False: 2.47M]
  ------------------
  481|    414|            ctx.error = error_code::syntax_error;
  482|    414|            return true;
  483|    414|         }
  484|       |
  485|  2.47M|         skip_inline_ws(it, end);
  486|       |
  487|  2.47M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 487, False: 2.47M]
  ------------------
  488|    487|            if constexpr (!AllowEmptyInput) {
  489|    487|               ctx.error = error_code::unexpected_end;
  490|    487|            }
  491|    487|            return true;
  492|    487|         }
  493|       |
  494|  2.47M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.0k, False: 2.45M]
  ------------------
  495|  16.0k|            return true;
  496|  16.0k|         }
  497|       |
  498|  2.45M|         return false;
  499|  2.47M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2120|  2.47M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  2.47M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  2.47M|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  2.47M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  2.47M|      {
  409|  2.47M|         state.has_anchor = false;
  410|  2.47M|         state.anchor_name.clear();
  411|  2.47M|         state.anchor_start = nullptr;
  412|  2.47M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.47M|         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.47M|            else {
  421|  2.47M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 14.9k, False: 2.45M]
  ------------------
  422|  2.47M|            }
  423|  2.47M|         }
  424|       |
  425|  2.47M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.45M, False: 14.9k]
  |  Branch (425:27): [True: 10.9k, False: 2.44M]
  ------------------
  426|  10.9k|            ++it;
  427|  10.9k|            auto name = parse_anchor_name(it, end);
  428|  10.9k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 568, False: 10.3k]
  ------------------
  429|    568|               ctx.error = error_code::syntax_error;
  430|    568|               return true;
  431|    568|            }
  432|  10.3k|            skip_inline_ws(it, end);
  433|  10.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 570, False: 9.79k]
  ------------------
  434|    570|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    570|                  ctx.error = error_code::unexpected_end;
  436|    570|               }
  437|    570|               return true;
  438|    570|            }
  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|  2.46M|         return false;
  451|  2.47M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  2.47M|      {
  301|  2.47M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.47M]
  |  Branch (301:27): [True: 2.45M, False: 14.9k]
  ------------------
  302|       |
  303|  14.9k|         ++it; // skip '*'
  304|  14.9k|         auto name = parse_anchor_name(it, end);
  305|  14.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 800, False: 14.1k]
  ------------------
  306|    800|            ctx.error = error_code::syntax_error;
  307|    800|            return true;
  308|    800|         }
  309|       |
  310|  14.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  14.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.83k, False: 11.2k]
  ------------------
  312|  2.83k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.83k|            return true;
  314|  2.83k|         }
  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.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.22k, False: 9.05k]
  ------------------
  322|  2.22k|            return true;
  323|  2.22k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  9.05k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 240, False: 8.81k]
  ------------------
  329|    240|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    240|            return true;
  331|    240|         }
  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.81k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.81k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 8.80k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  8.80k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 30, False: 8.77k]
  ------------------
  342|     30|            ctx.error = error_code::exceeded_max_expansion;
  343|     30|            ctx.custom_error_message = "alias expansion";
  344|     30|            return true;
  345|     30|         }
  346|       |
  347|  8.77k|         auto replay_it = span.begin;
  348|  8.77k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.77k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.77k|         ctx.indent_stack.clear();
  353|  8.77k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.56k, False: 6.20k]
  ------------------
  354|  2.56k|            ctx.push_indent(span.base_indent - 1);
  355|  2.56k|         }
  356|       |
  357|  8.77k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.77k|         using V = std::remove_cvref_t<T>;
  360|  8.77k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.77k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.77k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.77k|         return true;
  367|  8.80k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  2.44M|         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|  58.2k|      {
 5311|  58.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|  58.2k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  58.2k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  58.2k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  58.2k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 58.2k, False: 0]
  ------------------
 5321|  58.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|  58.2k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2080|  71.1k|      {
 2081|  71.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 71.1k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  71.1k|         yaml::node_preamble_state preamble{};
 2085|  71.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 15.7k, False: 55.3k]
  ------------------
 2086|  71.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  15.7k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  55.3k|         std::string str;
 2091|  55.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  55.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 5.18k, False: 50.1k]
  |  Branch (2093:31): [True: 2.08k, False: 48.1k]
  |  Branch (2093:48): [True: 2.50k, False: 45.5k]
  |  Branch (2093:65): [True: 1.03k, False: 44.5k]
  |  Branch (2093:81): [True: 1.68k, False: 42.8k]
  |  Branch (2093:97): [True: 1.07k, False: 41.8k]
  ------------------
 2094|  41.8k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 2.02k, False: 39.7k]
  |  Branch (2094:29): [True: 811, False: 38.9k]
  |  Branch (2094:44): [True: 933, False: 38.0k]
  ------------------
 2095|  17.3k|            value = true;
 2096|  17.3k|         }
 2097|  38.0k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 10.6k, False: 27.3k]
  |  Branch (2097:37): [True: 2.07k, False: 25.2k]
  |  Branch (2097:55): [True: 1.83k, False: 23.4k]
  |  Branch (2097:73): [True: 1.68k, False: 21.7k]
  |  Branch (2097:88): [True: 16.9k, False: 4.84k]
  |  Branch (2097:103): [True: 929, False: 3.91k]
  ------------------
 2098|  37.4k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 901, False: 3.01k]
  |  Branch (2098:35): [True: 1.05k, False: 1.95k]
  |  Branch (2098:51): [True: 1.41k, False: 546]
  ------------------
 2099|  37.4k|            value = false;
 2100|  37.4k|         }
 2101|    546|         else {
 2102|    546|            ctx.error = error_code::expected_true_or_false;
 2103|    546|         }
 2104|       |
 2105|  55.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  55.3k|      }
_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|  71.1k|      {
  466|  71.1k|         skip_inline_ws(it, end);
  467|       |
  468|  71.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 71.1k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|  71.1k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  71.1k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 22, False: 71.1k]
  ------------------
  477|     22|            ctx.error = error_code::syntax_error;
  478|     22|            return true;
  479|     22|         }
  480|  71.1k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 71.1k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  71.1k|         skip_inline_ws(it, end);
  486|       |
  487|  71.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 11, False: 71.1k]
  ------------------
  488|     11|            if constexpr (!AllowEmptyInput) {
  489|     11|               ctx.error = error_code::unexpected_end;
  490|     11|            }
  491|     11|            return true;
  492|     11|         }
  493|       |
  494|  71.1k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 15.7k, False: 55.3k]
  ------------------
  495|  15.7k|            return true;
  496|  15.7k|         }
  497|       |
  498|  55.3k|         return false;
  499|  71.1k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2086|  71.1k|                                             [](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|  71.1k|      {
  409|  71.1k|         state.has_anchor = false;
  410|  71.1k|         state.anchor_name.clear();
  411|  71.1k|         state.anchor_start = nullptr;
  412|  71.1k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  71.1k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  71.1k|            else {
  421|  71.1k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 15.6k, False: 55.4k]
  ------------------
  422|  71.1k|            }
  423|  71.1k|         }
  424|       |
  425|  71.1k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 55.4k, False: 15.6k]
  |  Branch (425:27): [True: 10.8k, False: 44.5k]
  ------------------
  426|  10.8k|            ++it;
  427|  10.8k|            auto name = parse_anchor_name(it, end);
  428|  10.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 19, False: 10.8k]
  ------------------
  429|     19|               ctx.error = error_code::syntax_error;
  430|     19|               return true;
  431|     19|            }
  432|  10.8k|            skip_inline_ws(it, end);
  433|  10.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 43, False: 10.8k]
  ------------------
  434|     43|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     43|                  ctx.error = error_code::unexpected_end;
  436|     43|               }
  437|     43|               return true;
  438|     43|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  10.8k|            state.has_anchor = true;
  446|  10.8k|            state.anchor_name = std::string(name);
  447|  10.8k|            state.anchor_start = &*it;
  448|  10.8k|         }
  449|       |
  450|  71.0k|         return false;
  451|  71.1k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  71.1k|      {
  301|  71.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 71.1k]
  |  Branch (301:27): [True: 55.4k, False: 15.6k]
  ------------------
  302|       |
  303|  15.6k|         ++it; // skip '*'
  304|  15.6k|         auto name = parse_anchor_name(it, end);
  305|  15.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 29, False: 15.6k]
  ------------------
  306|     29|            ctx.error = error_code::syntax_error;
  307|     29|            return true;
  308|     29|         }
  309|       |
  310|  15.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  15.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 106, False: 15.5k]
  ------------------
  312|    106|            ctx.error = error_code::syntax_error; // undefined alias
  313|    106|            return true;
  314|    106|         }
  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.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  15.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.56k, False: 12.9k]
  ------------------
  322|  2.56k|            return true;
  323|  2.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|  12.9k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 12.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|  12.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 12.9k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  12.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 12.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|  12.9k|         auto replay_it = span.begin;
  348|  12.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  12.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  12.9k|         ctx.indent_stack.clear();
  353|  12.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.17k, False: 9.78k]
  ------------------
  354|  3.17k|            ctx.push_indent(span.base_indent - 1);
  355|  3.17k|         }
  356|       |
  357|  12.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  12.9k|         using V = std::remove_cvref_t<T>;
  360|  12.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  12.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  12.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  12.9k|         return true;
  367|  12.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: 16, False: 21.1k]
  ------------------
 2473|     16|            ctx.error = error_code::unexpected_end;
 2474|     16|            return;
 2475|     16|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  21.1k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 7.06k, False: 14.0k]
  ------------------
 2479|  7.06k|            ++it;
 2480|  7.06k|            return;
 2481|  7.06k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  14.0k|         auto start = it;
 2485|  66.1k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 65.0k, False: 1.09k]
  |  Branch (2485:30): [True: 52.0k, False: 12.9k]
  ------------------
 2486|  52.0k|            ++it;
 2487|  52.0k|         }
 2488|       |
 2489|  14.0k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  14.0k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 71, False: 14.0k]
  ------------------
 2491|     71|            ctx.error = error_code::syntax_error;
 2492|     71|         }
 2493|  14.0k|      }
_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.06M|      {
 5311|  2.06M|         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.06M|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  2.06M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  2.06M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  2.06M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 2.06M, False: 0]
  ------------------
 5321|  2.06M|            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.06M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4616|  2.10M|      {
 4617|  2.10M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4617:14): [True: 0, False: 2.10M]
  ------------------
 4618|      0|            return;
 4619|       |
 4620|  2.10M|         yaml::node_preamble_state preamble{};
 4621|  2.10M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4621:14): [True: 41.5k, False: 2.06M]
  ------------------
 4622|  2.10M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4623|  41.5k|            return;
 4624|       |
 4625|  2.06M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4626|  2.06M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4626:14): [True: 33, False: 2.06M]
  ------------------
 4627|     33|            return;
 4628|       |
 4629|  2.06M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4630|  2.06M|         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.06M|         std::remove_cvref_t<T> preexisting_entries;
 4643|  2.06M|         if (!value.empty()) {
  ------------------
  |  Branch (4643:14): [True: 0, False: 2.06M]
  ------------------
 4644|      0|            preexisting_entries = std::move(value);
 4645|      0|            value.clear();
 4646|      0|         }
 4647|  2.06M|         struct merge_restore_guard
 4648|  2.06M|         {
 4649|  2.06M|            std::remove_cvref_t<T>& target;
 4650|  2.06M|            std::remove_cvref_t<T>& saved;
 4651|  2.06M|            ~merge_restore_guard()
 4652|  2.06M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  2.06M|               for (auto& entry : saved) {
 4656|  2.06M|                  target.emplace(entry.first, std::move(entry.second));
 4657|  2.06M|               }
 4658|  2.06M|            }
 4659|  2.06M|         } merge_restore{value, preexisting_entries};
 4660|       |
 4661|  2.06M|         const bool treat_as_block_mapping =
 4662|  2.06M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4662:13): [Folded, False: 2.06M]
  |  Branch (4662:48): [True: 0, False: 0]
  |  Branch (4662:62): [True: 0, False: 0]
  ------------------
 4663|       |
 4664|  2.06M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4664:14): [True: 1.26M, False: 797k]
  |  Branch (4664:28): [True: 0, Folded]
  ------------------
 4665|       |            // Flow mapping
 4666|  1.26M|            ++it;
 4667|       |            // Skip whitespace and newlines after opening brace
 4668|  1.26M|            yaml::skip_ws_and_newlines(it, end);
 4669|       |
 4670|  1.26M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4670:17): [True: 1.26M, False: 4.24k]
  |  Branch (4670:30): [True: 25.4k, False: 1.23M]
  ------------------
 4671|  25.4k|               ++it;
 4672|  25.4k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4673|  25.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4673:20): [True: 27, False: 25.3k]
  ------------------
 4674|     27|                  return;
 4675|  25.3k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4676|  25.3k|               return;
 4677|  25.4k|            }
 4678|       |
 4679|  4.27M|            while (it != end) {
  ------------------
  |  Branch (4679:20): [True: 4.26M, False: 11.3k]
  ------------------
 4680|       |               // Skip whitespace and newlines at start of each iteration
 4681|  4.26M|               yaml::skip_ws_and_newlines(it, end);
 4682|       |
 4683|  4.26M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4683:20): [True: 4.26M, False: 0]
  |  Branch (4683:33): [True: 31.3k, False: 4.22M]
  ------------------
 4684|  31.3k|                  ++it;
 4685|  31.3k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  31.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:23): [True: 36, False: 31.3k]
  ------------------
 4687|     36|                     return;
 4688|  31.3k|                  break;
 4689|  31.3k|               }
 4690|       |
 4691|  4.22M|               bool explicit_flow_key = false;
 4692|  4.22M|               auto explicit_probe = it;
 4693|  4.22M|               yaml::skip_inline_ws(explicit_probe, end);
 4694|  4.22M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4694:20): [True: 4.22M, False: 0]
  |  Branch (4694:45): [True: 66.5k, False: 4.16M]
  ------------------
 4695|  66.5k|                  const auto after_q = explicit_probe + 1;
 4696|  66.5k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4696:23): [True: 13, False: 66.4k]
  |  Branch (4696:41): [True: 40.5k, False: 25.9k]
  ------------------
 4697|  44.4k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4697:23): [True: 2.90k, False: 23.0k]
  |  Branch (4697:42): [True: 1.06k, False: 22.0k]
  ------------------
 4698|  44.4k|                     explicit_flow_key = true;
 4699|  44.4k|                     it = explicit_probe + 1;
 4700|  44.4k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4701|  44.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4701:26): [True: 9, False: 44.4k]
  ------------------
 4702|      9|                        return;
 4703|  44.4k|                  }
 4704|  66.5k|               }
 4705|       |               // Parse key
 4706|  4.22M|               key_t key{};
 4707|  4.22M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4708|  4.22M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4708:23): [True: 44.4k, False: 4.18M]
  |  Branch (4708:44): [True: 44.4k, False: 17]
  |  Branch (4708:58): [True: 2.62k, False: 41.8k]
  |  Branch (4708:72): [True: 16.5k, False: 25.2k]
  |  Branch (4708:86): [True: 1.81k, False: 23.4k]
  ------------------
 4709|  20.9k|                     key.clear();
 4710|  20.9k|                  }
 4711|  4.20M|                  else {
 4712|  4.20M|                     auto key_probe = it;
 4713|  4.20M|                     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|  4.20M|                     bool parse_complex_flow_key = false;
 4718|  4.20M|                     if (key_probe != end) {
  ------------------
  |  Branch (4718:26): [True: 4.20M, False: 17]
  ------------------
 4719|  4.20M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4719:29): [True: 24.0k, False: 4.18M]
  |  Branch (4719:50): [True: 71.3k, False: 4.11M]
  ------------------
 4720|  95.4k|                           parse_complex_flow_key = true;
 4721|  95.4k|                        }
 4722|  4.11M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4722:34): [True: 1.10M, False: 3.00M]
  ------------------
 4723|  1.10M|                           ++key_probe;
 4724|  1.10M|                           yaml::parse_anchor_name(key_probe, end);
 4725|  1.10M|                           yaml::skip_inline_ws(key_probe, end);
 4726|  1.10M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4726:32): [True: 1.10M, False: 179]
  |  Branch (4726:53): [True: 9.33k, False: 1.09M]
  |  Branch (4726:74): [True: 615k, False: 484k]
  ------------------
 4727|   624k|                              parse_complex_flow_key = true;
 4728|   624k|                           }
 4729|  1.10M|                        }
 4730|  4.20M|                     }
 4731|       |
 4732|  4.20M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4732:26): [True: 720k, False: 3.48M]
  ------------------
 4733|   720k|                        glz::generic key_node{};
 4734|   720k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4735|   720k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4735:29): [True: 28.6k, False: 691k]
  ------------------
 4736|  28.6k|                           return;
 4737|   691k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4737:29): [True: 63, False: 691k]
  ------------------
 4738|     63|                           return;
 4739|   691k|                     }
 4740|  3.48M|                     else {
 4741|  3.48M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4741:29): [True: 17.2k, False: 3.47M]
  ------------------
 4742|  17.2k|                           return;
 4743|  17.2k|                        }
 4744|  3.48M|                     }
 4745|  4.20M|                  }
 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|  4.18M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4760|  4.22M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4760:20): [True: 53, False: 4.22M]
  ------------------
 4761|     53|                  return;
 4762|       |
 4763|  4.22M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4764|  4.22M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4765|  4.22M|                     val = {};
 4766|  4.22M|                     return true;
 4767|  4.22M|                  }
 4768|  4.22M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  4.22M|                     val = glz::generic{};
 4770|  4.22M|                     return true;
 4771|  4.22M|                  }
 4772|  4.22M|                  else {
 4773|  4.22M|                     static constexpr std::string_view null_value{"null"};
 4774|  4.22M|                     auto null_it = null_value.data();
 4775|  4.22M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4776|  4.22M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4777|  4.22M|                     return !bool(ctx.error);
 4778|  4.22M|                  }
 4779|  4.22M|               };
 4780|       |
 4781|  4.22M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4781:20): [True: 4.18M, False: 47.7k]
  |  Branch (4781:34): [True: 1.72M, False: 2.45M]
  |  Branch (4781:48): [True: 416k, False: 2.03M]
  ------------------
 4782|  2.14M|                  val_t val{};
 4783|  2.14M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4783:23): [True: 0, False: 2.14M]
  ------------------
 4784|      0|                     return;
 4785|       |
 4786|  2.14M|                  value.emplace(std::move(key), std::move(val));
 4787|       |
 4788|  2.14M|                  if (*it == '}') {
  ------------------
  |  Branch (4788:23): [True: 416k, False: 1.72M]
  ------------------
 4789|   416k|                     ++it;
 4790|   416k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4791|   416k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4791:26): [True: 604, False: 415k]
  ------------------
 4792|    604|                        return;
 4793|   415k|                     break;
 4794|   416k|                  }
 4795|       |
 4796|  1.72M|                  ++it; // skip comma
 4797|  1.72M|                  yaml::skip_ws_and_newlines(it, end);
 4798|  1.72M|                  continue;
 4799|  2.14M|               }
 4800|       |
 4801|  2.08M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4801:20): [True: 47.7k, False: 2.03M]
  |  Branch (4801:33): [True: 2.44k, False: 2.03M]
  ------------------
 4802|  4.25k|                  ctx.error = error_code::syntax_error;
 4803|  4.25k|                  return;
 4804|  4.25k|               }
 4805|  2.08M|               ++it;
 4806|       |
 4807|  2.08M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4808|  2.08M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 14, False: 2.08M]
  ------------------
 4809|     14|                  return;
 4810|       |
 4811|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4812|  2.08M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4812:20): [True: 2.03M, False: 46.0k]
  |  Branch (4812:34): [True: 112k, False: 1.92M]
  |  Branch (4812:48): [True: 45.2k, False: 1.87M]
  ------------------
 4813|   157k|                  val_t val{};
 4814|   157k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4814:23): [True: 0, False: 157k]
  ------------------
 4815|      0|                     return;
 4816|       |
 4817|   157k|                  value.emplace(std::move(key), std::move(val));
 4818|       |
 4819|   157k|                  if (*it == '}') {
  ------------------
  |  Branch (4819:23): [True: 45.2k, False: 112k]
  ------------------
 4820|  45.2k|                     ++it;
 4821|  45.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4822|  45.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4822:26): [True: 17, False: 45.2k]
  ------------------
 4823|     17|                        return;
 4824|  45.2k|                     break;
 4825|  45.2k|                  }
 4826|       |
 4827|   112k|                  ++it; // skip comma
 4828|   112k|                  yaml::skip_ws_and_newlines(it, end);
 4829|   112k|                  continue;
 4830|   157k|               }
 4831|       |
 4832|       |               // Parse value
 4833|  1.92M|               val_t val{};
 4834|  1.92M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4835|  1.92M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4835:20): [True: 9.68k, False: 1.91M]
  ------------------
 4836|  9.68k|                  return;
 4837|       |
 4838|  1.91M|               value.emplace(std::move(key), std::move(val));
 4839|       |
 4840|  1.91M|               yaml::skip_inline_ws(it, end);
 4841|       |
 4842|  1.91M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4842:20): [True: 1.86M, False: 46.4k]
  |  Branch (4842:33): [True: 663k, False: 1.20M]
  ------------------
 4843|   663k|                  ++it;
 4844|   663k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4845|   663k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4845:23): [True: 823, False: 663k]
  ------------------
 4846|    823|                     return;
 4847|   663k|                  break;
 4848|   663k|               }
 4849|  1.24M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4849:25): [True: 1.20M, False: 46.4k]
  |  Branch (4849:38): [True: 1.14M, False: 59.3k]
  ------------------
 4850|  1.14M|                  ++it;
 4851|       |                  // Skip whitespace and newlines after comma
 4852|  1.14M|                  yaml::skip_ws_and_newlines(it, end);
 4853|  1.14M|               }
 4854|   105k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4854:25): [True: 59.3k, False: 46.4k]
  |  Branch (4854:39): [True: 27.1k, False: 32.1k]
  |  Branch (4854:54): [True: 31.2k, False: 958]
  ------------------
 4855|       |                  // Newlines may precede either the closing brace or the
 4856|       |                  // separator comma for the next entry.
 4857|  58.4k|                  yaml::skip_ws_and_newlines(it, end);
 4858|  58.4k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4858:23): [True: 58.3k, False: 61]
  |  Branch (4858:36): [True: 12.1k, False: 46.2k]
  ------------------
 4859|  12.1k|                     ++it;
 4860|  12.1k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4861|  12.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4861:26): [True: 11, False: 12.1k]
  ------------------
 4862|     11|                        return;
 4863|  12.1k|                     break;
 4864|  12.1k|                  }
 4865|  46.2k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4865:23): [True: 46.2k, False: 61]
  |  Branch (4865:36): [True: 45.9k, False: 250]
  ------------------
 4866|  45.9k|                     ++it;
 4867|  45.9k|                     yaml::skip_ws_and_newlines(it, end);
 4868|  45.9k|                     continue;
 4869|  45.9k|                  }
 4870|    311|                  ctx.error = error_code::syntax_error;
 4871|    311|                  return;
 4872|  46.2k|               }
 4873|  47.4k|               else {
 4874|  47.4k|                  ctx.error = error_code::syntax_error;
 4875|  47.4k|                  return;
 4876|  47.4k|               }
 4877|  1.91M|            }
 4878|  1.24M|         }
 4879|   797k|         else {
 4880|       |            // Block mapping - use shared loop with map-specific callback
 4881|   797k|            yaml::parse_block_mapping_loop<Opts>(
 4882|   797k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|   797k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   797k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|   797k|                        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|   797k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   797k|                           if (ctx.stream_begin) {
 4893|   797k|                              auto is_line_content_start = [&](auto pos) {
 4894|   797k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   797k|                              };
 4896|       |
 4897|   797k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   797k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   797k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   797k|                                 return line != end && *line == ':';
 4901|   797k|                              };
 4902|       |
 4903|   797k|                              if (!is_line_content_start(it) &&
 4904|   797k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|   797k|                                  !line_has_explicit_value_indicator(it)) {
 4906|   797k|                                 ctx.error = error_code::syntax_error;
 4907|   797k|                                 return false;
 4908|   797k|                              }
 4909|   797k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   797k|                           }
 4911|   797k|                        }
 4912|       |
 4913|   797k|                        if (*it == '-' &&
 4914|   797k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|   797k|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|   797k|                           ctx.error = error_code::syntax_error;
 4918|   797k|                           return false;
 4919|   797k|                        }
 4920|       |
 4921|   797k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|   797k|                           return false;
 4923|   797k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   797k|                        ctx.pop_indent();
 4925|   797k|                     }
 4926|   797k|                     else {
 4927|   797k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   797k|                        if (nested_indent >= 0) {
 4929|   797k|                           yaml::skip_to_content(it, end);
 4930|   797k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|   797k|                              ctx.error = error_code::syntax_error;
 4932|   797k|                              return false;
 4933|   797k|                           }
 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|   797k|                           const int32_t value_indent =
 4937|   797k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|   797k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|   797k|                              return false;
 4940|   797k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   797k|                           ctx.pop_indent();
 4942|   797k|                        }
 4943|   797k|                     }
 4944|   797k|                     return !bool(ctx.error);
 4945|   797k|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|   797k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4951|   797k|                     ctx.error = error_code::syntax_error;
 4952|   797k|                     return false;
 4953|   797k|                  }
 4954|   797k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4955|   797k|                     ++it; // skip '?'
 4956|   797k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   797k|                     const int32_t explicit_value_indicator_indent =
 4959|   797k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4960|       |
 4961|   797k|                     key_t key{};
 4962|   797k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   797k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   797k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   797k|                        };
 4966|       |
 4967|   797k|                        auto key_it = it;
 4968|   797k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   797k|                        auto content = key_it;
 4971|   797k|                        yaml::skip_to_content(content, end);
 4972|   797k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   797k|                        if (content != end && *content == '&') {
 4978|   797k|                           auto anchor_probe = content + 1;
 4979|   797k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   797k|                           if (!anchor_name.empty()) {
 4981|   797k|                              auto after_anchor = anchor_probe;
 4982|   797k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   797k|                              auto value_indicator = after_anchor;
 4985|   797k|                              if (value_indicator != end && *value_indicator == ':') {
 4986|   797k|                                 key.clear();
 4987|   797k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|   797k|                                 it = value_indicator;
 4989|   797k|                                 handled_anchor_only_empty_key = true;
 4990|   797k|                              }
 4991|   797k|                              else {
 4992|   797k|                                 if (value_indicator != end && *value_indicator == '#') {
 4993|   797k|                                    yaml::skip_comment(value_indicator, end);
 4994|   797k|                                 }
 4995|   797k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4996|   797k|                                    yaml::skip_newline(value_indicator, end);
 4997|   797k|                                    auto value_line = value_indicator;
 4998|   797k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|   797k|                                    if (bool(ctx.error)) [[unlikely]]
 5000|   797k|                                       return false;
 5001|   797k|                                    if (value_line != end && *value_line == ':' &&
 5002|   797k|                                        value_indent == explicit_value_indicator_indent) {
 5003|   797k|                                       key.clear();
 5004|   797k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|   797k|                                       it = value_line;
 5006|   797k|                                       handled_anchor_only_empty_key = true;
 5007|   797k|                                    }
 5008|   797k|                                    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|   797k|                                       ctx.error = error_code::syntax_error;
 5013|   797k|                                       return false;
 5014|   797k|                                    }
 5015|   797k|                                 }
 5016|   797k|                              }
 5017|   797k|                           }
 5018|   797k|                        }
 5019|       |
 5020|   797k|                        const bool key_content_spans_lines = [&] {
 5021|   797k|                           auto scan = key_it;
 5022|   797k|                           while (scan != content && scan != end) {
 5023|   797k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   797k|                              ++scan;
 5025|   797k|                           }
 5026|   797k|                           return false;
 5027|   797k|                        }();
 5028|       |
 5029|   797k|                        if (handled_anchor_only_empty_key) {
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|   797k|                        }
 5032|   797k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5033|   797k|                           key.clear();
 5034|   797k|                           it = content;
 5035|   797k|                        }
 5036|   797k|                        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|   797k|                           auto key_node_it = content;
 5042|   797k|                           auto key_node_end = end;
 5043|   797k|                           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|   797k|                              auto scan = content;
 5048|   797k|                              while (scan != end) {
 5049|   797k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5050|   797k|                                    ++scan;
 5051|   797k|                                 }
 5052|   797k|                                 if (scan == end) {
 5053|   797k|                                    break;
 5054|   797k|                                 }
 5055|       |
 5056|   797k|                                 yaml::skip_newline(scan, end);
 5057|   797k|                                 auto line_start = scan;
 5058|       |
 5059|   797k|                                 int32_t indicator_indent = 0;
 5060|   797k|                                 while (scan != end && *scan == ' ') {
 5061|   797k|                                    ++indicator_indent;
 5062|   797k|                                    ++scan;
 5063|   797k|                                 }
 5064|       |
 5065|   797k|                                 if (scan != end && *scan == ':') {
 5066|   797k|                                    const auto after_colon = scan + 1;
 5067|   797k|                                    if ((after_colon == end ||
 5068|   797k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5069|   797k|                                        indicator_indent <= line_indent) {
 5070|   797k|                                       key_node_end = line_start;
 5071|   797k|                                       break;
 5072|   797k|                                    }
 5073|   797k|                                 }
 5074|   797k|                              }
 5075|   797k|                           }
 5076|       |
 5077|   797k|                           glz::generic key_node{};
 5078|   797k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   797k|                           ctx.explicit_mapping_key_context = true;
 5080|   797k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   797k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   797k|                           if (bool(ctx.error)) [[unlikely]]
 5083|   797k|                              return false;
 5084|   797k|                           it = key_node_it;
 5085|   797k|                           if (!to_string_key(key_node)) [[unlikely]]
 5086|   797k|                              return false;
 5087|   797k|                        }
 5088|   797k|                     }
 5089|   797k|                     else {
 5090|   797k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5091|   797k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5092|   797k|                           if (bool(ctx.error)) [[unlikely]]
 5093|   797k|                              return false;
 5094|   797k|                        }
 5095|   797k|                     }
 5096|       |
 5097|   797k|                     yaml::skip_inline_ws(it, end);
 5098|   797k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   797k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5102|   797k|                        auto probe = it;
 5103|   797k|                        bool found_value_indicator = false;
 5104|       |
 5105|   797k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5106|   797k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   797k|                           auto value_line = probe;
 5109|   797k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   797k|                           if (bool(ctx.error)) [[unlikely]]
 5111|   797k|                              return false;
 5112|       |
 5113|   797k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5114|   797k|                              probe = value_line;
 5115|   797k|                              continue; // blank line
 5116|   797k|                           }
 5117|   797k|                           if (*value_line == '#') {
 5118|   797k|                              yaml::skip_comment(value_line, end);
 5119|   797k|                              probe = value_line;
 5120|   797k|                              continue; // comment-only line
 5121|   797k|                           }
 5122|   797k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5123|   797k|                              it = value_line;
 5124|   797k|                              found_value_indicator = true;
 5125|   797k|                           }
 5126|   797k|                           break;
 5127|   797k|                        }
 5128|       |
 5129|   797k|                        if (found_value_indicator) {
 5130|   797k|                           yaml::skip_inline_ws(it, end);
 5131|   797k|                        }
 5132|   797k|                     }
 5133|       |
 5134|   797k|                     val_t val{};
 5135|   797k|                     if (it != end && *it == ':') {
 5136|   797k|                        ++it;
 5137|   797k|                        if (it != end && *it == '\t') {
 5138|   797k|                           ctx.error = error_code::syntax_error;
 5139|   797k|                           return false;
 5140|   797k|                        }
 5141|   797k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5142|   797k|                           auto probe = it;
 5143|   797k|                           yaml::skip_newline(probe, end);
 5144|   797k|                           while (probe != end && *probe == ' ') ++probe;
 5145|   797k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5146|   797k|                              ctx.error = error_code::syntax_error;
 5147|   797k|                              return false;
 5148|   797k|                           }
 5149|   797k|                        }
 5150|   797k|                        yaml::skip_inline_ws(it, end);
 5151|   797k|                        if (!parse_map_value(val)) [[unlikely]]
 5152|   797k|                           return false;
 5153|   797k|                     }
 5154|       |
 5155|   797k|                     value.emplace(std::move(key), std::move(val));
 5156|   797k|                     return true;
 5157|   797k|                  }
 5158|       |
 5159|   797k|                  key_t key{};
 5160|   797k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   797k|                     auto key_probe = it;
 5162|   797k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   797k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5164|   797k|                     if (complex_flow_key) {
 5165|   797k|                        glz::generic key_node{};
 5166|   797k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|   797k|                        if (bool(ctx.error)) [[unlikely]]
 5168|   797k|                           return false;
 5169|   797k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5170|   797k|                           return false;
 5171|   797k|                     }
 5172|   797k|                     else {
 5173|   797k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5174|   797k|                           return false;
 5175|   797k|                        }
 5176|   797k|                     }
 5177|   797k|                  }
 5178|   797k|                  else {
 5179|   797k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5180|   797k|                     if (bool(ctx.error)) [[unlikely]]
 5181|   797k|                        return false;
 5182|   797k|                  }
 5183|       |
 5184|   797k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   797k|                  if (it == end || *it != ':') {
 5187|   797k|                     ctx.error = error_code::syntax_error;
 5188|   797k|                     return false;
 5189|   797k|                  }
 5190|   797k|                  ++it;
 5191|   797k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   797k|                  val_t val{};
 5194|   797k|                  if (!parse_map_value(val)) [[unlikely]]
 5195|   797k|                     return false;
 5196|       |
 5197|   797k|                  value.emplace(std::move(key), std::move(val));
 5198|   797k|                  return true;
 5199|   797k|               });
 5200|   797k|         }
 5201|       |
 5202|  1.97M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5203|  1.97M|      }
_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.10M|      {
  466|  2.10M|         skip_inline_ws(it, end);
  467|       |
  468|  2.10M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 15, False: 2.10M]
  ------------------
  469|     15|            if constexpr (!AllowEmptyInput) {
  470|     15|               ctx.error = error_code::unexpected_end;
  471|     15|            }
  472|     15|            return true;
  473|     15|         }
  474|       |
  475|  2.10M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.10M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 2.10M]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|  2.10M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 12, False: 2.10M]
  ------------------
  481|     12|            ctx.error = error_code::syntax_error;
  482|     12|            return true;
  483|     12|         }
  484|       |
  485|  2.10M|         skip_inline_ws(it, end);
  486|       |
  487|  2.10M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 15, False: 2.10M]
  ------------------
  488|     15|            if constexpr (!AllowEmptyInput) {
  489|     15|               ctx.error = error_code::unexpected_end;
  490|     15|            }
  491|     15|            return true;
  492|     15|         }
  493|       |
  494|  2.10M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 41.5k, False: 2.06M]
  ------------------
  495|  41.5k|            return true;
  496|  41.5k|         }
  497|       |
  498|  2.06M|         return false;
  499|  2.10M|      }
_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.10M|                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.10M|      {
  409|  2.10M|         state.has_anchor = false;
  410|  2.10M|         state.anchor_name.clear();
  411|  2.10M|         state.anchor_start = nullptr;
  412|  2.10M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.10M|         if constexpr (Policy.allow_alias) {
  415|  2.10M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  2.10M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 2.10M, False: 1.57k]
  ------------------
  417|  2.10M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 41.4k, False: 2.06M]
  ------------------
  418|  2.10M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  2.10M|         }
  424|       |
  425|  2.10M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.06M, False: 41.4k]
  |  Branch (425:27): [True: 27.0k, False: 2.03M]
  ------------------
  426|  27.0k|            ++it;
  427|  27.0k|            auto name = parse_anchor_name(it, end);
  428|  27.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 27.0k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  27.0k|            skip_inline_ws(it, end);
  433|  27.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 32, False: 26.9k]
  ------------------
  434|     32|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     32|                  ctx.error = error_code::unexpected_end;
  436|     32|               }
  437|     32|               return true;
  438|     32|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  26.9k|            state.has_anchor = true;
  446|  26.9k|            state.anchor_name = std::string(name);
  447|  26.9k|            state.anchor_start = &*it;
  448|  26.9k|         }
  449|       |
  450|  2.10M|         return false;
  451|  2.10M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  2.10M|      {
  301|  2.10M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.10M]
  |  Branch (301:27): [True: 2.06M, False: 41.4k]
  ------------------
  302|       |
  303|  41.4k|         ++it; // skip '*'
  304|  41.4k|         auto name = parse_anchor_name(it, end);
  305|  41.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 32, False: 41.4k]
  ------------------
  306|     32|            ctx.error = error_code::syntax_error;
  307|     32|            return true;
  308|     32|         }
  309|       |
  310|  41.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  41.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 154, False: 41.2k]
  ------------------
  312|    154|            ctx.error = error_code::syntax_error; // undefined alias
  313|    154|            return true;
  314|    154|         }
  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|  41.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  41.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.43k, False: 36.8k]
  ------------------
  322|  4.43k|            return true;
  323|  4.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|  36.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 20, False: 36.8k]
  ------------------
  329|     20|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     20|            return true;
  331|     20|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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|  36.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  36.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 36.8k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  36.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 21, False: 36.8k]
  ------------------
  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|  36.8k|         auto replay_it = span.begin;
  348|  36.8k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  36.8k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  36.8k|         ctx.indent_stack.clear();
  353|  36.8k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.47k, False: 34.3k]
  ------------------
  354|  2.47k|            ctx.push_indent(span.base_indent - 1);
  355|  2.47k|         }
  356|       |
  357|  36.8k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  36.8k|         using V = std::remove_cvref_t<T>;
  360|  36.8k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  36.8k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  36.8k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  36.8k|         return true;
  367|  36.8k|      }
_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.30M|               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.30M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|  2.30M|                     val = glz::generic{};
 4770|  2.30M|                     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.30M|               };
_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|   797k|      {
 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|   797k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 797k]
  ------------------
 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|   797k|         const int32_t parent_indent = ctx.current_indent();
 3722|   797k|         const bool discover_indent = (mapping_indent < 0);
 3723|   797k|         bool first_key = !discover_indent;
 3724|   797k|         bool discovered_first_key_mid_line = false;
 3725|   797k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  1.94M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.24M, False: 695k]
  ------------------
 3728|  1.24M|            auto line_start = it;
 3729|  1.24M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.24M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  1.80M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 1.78M, False: 17.8k]
  ------------------
 3733|  1.78M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 39.1k, False: 1.74M]
  ------------------
 3734|  39.1k|                  skip_comment(it, end);
 3735|  39.1k|                  skip_newline(it, end);
 3736|  39.1k|                  first_key = false;
 3737|  39.1k|                  line_indent = 0;
 3738|  39.1k|               }
 3739|  1.74M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 80.3k, False: 1.66M]
  |  Branch (3739:40): [True: 376k, False: 1.29M]
  ------------------
 3740|   456k|                  skip_newline(it, end);
 3741|   456k|                  first_key = false;
 3742|   456k|                  line_indent = 0;
 3743|   456k|               }
 3744|  1.29M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 221k, False: 1.07M]
  ------------------
 3745|   221k|                  line_start = it;
 3746|   221k|                  line_indent = 0;
 3747|  1.03M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 1.02M, False: 7.40k]
  |  Branch (3747:39): [True: 812k, False: 213k]
  ------------------
 3748|   812k|                     ++line_indent;
 3749|   812k|                     ++it;
 3750|   812k|                  }
 3751|       |
 3752|   221k|                  bool saw_tab = false;
 3753|   227k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 218k, False: 8.97k]
  |  Branch (3753:40): [True: 1.44k, False: 216k]
  |  Branch (3753:54): [True: 4.53k, False: 212k]
  ------------------
 3754|  5.98k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 3.25k, False: 2.73k]
  |  Branch (3754:43): [True: 2.73k, False: 0]
  ------------------
 3755|  5.98k|                     ++it;
 3756|  5.98k|                  }
 3757|       |
 3758|   221k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 8.97k, False: 212k]
  |  Branch (3758:36): [True: 8.34k, False: 204k]
  |  Branch (3758:51): [True: 4.20k, False: 199k]
  |  Branch (3758:66): [True: 7.61k, False: 192k]
  ------------------
 3759|  29.1k|                     first_key = false;
 3760|  29.1k|                     line_indent = 0;
 3761|  29.1k|                     continue; // Blank or comment line
 3762|  29.1k|                  }
 3763|       |
 3764|   192k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 94, False: 192k]
  ------------------
 3765|     94|                     ctx.error = error_code::syntax_error;
 3766|     94|                     return;
 3767|     94|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   192k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 187k, False: 4.71k]
  |  Branch (3770:46): [True: 1.14k, False: 186k]
  ------------------
 3771|  1.14k|                     it = line_start;
 3772|  1.14k|                     return;
 3773|  1.14k|                  }
 3774|       |
 3775|   190k|                  first_key = false;
 3776|   190k|                  break; // Found content
 3777|   192k|               }
 3778|  1.07M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 31.8k, False: 1.03M]
  ------------------
 3779|  31.8k|                  line_start = it;
 3780|  72.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 71.2k, False: 1.51k]
  |  Branch (3780:40): [True: 3.86k, False: 67.3k]
  |  Branch (3780:54): [True: 37.0k, False: 30.3k]
  ------------------
 3781|  31.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 1.51k, False: 30.3k]
  |  Branch (3781:36): [True: 3.20k, False: 27.1k]
  |  Branch (3781:51): [True: 26.0k, False: 1.08k]
  |  Branch (3781:66): [True: 936, False: 145]
  ------------------
 3782|  31.7k|                     first_key = false;
 3783|  31.7k|                     line_indent = 0;
 3784|  31.7k|                     continue; // Blank or comment-only line with tab indentation
 3785|  31.7k|                  }
 3786|    145|                  ctx.error = error_code::syntax_error;
 3787|    145|                  return;
 3788|  31.8k|               }
 3789|  1.03M|               else {
 3790|  1.03M|                  line_start = it;
 3791|  1.03M|                  break; // Content at column 0
 3792|  1.03M|               }
 3793|  1.78M|            }
 3794|       |
 3795|  1.24M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 17.8k, False: 1.23M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.23M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 4.85k, False: 1.22M]
  |  Branch (3799:45): [True: 3.44k, False: 1.22M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.22M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.22M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.22M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.22M, False: 0]
  |  Branch (3806:39): [True: 426k, False: 795k]
  |  Branch (3806:62): [True: 52.7k, False: 373k]
  |  Branch (3806:84): [True: 32.6k, False: 20.0k]
  ------------------
 3807|  32.6k|                  it = line_start;
 3808|  32.6k|                  return;
 3809|  32.6k|               }
 3810|  1.18M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 393k, False: 795k]
  |  Branch (3810:43): [True: 789, False: 392k]
  ------------------
 3811|    789|                  it = line_start;
 3812|    789|                  return;
 3813|    789|               }
 3814|  1.18M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.18M|            bool established_mapping_indent_this_line = false;
 3818|  1.18M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 795k, False: 392k]
  ------------------
 3819|   795k|               mapping_indent = line_indent;
 3820|   795k|               established_mapping_indent_this_line = true;
 3821|   795k|               discovered_first_key_visual_indent = line_indent;
 3822|   795k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   795k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 795k, False: 0]
  |  Branch (3823:43): [True: 795k, False: 0]
  ------------------
 3824|   795k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   795k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 325, False: 795k]
  ------------------
 3826|    325|                        ctx.error = error_code::syntax_error;
 3827|    325|                        return;
 3828|    325|                     }
 3829|       |
 3830|   795k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   795k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 790k, False: 4.71k]
  |  Branch (3831:49): [True: 630k, False: 160k]
  ------------------
 3832|   630k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   630k|                     }
 3834|   795k|                  }
 3835|   795k|               }
 3836|   795k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.18M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.18M, False: 325]
  |  Branch (3840:36): [True: 1.18M, False: 0]
  |  Branch (3840:59): [True: 392k, False: 795k]
  ------------------
 3841|   392k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 219k, False: 173k]
  ------------------
 3842|   219k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 218k, False: 728]
  |  Branch (3842:43): [True: 94.0k, False: 124k]
  ------------------
 3843|  94.0k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 81, False: 93.9k]
  ------------------
 3844|     81|                     ctx.error = error_code::syntax_error;
 3845|     81|                     return;
 3846|     81|                  }
 3847|  93.9k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 2.86k, False: 91.0k]
  ------------------
 3848|  2.86k|                     it = line_start;
 3849|  2.86k|                     return;
 3850|  2.86k|                  }
 3851|  93.9k|               }
 3852|   125k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 806, False: 124k]
  ------------------
 3853|    806|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 56, 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: 6, False: 736]
  ------------------
 3855|     70|                  ctx.error = error_code::syntax_error;
 3856|     70|                  return;
 3857|     70|               }
 3858|   219k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.18M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.18M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.18M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.18M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.18M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 325, False: 1.18M]
  |  Branch (3876:32): [True: 0, False: 1.18M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.18M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 381k, False: 803k]
  |  Branch (3885:53): [True: 121k, False: 260k]
  |  Branch (3885:94): [True: 43.9k, False: 77.6k]
  ------------------
 3886|  43.9k|               const auto after_colon = it + 1;
 3887|  43.9k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 39.8k, False: 4.16k]
  ------------------
 3888|  43.9k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 1.06k, False: 42.9k]
  |  Branch (3888:43): [True: 40.7k, False: 2.18k]
  ------------------
 3889|  41.8k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 2.51k, False: 39.3k]
  ------------------
 3890|  2.51k|                  it = line_start;
 3891|  2.51k|                  return;
 3892|  2.51k|               }
 3893|  43.9k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.18M|            int32_t effective_line_indent = line_indent;
 3897|  1.18M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.18M, False: 325]
  |  Branch (3897:36): [True: 795k, False: 387k]
  ------------------
 3898|   795k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 630k, False: 165k]
  ------------------
 3899|   630k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 450k, False: 179k]
  |  Branch (3899:52): [True: 276k, 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|   354k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   354k|            }
 3912|       |
 3913|  1.18M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 35.4k, False: 1.14M]
  ------------------
 3914|  35.4k|               return;
 3915|  35.4k|            }
 3916|  1.14M|            first_key = false;
 3917|       |
 3918|  1.14M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.14M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|  1.14M|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|  1.14M|               auto flow_end = it;
 3925|  1.14M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|  1.14M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 111, False: 1.14M]
  ------------------
 3927|    111|                  return;
 3928|  1.14M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 955k, False: 191k]
  |  Branch (3928:40): [True: 386k, False: 569k]
  |  Branch (3928:60): [True: 13.3k, False: 555k]
  |  Branch (3928:80): [True: 119k, False: 436k]
  ------------------
 3929|   519k|                  it = flow_end;
 3930|   519k|                  return;
 3931|   519k|               }
 3932|  1.14M|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.14M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 471k, False: 675k]
  ------------------
 3938|   471k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 103k, False: 368k]
  |  Branch (3938:34): [True: 3.91k, False: 364k]
  ------------------
 3939|   107k|                  auto peek = it;
 3940|   107k|                  skip_inline_ws(peek, end);
 3941|   107k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 101k, False: 5.40k]
  |  Branch (3941:38): [True: 97.7k, False: 4.25k]
  |  Branch (3941:55): [True: 94.8k, False: 2.90k]
  |  Branch (3941:72): [True: 90.0k, False: 4.78k]
  ------------------
 3942|  90.0k|                     continue; // At leading indent of new line
 3943|  90.0k|                  }
 3944|   107k|               }
 3945|   381k|               skip_inline_ws(it, end);
 3946|   381k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 376k, False: 5.40k]
  |  Branch (3946:33): [True: 19.9k, False: 356k]
  ------------------
 3947|  19.9k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  19.9k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 19.9k, False: 0]
  ------------------
 3949|  19.9k|                        const char prev = *(it - 1);
 3950|  19.9k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 8.25k, False: 11.7k]
  |  Branch (3950:44): [True: 5.30k, False: 2.95k]
  |  Branch (3950:60): [True: 2.50k, False: 2.79k]
  |  Branch (3950:76): [True: 18, False: 2.48k]
  ------------------
 3951|     18|                           ctx.error = error_code::syntax_error;
 3952|     18|                           return;
 3953|     18|                        }
 3954|  19.9k|                     }
 3955|  19.9k|                  }
 3956|  19.9k|               }
 3957|  19.9k|               skip_comment(it, end);
 3958|   381k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 375k, False: 6.15k]
  |  Branch (3958:34): [True: 74.4k, False: 301k]
  |  Branch (3958:49): [True: 126k, False: 174k]
  ------------------
 3959|   201k|                  skip_newline(it, end);
 3960|   201k|               }
 3961|   180k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 174k, False: 6.15k]
  ------------------
 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|   174k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   174k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 588, False: 173k]
  ------------------
 3968|    588|                        ctx.error = error_code::syntax_error;
 3969|    588|                        return;
 3970|    588|                     }
 3971|   174k|                  }
 3972|   174k|               }
 3973|   381k|            }
 3974|  1.14M|         }
 3975|   797k|      }
_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.18M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.18M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.18M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.18M|                        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.18M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.18M|                           if (ctx.stream_begin) {
 4893|  1.18M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.18M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.18M|                              };
 4896|       |
 4897|  1.18M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.18M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.18M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.18M|                                 return line != end && *line == ':';
 4901|  1.18M|                              };
 4902|       |
 4903|  1.18M|                              if (!is_line_content_start(it) &&
 4904|  1.18M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.18M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.18M|                                 ctx.error = error_code::syntax_error;
 4907|  1.18M|                                 return false;
 4908|  1.18M|                              }
 4909|  1.18M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.18M|                           }
 4911|  1.18M|                        }
 4912|       |
 4913|  1.18M|                        if (*it == '-' &&
 4914|  1.18M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.18M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.18M|                           ctx.error = error_code::syntax_error;
 4918|  1.18M|                           return false;
 4919|  1.18M|                        }
 4920|       |
 4921|  1.18M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.18M|                           return false;
 4923|  1.18M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.18M|                        ctx.pop_indent();
 4925|  1.18M|                     }
 4926|  1.18M|                     else {
 4927|  1.18M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.18M|                        if (nested_indent >= 0) {
 4929|  1.18M|                           yaml::skip_to_content(it, end);
 4930|  1.18M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.18M|                              ctx.error = error_code::syntax_error;
 4932|  1.18M|                              return false;
 4933|  1.18M|                           }
 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.18M|                           const int32_t value_indent =
 4937|  1.18M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.18M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.18M|                              return false;
 4940|  1.18M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.18M|                           ctx.pop_indent();
 4942|  1.18M|                        }
 4943|  1.18M|                     }
 4944|  1.18M|                     return !bool(ctx.error);
 4945|  1.18M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.18M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 472k, False: 710k]
  |  Branch (4950:37): [True: 471k, False: 1.29k]
  |  Branch (4950:58): [True: 6, False: 471k]
  ------------------
 4951|      6|                     ctx.error = error_code::syntax_error;
 4952|      6|                     return false;
 4953|      6|                  }
 4954|  1.18M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 472k, False: 710k]
  |  Branch (4954:38): [True: 1.29k, False: 471k]
  |  Branch (4954:57): [True: 129k, False: 341k]
  |  Branch (4954:77): [True: 193k, False: 147k]
  |  Branch (4954:98): [True: 124k, False: 22.9k]
  ------------------
 4955|   449k|                     ++it; // skip '?'
 4956|   449k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   449k|                     const int32_t explicit_value_indicator_indent =
 4959|   449k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 327k, False: 122k]
  ------------------
 4960|       |
 4961|   449k|                     key_t key{};
 4962|   449k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   449k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   449k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   449k|                        };
 4966|       |
 4967|   449k|                        auto key_it = it;
 4968|   449k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   449k|                        auto content = key_it;
 4971|   449k|                        yaml::skip_to_content(content, end);
 4972|   449k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   449k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 439k, False: 9.93k]
  |  Branch (4977:47): [True: 125k, False: 314k]
  ------------------
 4978|   125k|                           auto anchor_probe = content + 1;
 4979|   125k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|   125k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 124k, False: 41]
  ------------------
 4981|   124k|                              auto after_anchor = anchor_probe;
 4982|   124k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|   124k|                              auto value_indicator = after_anchor;
 4985|   124k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 114k, False: 10.0k]
  |  Branch (4985:61): [True: 7.46k, False: 107k]
  ------------------
 4986|  7.46k|                                 key.clear();
 4987|  7.46k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  7.46k|                                 it = value_indicator;
 4989|  7.46k|                                 handled_anchor_only_empty_key = true;
 4990|  7.46k|                              }
 4991|   117k|                              else {
 4992|   117k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 107k, False: 10.0k]
  |  Branch (4992:64): [True: 6.26k, False: 101k]
  ------------------
 4993|  6.26k|                                    yaml::skip_comment(value_indicator, end);
 4994|  6.26k|                                 }
 4995|   117k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 106k, False: 10.6k]
  |  Branch (4995:65): [True: 14.4k, False: 92.4k]
  |  Branch (4995:93): [True: 41.2k, False: 51.2k]
  ------------------
 4996|  55.7k|                                    yaml::skip_newline(value_indicator, end);
 4997|  55.7k|                                    auto value_line = value_indicator;
 4998|  55.7k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  55.7k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 12, False: 55.7k]
  ------------------
 5000|     12|                                       return false;
 5001|  55.7k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 52.4k, False: 3.26k]
  |  Branch (5001:62): [True: 4.95k, False: 47.4k]
  ------------------
 5002|  4.95k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 4.93k, False: 21]
  ------------------
 5003|  4.93k|                                       key.clear();
 5004|  4.93k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  4.93k|                                       it = value_line;
 5006|  4.93k|                                       handled_anchor_only_empty_key = true;
 5007|  4.93k|                                    }
 5008|  50.7k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 47.5k, False: 3.26k]
  |  Branch (5008:67): [True: 21, False: 47.4k]
  ------------------
 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|     21|                                       ctx.error = error_code::syntax_error;
 5013|     21|                                       return false;
 5014|     21|                                    }
 5015|  55.7k|                                 }
 5016|   117k|                              }
 5017|   124k|                           }
 5018|   125k|                        }
 5019|       |
 5020|   449k|                        const bool key_content_spans_lines = [&] {
 5021|   449k|                           auto scan = key_it;
 5022|   449k|                           while (scan != content && scan != end) {
 5023|   449k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   449k|                              ++scan;
 5025|   449k|                           }
 5026|   449k|                           return false;
 5027|   449k|                        }();
 5028|       |
 5029|   449k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 12.3k, False: 437k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  12.3k|                        }
 5032|   437k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 9.93k, False: 427k]
  |  Branch (5032:53): [True: 42.5k, False: 384k]
  |  Branch (5032:72): [True: 39.7k, False: 2.74k]
  ------------------
 5033|  49.7k|                           key.clear();
 5034|  49.7k|                           it = content;
 5035|  49.7k|                        }
 5036|   387k|                        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|   387k|                           auto key_node_it = content;
 5042|   387k|                           auto key_node_end = end;
 5043|   387k|                           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|   387k|                              auto scan = content;
 5048|  3.30M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 3.26M, False: 45.5k]
  ------------------
 5049|   214M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 214M, False: 230k]
  |  Branch (5049:56): [True: 213M, False: 1.19M]
  |  Branch (5049:73): [True: 211M, False: 1.83M]
  ------------------
 5050|   211M|                                    ++scan;
 5051|   211M|                                 }
 5052|  3.26M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 230k, False: 3.03M]
  ------------------
 5053|   230k|                                    break;
 5054|   230k|                                 }
 5055|       |
 5056|  3.03M|                                 yaml::skip_newline(scan, end);
 5057|  3.03M|                                 auto line_start = scan;
 5058|       |
 5059|  3.03M|                                 int32_t indicator_indent = 0;
 5060|  5.13M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 5.08M, False: 45.5k]
  |  Branch (5060:56): [True: 2.09M, False: 2.98M]
  ------------------
 5061|  2.09M|                                    ++indicator_indent;
 5062|  2.09M|                                    ++scan;
 5063|  2.09M|                                 }
 5064|       |
 5065|  3.03M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 2.98M, False: 45.5k]
  |  Branch (5065:53): [True: 248k, False: 2.73M]
  ------------------
 5066|   248k|                                    const auto after_colon = scan + 1;
 5067|   248k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 2.81k, False: 245k]
  ------------------
 5068|   245k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 206k, False: 38.9k]
  ------------------
 5069|   209k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 111k, False: 98.2k]
  ------------------
 5070|   111k|                                       key_node_end = line_start;
 5071|   111k|                                       break;
 5072|   111k|                                    }
 5073|   248k|                                 }
 5074|  3.03M|                              }
 5075|   387k|                           }
 5076|       |
 5077|   387k|                           glz::generic key_node{};
 5078|   387k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   387k|                           ctx.explicit_mapping_key_context = true;
 5080|   387k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   387k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   387k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 4.93k, False: 382k]
  ------------------
 5083|  4.93k|                              return false;
 5084|   382k|                           it = key_node_it;
 5085|   382k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 15, False: 382k]
  ------------------
 5086|     15|                              return false;
 5087|   382k|                        }
 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|   444k|                     yaml::skip_inline_ws(it, end);
 5098|   449k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   449k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 378k, False: 70.5k]
  |  Branch (5101:40): [True: 30.0k, False: 348k]
  |  Branch (5101:55): [True: 72.9k, False: 275k]
  ------------------
 5102|   103k|                        auto probe = it;
 5103|   103k|                        bool found_value_indicator = false;
 5104|       |
 5105|   140k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 128k, False: 12.4k]
  |  Branch (5105:49): [True: 40.4k, False: 87.8k]
  |  Branch (5105:67): [True: 87.8k, False: 29]
  ------------------
 5106|   128k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   128k|                           auto value_line = probe;
 5109|   128k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   128k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 6, False: 128k]
  ------------------
 5111|      6|                              return false;
 5112|       |
 5113|   128k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 11.3k, False: 116k]
  |  Branch (5113:53): [True: 5.03k, False: 111k]
  |  Branch (5113:76): [True: 10.1k, False: 101k]
  ------------------
 5114|  26.5k|                              probe = value_line;
 5115|  26.5k|                              continue; // blank line
 5116|  26.5k|                           }
 5117|   101k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 11.0k, False: 90.6k]
  ------------------
 5118|  11.0k|                              yaml::skip_comment(value_line, end);
 5119|  11.0k|                              probe = value_line;
 5120|  11.0k|                              continue; // comment-only line
 5121|  11.0k|                           }
 5122|  90.6k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 45.3k, False: 45.2k]
  |  Branch (5122:54): [True: 14.2k, False: 31.1k]
  ------------------
 5123|  14.2k|                              it = value_line;
 5124|  14.2k|                              found_value_indicator = true;
 5125|  14.2k|                           }
 5126|  90.6k|                           break;
 5127|   101k|                        }
 5128|       |
 5129|   103k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 14.2k, False: 88.8k]
  ------------------
 5130|  14.2k|                           yaml::skip_inline_ws(it, end);
 5131|  14.2k|                        }
 5132|   103k|                     }
 5133|       |
 5134|   449k|                     val_t val{};
 5135|   449k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 378k, False: 70.5k]
  |  Branch (5135:39): [True: 153k, False: 225k]
  ------------------
 5136|   153k|                        ++it;
 5137|   153k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 149k, False: 3.65k]
  |  Branch (5137:42): [True: 9, False: 149k]
  ------------------
 5138|      9|                           ctx.error = error_code::syntax_error;
 5139|      9|                           return false;
 5140|      9|                        }
 5141|   153k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 149k, False: 3.65k]
  |  Branch (5141:43): [True: 10.6k, False: 139k]
  |  Branch (5141:58): [True: 63.1k, False: 76.1k]
  ------------------
 5142|  73.7k|                           auto probe = it;
 5143|  73.7k|                           yaml::skip_newline(probe, end);
 5144|   113k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 107k, False: 5.42k]
  |  Branch (5144:51): [True: 39.6k, False: 68.3k]
  ------------------
 5145|  73.7k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 68.3k, False: 5.42k]
  |  Branch (5145:48): [True: 22.3k, False: 46.0k]
  |  Branch (5145:65): [True: 21.4k, False: 851]
  |  Branch (5145:89): [True: 4, False: 21.4k]
  ------------------
 5146|      4|                              ctx.error = error_code::syntax_error;
 5147|      4|                              return false;
 5148|      4|                           }
 5149|  73.7k|                        }
 5150|   153k|                        yaml::skip_inline_ws(it, end);
 5151|   153k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 863, False: 152k]
  ------------------
 5152|    863|                           return false;
 5153|   153k|                     }
 5154|       |
 5155|   448k|                     value.emplace(std::move(key), std::move(val));
 5156|   448k|                     return true;
 5157|   449k|                  }
 5158|       |
 5159|   733k|                  key_t key{};
 5160|   733k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|   733k|                     auto key_probe = it;
 5162|   733k|                     yaml::skip_inline_ws(key_probe, end);
 5163|   733k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 733k, False: 0]
  |  Branch (5163:74): [True: 3.50k, False: 729k]
  |  Branch (5163:95): [True: 2.43k, False: 727k]
  ------------------
 5164|   733k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 5.93k, False: 727k]
  ------------------
 5165|  5.93k|                        glz::generic key_node{};
 5166|  5.93k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  5.93k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 2.22k, False: 3.70k]
  ------------------
 5168|  2.22k|                           return false;
 5169|  3.70k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 4, False: 3.70k]
  ------------------
 5170|      4|                           return false;
 5171|  3.70k|                     }
 5172|   727k|                     else {
 5173|   727k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 2.11k, False: 725k]
  ------------------
 5174|  2.11k|                           return false;
 5175|  2.11k|                        }
 5176|   727k|                     }
 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|   728k|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|   733k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 4.54k, False: 728k]
  |  Branch (5186:36): [True: 557, False: 728k]
  ------------------
 5187|    753|                     ctx.error = error_code::syntax_error;
 5188|    753|                     return false;
 5189|    753|                  }
 5190|   732k|                  ++it;
 5191|   732k|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|   732k|                  val_t val{};
 5194|   732k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 24.4k, False: 708k]
  ------------------
 5195|  24.4k|                     return false;
 5196|       |
 5197|   708k|                  value.emplace(std::move(key), std::move(val));
 5198|   708k|                  return true;
 5199|   732k|               });
_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|   449k|                        const bool key_content_spans_lines = [&] {
 5021|   449k|                           auto scan = key_it;
 5022|   477k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 354k, False: 122k]
  |  Branch (5022:54): [True: 354k, False: 0]
  ------------------
 5023|   354k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 198k, False: 156k]
  |  Branch (5023:52): [True: 128k, False: 27.7k]
  ------------------
 5024|  27.7k|                              ++scan;
 5025|  27.7k|                           }
 5026|   122k|                           return false;
 5027|   449k|                        }();
_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|   382k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   382k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   382k|                        };
_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|   881k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|   881k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 866k, False: 14.7k]
  |  Branch (4884:39): [True: 620k, False: 246k]
  ------------------
 4885|   620k|                        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|   620k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   620k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 620k, False: 0]
  ------------------
 4893|   620k|                              auto is_line_content_start = [&](auto pos) {
 4894|   620k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   620k|                              };
 4896|       |
 4897|   620k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   620k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   620k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   620k|                                 return line != end && *line == ':';
 4901|   620k|                              };
 4902|       |
 4903|   620k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 620k, False: 0]
  ------------------
 4904|   620k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 40.8k, False: 579k]
  ------------------
 4905|  40.8k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 789, False: 40.0k]
  ------------------
 4906|    789|                                 ctx.error = error_code::syntax_error;
 4907|    789|                                 return false;
 4908|    789|                              }
 4909|   619k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   619k|                           }
 4911|   620k|                        }
 4912|       |
 4913|   620k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 14.3k, False: 606k]
  ------------------
 4914|  14.3k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 841, False: 13.5k]
  |  Branch (4914:49): [True: 2.38k, False: 11.1k]
  ------------------
 4915|  3.23k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 27, False: 3.20k]
  ------------------
 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|   620k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 620k]
  ------------------
 4922|      0|                           return false;
 4923|   620k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   620k|                        ctx.pop_indent();
 4925|   620k|                     }
 4926|   261k|                     else {
 4927|   261k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   261k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 67.2k, False: 193k]
  ------------------
 4929|  67.2k|                           yaml::skip_to_content(it, end);
 4930|  67.2k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 67.2k, False: 0]
  |  Branch (4930:45): [True: 0, False: 67.2k]
  |  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|  67.2k|                           const int32_t value_indent =
 4937|  67.2k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 67.2k]
  ------------------
 4938|  67.2k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 67.2k]
  ------------------
 4939|      0|                              return false;
 4940|  67.2k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  67.2k|                           ctx.pop_indent();
 4942|  67.2k|                        }
 4943|   261k|                     }
 4944|   881k|                     return !bool(ctx.error);
 4945|   881k|                  };
_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|   620k|                              auto is_line_content_start = [&](auto pos) {
 4894|   620k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   620k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4897|   660k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   660k|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.25M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 1.25M, False: 0]
  |  Branch (4899:57): [True: 595k, False: 662k]
  |  Branch (4899:73): [True: 1.53k, False: 660k]
  ------------------
 4900|   660k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 660k, False: 0]
  |  Branch (4900:56): [True: 396k, False: 264k]
  ------------------
 4901|   660k|                              };
_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.06M|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|  2.06M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 2.06M]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|  2.06M|            }
_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|   339k|      {
 5311|   339k|         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|   339k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   339k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   339k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   339k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 339k, False: 0]
  ------------------
 5321|   339k|            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|   339k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4182|   355k|      {
 4183|   355k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 355k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   355k|         auto peek = it;
 4188|   355k|         yaml::node_preamble_state preamble{};
 4189|   355k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 19.8k, False: 335k]
  ------------------
 4190|   355k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  19.8k|            it = peek;
 4192|  19.8k|            return;
 4193|  19.8k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   335k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   335k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 25, False: 335k]
  ------------------
 4198|     25|            return;
 4199|       |
 4200|   335k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 137k, False: 197k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|   137k|            it = peek;
 4203|   137k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|   137k|         }
 4205|   197k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 197k, False: 292]
  ------------------
 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|   197k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 1.06k, False: 196k]
  |  Branch (4208:57): [True: 5.88k, False: 190k]
  ------------------
 4209|  6.95k|               it = peek;
 4210|  6.95k|            }
 4211|   197k|            int32_t seq_indent = ctx.current_indent();
 4212|   197k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 196k, False: 699]
  |  Branch (4212:31): [True: 112k, False: 83.7k]
  ------------------
 4213|   112k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 33.0k, False: 79.8k]
  |  Branch (4213:62): [True: 30.7k, False: 2.34k]
  ------------------
 4214|   112k|                                                          : (ctx.current_indent() + 1);
 4215|   112k|            }
 4216|   197k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   197k|         }
 4218|    292|         else {
 4219|    292|            ctx.error = error_code::syntax_error;
 4220|    292|         }
 4221|       |
 4222|   335k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   335k|      }
_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|   355k|      {
  466|   355k|         skip_inline_ws(it, end);
  467|       |
  468|   355k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 355k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  474|       |
  475|   355k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   355k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 355k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   355k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 355k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   355k|         skip_inline_ws(it, end);
  486|       |
  487|   355k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 9, False: 355k]
  ------------------
  488|      9|            if constexpr (!AllowEmptyInput) {
  489|      9|               ctx.error = error_code::unexpected_end;
  490|      9|            }
  491|      9|            return true;
  492|      9|         }
  493|       |
  494|   355k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 19.7k, False: 335k]
  ------------------
  495|  19.7k|            return true;
  496|  19.7k|         }
  497|       |
  498|   335k|         return false;
  499|   355k|      }
_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|   355k|                                             [](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|   355k|      {
  409|   355k|         state.has_anchor = false;
  410|   355k|         state.anchor_name.clear();
  411|   355k|         state.anchor_start = nullptr;
  412|   355k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   355k|         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|   355k|            else {
  421|   355k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 19.6k, False: 335k]
  ------------------
  422|   355k|            }
  423|   355k|         }
  424|       |
  425|   355k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 335k, False: 19.6k]
  |  Branch (425:27): [True: 8.70k, False: 326k]
  ------------------
  426|  8.70k|            ++it;
  427|  8.70k|            auto name = parse_anchor_name(it, end);
  428|  8.70k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 27, False: 8.67k]
  ------------------
  429|     27|               ctx.error = error_code::syntax_error;
  430|     27|               return true;
  431|     27|            }
  432|  8.67k|            skip_inline_ws(it, end);
  433|  8.67k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 48, False: 8.62k]
  ------------------
  434|     48|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     48|                  ctx.error = error_code::unexpected_end;
  436|     48|               }
  437|     48|               return true;
  438|     48|            }
  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.62k|            state.has_anchor = true;
  446|  8.62k|            state.anchor_name = std::string(name);
  447|  8.62k|            state.anchor_start = &*it;
  448|  8.62k|         }
  449|       |
  450|   354k|         return false;
  451|   355k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   355k|      {
  301|   355k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 355k]
  |  Branch (301:27): [True: 335k, False: 19.6k]
  ------------------
  302|       |
  303|  19.6k|         ++it; // skip '*'
  304|  19.6k|         auto name = parse_anchor_name(it, end);
  305|  19.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 24, False: 19.6k]
  ------------------
  306|     24|            ctx.error = error_code::syntax_error;
  307|     24|            return true;
  308|     24|         }
  309|       |
  310|  19.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  19.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 86, False: 19.5k]
  ------------------
  312|     86|            ctx.error = error_code::syntax_error; // undefined alias
  313|     86|            return true;
  314|     86|         }
  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|  19.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  19.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.42k, False: 15.1k]
  ------------------
  322|  4.42k|            return true;
  323|  4.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|  15.1k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 24, False: 15.1k]
  ------------------
  329|     24|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     24|            return true;
  331|     24|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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|  15.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  15.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 15.1k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  15.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 15.1k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  15.1k|         auto replay_it = span.begin;
  348|  15.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  15.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  15.1k|         ctx.indent_stack.clear();
  353|  15.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.56k, False: 10.5k]
  ------------------
  354|  4.56k|            ctx.push_indent(span.base_indent - 1);
  355|  4.56k|         }
  356|       |
  357|  15.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  15.1k|         using V = std::remove_cvref_t<T>;
  360|  15.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  15.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  15.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  15.1k|         return true;
  367|  15.1k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|   137k|      {
 2665|   137k|         using V = std::remove_cvref_t<T>;
 2666|   137k|         using value_type = typename V::value_type;
 2667|       |
 2668|   137k|         struct sequence_container_adapter
 2669|   137k|         {
 2670|   137k|            size_t index = 0;
 2671|       |
 2672|   137k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|   137k|            {
 2674|   137k|               if constexpr (!resizable<V>) {
 2675|   137k|                  return index >= container.size();
 2676|   137k|               }
 2677|   137k|               else {
 2678|   137k|                  (void)container;
 2679|   137k|                  return false;
 2680|   137k|               }
 2681|   137k|            }
 2682|       |
 2683|   137k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|   137k|            inline void append(V& container, value_type&& element) noexcept
 2686|   137k|            {
 2687|   137k|               if constexpr (emplace_backable<V>) {
 2688|   137k|                  container.emplace_back(std::move(element));
 2689|   137k|               }
 2690|   137k|               else if constexpr (emplaceable<V>) {
 2691|   137k|                  container.emplace(std::move(element));
 2692|   137k|               }
 2693|   137k|            }
 2694|   137k|         };
 2695|       |
 2696|   137k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 137k]
  |  Branch (2696:27): [True: 0, False: 137k]
  ------------------
 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|   137k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|   137k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|   137k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|   137k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 44, False: 137k]
  ------------------
 2709|     44|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|   137k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 134k, False: 3.04k]
  |  Branch (2712:27): [True: 26.2k, False: 108k]
  ------------------
 2713|  26.2k|            ++it;
 2714|  26.2k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  26.2k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 78, False: 26.1k]
  ------------------
 2716|     78|               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|  26.1k|            return;
 2723|  26.2k|         }
 2724|       |
 2725|   111k|         bool just_saw_comma = false;
 2726|   111k|         sequence_container_adapter adapter{};
 2727|       |
 2728|   111k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   258k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 255k, False: 3.30k]
  ------------------
 2731|   255k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   255k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 255k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   255k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 255k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   255k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 20.8k, False: 234k]
  ------------------
 2741|  20.8k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 20.8k, False: 0]
  ------------------
 2742|  20.8k|                     ++it;
 2743|  20.8k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  20.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 18, False: 20.8k]
  ------------------
 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|  20.8k|                     return;
 2752|  20.8k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  20.8k|               }
 2756|       |
 2757|   234k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 110, False: 234k]
  |  Branch (2757:34): [True: 49, False: 234k]
  ------------------
 2758|    159|                  ctx.error = error_code::syntax_error;
 2759|    159|                  return;
 2760|    159|               }
 2761|   234k|               just_saw_comma = false;
 2762|       |
 2763|   234k|               value_type element{};
 2764|   234k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   234k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 24.7k, False: 209k]
  ------------------
 2767|  24.7k|                  return;
 2768|       |
 2769|   209k|               bool saw_line_break_before_separator = false;
 2770|   209k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   209k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 52, False: 209k]
  ------------------
 2772|     52|                  return;
 2773|       |
 2774|   209k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 208k, False: 1.13k]
  |  Branch (2774:33): [True: 26.8k, False: 181k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  26.8k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 33, False: 26.8k]
  ------------------
 2777|     33|                     ctx.error = error_code::syntax_error;
 2778|     33|                     return;
 2779|     33|                  }
 2780|  26.8k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  26.8k|                     glz::generic key_node = std::move(element);
 2782|  26.8k|                     ++it;
 2783|  26.8k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  26.8k|                     glz::generic mapped{};
 2786|  26.8k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  26.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 1.90k, False: 24.9k]
  ------------------
 2788|  1.90k|                        return;
 2789|       |
 2790|  24.9k|                     std::string key;
 2791|  24.9k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 4, False: 24.9k]
  ------------------
 2792|      4|                        return;
 2793|       |
 2794|  24.9k|                     glz::generic pair{};
 2795|  24.9k|                     pair[key] = std::move(mapped);
 2796|  24.9k|                     element = std::move(pair);
 2797|       |
 2798|  24.9k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  24.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 0, False: 24.9k]
  ------------------
 2800|      0|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  26.8k|               }
 2807|       |
 2808|   209k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   209k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 1.17k, False: 208k]
  ------------------
 2811|  1.17k|                  ctx.error = error_code::unexpected_end;
 2812|  1.17k|                  return;
 2813|  1.17k|               }
 2814|       |
 2815|   208k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 57.7k, False: 150k]
  ------------------
 2816|  57.7k|                  ++it;
 2817|  57.7k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  57.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 84, False: 57.6k]
  ------------------
 2819|     84|                     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|  57.6k|                  return;
 2826|  57.7k|               }
 2827|   150k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 147k, False: 3.32k]
  ------------------
 2828|   147k|                  ++it;
 2829|   147k|                  just_saw_comma = true;
 2830|   147k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|   147k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 27, False: 147k]
  ------------------
 2832|     27|                     return;
 2833|   147k|               }
 2834|  3.32k|               else {
 2835|  3.32k|                  ctx.error = error_code::syntax_error;
 2836|  3.32k|                  return;
 2837|  3.32k|               }
 2838|   208k|            }
 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|   111k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   334k|      {
 2649|   334k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   334k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   334k|               value.clear();
 2653|   334k|            }
 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|   334k|      }
_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|   207k|            {
 2687|   207k|               if constexpr (emplace_backable<V>) {
 2688|   207k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   207k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   197k|      {
 3160|   197k|         using V = std::remove_cvref_t<T>;
 3161|   197k|         using value_type = typename V::value_type;
 3162|       |
 3163|   197k|         struct sequence_container_adapter
 3164|   197k|         {
 3165|   197k|            size_t index = 0;
 3166|       |
 3167|   197k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   197k|            {
 3169|   197k|               if constexpr (!resizable<V>) {
 3170|   197k|                  return index >= container.size();
 3171|   197k|               }
 3172|   197k|               else {
 3173|   197k|                  (void)container;
 3174|   197k|                  return false;
 3175|   197k|               }
 3176|   197k|            }
 3177|       |
 3178|   197k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   197k|            inline void append(V& container, value_type&& element) noexcept
 3181|   197k|            {
 3182|   197k|               if constexpr (emplace_backable<V>) {
 3183|   197k|                  container.emplace_back(std::move(element));
 3184|   197k|               }
 3185|   197k|               else if constexpr (emplaceable<V>) {
 3186|   197k|                  container.emplace(std::move(element));
 3187|   197k|               }
 3188|   197k|            }
 3189|   197k|         };
 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|   197k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   197k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   197k|         bool first_item = true;
 3200|   197k|         bool has_pending_item_anchor = false;
 3201|   197k|         std::string pending_item_anchor_name{};
 3202|   197k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   525k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 471k, False: 53.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|   471k|            int32_t line_indent = 0;
 3215|   471k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   471k|            auto line_start = it;
 3217|       |
 3218|   627k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 604k, False: 23.1k]
  ------------------
 3219|   604k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 29.7k, False: 574k]
  ------------------
 3220|  29.7k|                  skip_comment(it, end);
 3221|  29.7k|                  skip_newline(it, end);
 3222|  29.7k|                  line_start = it;
 3223|  29.7k|                  line_indent = 0;
 3224|  29.7k|               }
 3225|   574k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 28.7k, False: 545k]
  |  Branch (3225:40): [True: 72.1k, False: 473k]
  ------------------
 3226|   100k|                  skip_newline(it, end);
 3227|   100k|                  line_start = it;
 3228|   100k|                  line_indent = 0;
 3229|   100k|               }
 3230|   473k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 41.7k, False: 431k]
  ------------------
 3231|  41.7k|                  line_start = it;
 3232|  41.7k|                  line_indent = 0;
 3233|   623k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 619k, False: 4.79k]
  |  Branch (3233:39): [True: 582k, False: 36.9k]
  ------------------
 3234|   582k|                     ++line_indent;
 3235|   582k|                     ++it;
 3236|   582k|                  }
 3237|       |
 3238|  41.7k|                  bool saw_tab = false;
 3239|  48.6k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 42.8k, False: 5.76k]
  |  Branch (3239:40): [True: 3.02k, False: 39.8k]
  |  Branch (3239:54): [True: 3.88k, False: 35.9k]
  ------------------
 3240|  6.91k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 3.92k, False: 2.99k]
  |  Branch (3240:43): [True: 2.99k, False: 0]
  ------------------
 3241|  6.91k|                     ++it;
 3242|  6.91k|                  }
 3243|       |
 3244|  41.7k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 5.76k, False: 35.9k]
  |  Branch (3244:36): [True: 2.67k, False: 33.2k]
  |  Branch (3244:51): [True: 3.26k, False: 30.0k]
  |  Branch (3244:66): [True: 4.69k, False: 25.3k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  16.3k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 10.6k, False: 5.76k]
  |  Branch (3246:39): [True: 4.69k, False: 5.93k]
  ------------------
 3247|  4.69k|                        skip_comment(it, end);
 3248|  4.69k|                     }
 3249|  16.3k|                     line_indent = 0;
 3250|  16.3k|                     continue;
 3251|  16.3k|                  }
 3252|       |
 3253|  25.3k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 54, False: 25.2k]
  ------------------
 3254|     54|                     ctx.error = error_code::syntax_error;
 3255|     54|                     return;
 3256|     54|                  }
 3257|  25.2k|                  break; // Found content
 3258|  25.3k|               }
 3259|   431k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 8.70k, False: 423k]
  ------------------
 3260|  8.70k|                  line_start = it;
 3261|  24.6k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 23.8k, False: 863]
  |  Branch (3261:40): [True: 3.47k, False: 20.3k]
  |  Branch (3261:54): [True: 12.4k, False: 7.83k]
  ------------------
 3262|  8.70k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 863, False: 7.83k]
  |  Branch (3262:36): [True: 2.55k, False: 5.28k]
  |  Branch (3262:51): [True: 1.32k, False: 3.96k]
  |  Branch (3262:66): [True: 3.90k, False: 58]
  ------------------
 3263|  8.64k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 7.78k, False: 863]
  |  Branch (3263:39): [True: 3.90k, False: 3.87k]
  ------------------
 3264|  3.90k|                        skip_comment(it, end);
 3265|  3.90k|                     }
 3266|  8.64k|                     line_indent = 0;
 3267|  8.64k|                     continue;
 3268|  8.64k|                  }
 3269|     58|                  ctx.error = error_code::syntax_error;
 3270|     58|                  return;
 3271|  8.70k|               }
 3272|   423k|               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|   423k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 197k, False: 225k]
  |  Branch (3276:37): [True: 196k, False: 696]
  ------------------
 3277|   196k|                     line_indent = sequence_indent;
 3278|   196k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   196k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 196k, False: 0]
  |  Branch (3279:49): [True: 196k, False: 0]
  ------------------
 3280|   196k|                           auto probe = it;
 3281|   196k|                           int32_t leading_ws = 0;
 3282|   196k|                           bool saw_tab = false;
 3283|   487k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 487k, False: 0]
  |  Branch (3283:64): [True: 272k, False: 215k]
  |  Branch (3283:87): [True: 18.7k, False: 196k]
  ------------------
 3284|   291k|                              --probe;
 3285|   291k|                              ++leading_ws;
 3286|   291k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 6.07k, False: 284k]
  |  Branch (3286:52): [True: 15.0k, False: 269k]
  ------------------
 3287|   291k|                           }
 3288|   196k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 196k]
  |  Branch (3288:61): [True: 8.73k, False: 187k]
  |  Branch (3288:85): [True: 56.2k, False: 131k]
  ------------------
 3289|  64.9k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 8, False: 64.9k]
  ------------------
 3290|      8|                                 ctx.error = error_code::syntax_error;
 3291|      8|                                 return;
 3292|      8|                              }
 3293|  64.9k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  64.9k|                           }
 3295|   196k|                        }
 3296|   196k|                     }
 3297|   196k|                  }
 3298|   196k|                  break;
 3299|   423k|               }
 3300|   604k|            }
 3301|       |
 3302|   471k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 23.1k, False: 448k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   448k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 8.24k, False: 440k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   440k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 46.3k, False: 393k]
  ------------------
 3309|  46.3k|               it = line_start;
 3310|  46.3k|               return;
 3311|  46.3k|            }
 3312|       |
 3313|   393k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 17.1k, False: 376k]
  ------------------
 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|  17.1k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 6, False: 17.1k]
  ------------------
 3318|      6|                  ctx.error = error_code::syntax_error;
 3319|      6|                  return;
 3320|      6|               }
 3321|       |
 3322|  17.1k|               ++it;
 3323|  17.1k|               auto pending_name = parse_anchor_name(it, end);
 3324|  17.1k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 19, False: 17.1k]
  ------------------
 3325|     19|                  ctx.error = error_code::syntax_error;
 3326|     19|                  return;
 3327|     19|               }
 3328|  17.1k|               skip_inline_ws(it, end);
 3329|  17.1k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 17.0k, False: 84]
  |  Branch (3329:33): [True: 2.37k, False: 14.6k]
  ------------------
 3330|  2.37k|                  skip_comment(it, end);
 3331|  2.37k|               }
 3332|       |
 3333|  17.1k|               has_pending_item_anchor = true;
 3334|  17.1k|               pending_item_anchor_name = std::string(pending_name);
 3335|  17.1k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  17.1k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 93, False: 17.0k]
  |  Branch (3337:34): [True: 11.4k, False: 5.63k]
  |  Branch (3337:49): [True: 140, False: 11.2k]
  ------------------
 3338|    233|                  ctx.error = error_code::syntax_error;
 3339|    233|                  return;
 3340|    233|               }
 3341|       |
 3342|  16.9k|               skip_newline(it, end);
 3343|  16.9k|               continue;
 3344|  17.1k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   376k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 52.9k, False: 323k]
  ------------------
 3348|  52.9k|               it = line_start;
 3349|  52.9k|               return;
 3350|  52.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|   323k|            dash_col = line_indent;
 3356|   323k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   323k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 323k, False: 8]
  ------------------
 3358|   323k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   323k|               }
 3360|   323k|            }
 3361|       |
 3362|   323k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   323k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 311k, False: 12.6k]
  |  Branch (3365:30): [True: 10.1k, False: 300k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  10.1k|               it = line_start;
 3368|  10.1k|               return;
 3369|  10.1k|            }
 3370|       |
 3371|   313k|            bool saw_tab_after_dash = false;
 3372|   538k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 523k, False: 14.7k]
  |  Branch (3372:34): [True: 168k, False: 355k]
  |  Branch (3372:48): [True: 56.6k, False: 298k]
  ------------------
 3373|   224k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 3.83k, False: 220k]
  |  Branch (3373:59): [True: 55.1k, False: 165k]
  ------------------
 3374|   224k|               ++it;
 3375|   224k|            }
 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: 55.1k, False: 258k]
  |  Branch (3377:39): [True: 54.2k, False: 953]
  |  Branch (3377:52): [True: 922, False: 53.2k]
  ------------------
 3378|    922|               const auto after_dash = it + 1;
 3379|    922|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 7, False: 915]
  |  Branch (3379:41): [True: 6, False: 909]
  ------------------
 3380|     13|                  ctx.error = error_code::syntax_error;
 3381|     13|                  return;
 3382|     13|               }
 3383|    922|            }
 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.17k, False: 311k]
  ------------------
 3474|  2.17k|               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|   197k|      }
_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: 298k, False: 14.7k]
  ------------------
 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: 298k, False: 14.7k]
  |  Branch (3390:33): [True: 154k, False: 143k]
  ------------------
 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|   154k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 154k]
  ------------------
 3396|      0|                     return;
 3397|   154k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   154k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   154k|                  ctx.sequence_item_value_context = true;
 3400|   154k|                  ctx.sequence_dash_indent = dash_col;
 3401|   154k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   154k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   154k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   154k|                  ctx.pop_indent();
 3405|   154k|               }
 3406|   158k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   158k|                  skip_ws_and_comment(it, end);
 3409|   158k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   158k|                  auto nested_start = it;
 3413|   158k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   158k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 16, False: 158k]
  ------------------
 3415|     16|                     return;
 3416|   158k|                  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|   158k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 12.8k, False: 145k]
  ------------------
 3422|   158k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 13.8k, False: 144k]
  ------------------
 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|  13.8k|                     const int32_t element_indent =
 3428|  13.8k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 13.8k]
  ------------------
 3429|  13.8k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 13.8k]
  ------------------
 3430|      0|                        return;
 3431|  13.8k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  13.8k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  13.8k|                     ctx.sequence_item_value_context = true;
 3434|  13.8k|                     ctx.sequence_dash_indent = dash_col;
 3435|  13.8k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  13.8k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  13.8k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  13.8k|                     ctx.pop_indent();
 3439|  13.8k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   158k|               }
 3442|       |
 3443|   313k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 6.27k, False: 307k]
  |  Branch (3443:47): [True: 5.84k, False: 436]
  ------------------
 3444|  5.84k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 4.90k, False: 937]
  ------------------
 3445|  5.84k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  5.84k|                                                                      pending_item_anchor_indent};
 3447|  5.84k|                  has_pending_item_anchor = false;
 3448|  5.84k|               }
 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.14M|   {
 5531|  1.14M|      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.14M|         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.14M|            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.14M|            bool at_node_start = true;
 5542|  1.14M|            int depth = 0;
 5543|  1.14M|            while (pos != stop) {
 5544|  1.14M|               const char c = *pos;
 5545|  1.14M|               if (c == ' ' || c == '\t') {
 5546|  1.14M|                  ++pos;
 5547|  1.14M|                  continue;
 5548|  1.14M|               }
 5549|  1.14M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  1.14M|               if ((c == '"' || c == '\'') && node_start) {
 5552|  1.14M|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5553|  1.14M|                  continue;
 5554|  1.14M|               }
 5555|  1.14M|               if (c == '[' || c == '{') {
 5556|  1.14M|                  ++depth;
 5557|  1.14M|                  at_node_start = true;
 5558|  1.14M|                  ++pos;
 5559|  1.14M|                  continue;
 5560|  1.14M|               }
 5561|  1.14M|               if (c == ']' || c == '}') {
 5562|  1.14M|                  if (depth == 0) return false;
 5563|  1.14M|                  --depth;
 5564|  1.14M|                  ++pos;
 5565|  1.14M|                  continue;
 5566|  1.14M|               }
 5567|  1.14M|               if (c == ',' && depth == 0) return false;
 5568|  1.14M|               if (c == ':' && depth == 0) {
 5569|  1.14M|                  auto next = pos + 1;
 5570|  1.14M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5571|  1.14M|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  1.14M|               if (c == ',' || c == ':') {
 5574|  1.14M|                  at_node_start = true;
 5575|  1.14M|                  ++pos;
 5576|  1.14M|                  continue;
 5577|  1.14M|               }
 5578|  1.14M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5579|  1.14M|                  at_node_start = true;
 5580|  1.14M|                  continue;
 5581|  1.14M|               }
 5582|  1.14M|               ++pos;
 5583|  1.14M|            }
 5584|  1.14M|            return false;
 5585|  1.14M|         };
 5586|       |
 5587|  1.14M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5587:14): [True: 470k, False: 674k]
  |  Branch (5587:49): [True: 16.8k, False: 657k]
  ------------------
 5588|   486k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5588:17): [True: 424k, False: 62.6k]
  ------------------
 5589|   424k|               return;
 5590|   424k|            }
 5591|  62.6k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5591:17): [True: 12.5k, False: 50.0k]
  ------------------
 5592|  12.5k|               return;
 5593|  12.5k|            }
 5594|  62.6k|         }
 5595|       |
 5596|   707k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5597|   707k|         return;
 5598|  1.14M|      }
 5599|       |
 5600|  1.14M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 0, False: 1.14M]
  ------------------
 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.14M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 0, False: 1.14M]
  ------------------
 5605|      0|         return;
 5606|      0|      }
 5607|  1.14M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|  1.14M|   }
_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.14M|         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.14M|            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.14M|            bool at_node_start = true;
 5542|  1.14M|            int depth = 0;
 5543|  18.5M|            while (pos != stop) {
  ------------------
  |  Branch (5543:20): [True: 18.4M, False: 129k]
  ------------------
 5544|  18.4M|               const char c = *pos;
 5545|  18.4M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5545:20): [True: 2.05M, False: 16.3M]
  |  Branch (5545:32): [True: 285k, False: 16.0M]
  ------------------
 5546|  2.34M|                  ++pos;
 5547|  2.34M|                  continue;
 5548|  2.34M|               }
 5549|  16.0M|               const bool node_start = std::exchange(at_node_start, false);
 5550|       |
 5551|  16.0M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5551:21): [True: 207k, False: 15.8M]
  |  Branch (5551:33): [True: 73.3k, False: 15.8M]
  |  Branch (5551:47): [True: 175k, False: 104k]
  ------------------
 5552|   175k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5552:23): [True: 18.6k, False: 157k]
  ------------------
 5553|   157k|                  continue;
 5554|   175k|               }
 5555|  15.9M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5555:20): [True: 897k, False: 15.0M]
  |  Branch (5555:32): [True: 170k, False: 14.8M]
  ------------------
 5556|  1.06M|                  ++depth;
 5557|  1.06M|                  at_node_start = true;
 5558|  1.06M|                  ++pos;
 5559|  1.06M|                  continue;
 5560|  1.06M|               }
 5561|  14.8M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5561:20): [True: 147k, False: 14.7M]
  |  Branch (5561:32): [True: 145k, False: 14.5M]
  ------------------
 5562|   292k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5562:23): [True: 118k, False: 173k]
  ------------------
 5563|   173k|                  --depth;
 5564|   173k|                  ++pos;
 5565|   173k|                  continue;
 5566|   292k|               }
 5567|  14.5M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5567:20): [True: 1.01M, False: 13.5M]
  |  Branch (5567:32): [True: 302k, False: 711k]
  ------------------
 5568|  14.2M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5568:20): [True: 948k, False: 13.3M]
  |  Branch (5568:32): [True: 574k, False: 373k]
  ------------------
 5569|   574k|                  auto next = pos + 1;
 5570|   574k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5570:26): [True: 5.89k, False: 568k]
  |  Branch (5570:41): [True: 343k, False: 224k]
  |  Branch (5570:57): [True: 32.1k, False: 192k]
  |  Branch (5570:74): [True: 28.0k, False: 164k]
  |  Branch (5570:91): [True: 60.0k, False: 104k]
  ------------------
 5571|   574k|               }
 5572|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5573|  13.6M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5573:20): [True: 711k, False: 12.9M]
  |  Branch (5573:32): [True: 373k, False: 12.5M]
  ------------------
 5574|  1.08M|                  at_node_start = true;
 5575|  1.08M|                  ++pos;
 5576|  1.08M|                  continue;
 5577|  1.08M|               }
 5578|  12.5M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5578:20): [True: 2.21M, False: 10.3M]
  |  Branch (5578:34): [True: 180k, False: 2.03M]
  ------------------
 5579|   180k|                  at_node_start = true;
 5580|   180k|                  continue;
 5581|   180k|               }
 5582|  12.4M|               ++pos;
 5583|  12.4M|            }
 5584|   129k|            return false;
 5585|  1.14M|         };
_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|  96.9k|            auto is_word_boundary = [&](const auto ptr) {
 5963|  96.9k|               if (ptr == end) {
  ------------------
  |  Branch (5963:20): [True: 3.43k, False: 93.5k]
  ------------------
 5964|  3.43k|                  return true;
 5965|  3.43k|               }
 5966|  93.5k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 59.2k, False: 34.2k]
  ------------------
 5967|  59.2k|                  auto next = ptr + 1;
 5968|  59.2k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 2.54k, False: 56.7k]
  |  Branch (5968:43): [True: 22.1k, False: 34.5k]
  |  Branch (5968:59): [True: 19.9k, False: 14.6k]
  |  Branch (5968:76): [True: 3.87k, False: 10.7k]
  |  Branch (5968:93): [True: 7.75k, False: 2.97k]
  ------------------
 5969|  59.2k|               }
 5970|  34.2k|               return is_plain_scalar_boundary(*ptr);
 5971|  93.5k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5888|  34.2k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  34.2k|               switch (ch) {
 5890|  2.41k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 2.41k, False: 31.8k]
  ------------------
 5891|  5.37k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 2.95k, False: 31.2k]
  ------------------
 5892|  7.12k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 1.75k, False: 32.4k]
  ------------------
 5893|  13.0k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 5.89k, False: 28.3k]
  ------------------
 5894|  20.2k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 7.23k, False: 27.0k]
  ------------------
 5895|  21.9k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 1.68k, False: 32.5k]
  ------------------
 5896|  24.4k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 2.53k, False: 31.7k]
  ------------------
 5897|  24.4k|                  return true;
 5898|  9.77k|               default:
  ------------------
  |  Branch (5898:16): [True: 9.77k, False: 24.4k]
  ------------------
 5899|  9.77k|                  return false;
 5900|  34.2k|               }
 5901|  34.2k|            };
_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|  84.1k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|  84.1k|               if constexpr (yaml::check_flow_context(Opts)) {
 5905|  84.1k|                  return false;
 5906|  84.1k|               }
 5907|  84.1k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 0, False: 84.1k]
  ------------------
 5908|      0|                  return false;
 5909|      0|               }
 5910|  84.1k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 84.1k, False: 0]
  |  Branch (5910:40): [True: 0, False: 0]
  |  Branch (5910:61): [True: 0, False: 0]
  ------------------
 5911|      0|                  return false;
 5912|      0|               }
 5913|       |
 5914|  84.1k|               auto look = word_end;
 5915|  84.1k|               yaml::skip_newline(look, end);
 5916|  84.1k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 0, False: 84.1k]
  ------------------
 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|  84.1k|               return false;
 5961|  84.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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5484|  2.86M|   {
 5485|  2.86M|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|  2.86M|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|  2.86M|         const bool could_be_mapping = [&] {
 5493|  2.86M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  2.86M|               return line_could_be_flow_mapping(it, end);
 5495|  2.86M|            }
 5496|  2.86M|            else {
 5497|  2.86M|               return yaml::line_could_be_block_mapping(it, end);
 5498|  2.86M|            }
 5499|  2.86M|         }();
 5500|  2.86M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 2.39M, False: 472k]
  ------------------
 5501|  2.39M|            return false;
 5502|  2.39M|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   472k|         auto temp_ctx = ctx.make_speculative();
 5505|   472k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   472k|                                                                                               end);
 5507|   472k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   472k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   472k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 442k, False: 29.3k]
  ------------------
 5510|   442k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   442k|            return true;
 5512|   442k|         }
 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.3k|         ctx.error = temp_ctx.error;
 5517|  29.3k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  29.3k|         return false;
 5519|   472k|      }
 5520|  2.86M|   }
_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.86M|         const bool could_be_mapping = [&] {
 5493|  2.86M|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|  2.86M|               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|       |            else {
 5497|       |               return yaml::line_could_be_block_mapping(it, end);
 5498|       |            }
 5499|  2.86M|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4763|   156k|               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|   156k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4769|   156k|                     val = glz::generic{};
 4770|   156k|                     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|   156k|               };
_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|   828k|      {
 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|   828k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 828k]
  ------------------
 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|   828k|         const int32_t parent_indent = ctx.current_indent();
 3722|   828k|         const bool discover_indent = (mapping_indent < 0);
 3723|   828k|         bool first_key = !discover_indent;
 3724|   828k|         bool discovered_first_key_mid_line = false;
 3725|   828k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.65M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 2.32M, False: 332k]
  ------------------
 3728|  2.32M|            auto line_start = it;
 3729|  2.32M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 2.32M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.69M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 2.67M, False: 23.3k]
  ------------------
 3733|  2.67M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 44.8k, False: 2.62M]
  ------------------
 3734|  44.8k|                  skip_comment(it, end);
 3735|  44.8k|                  skip_newline(it, end);
 3736|  44.8k|                  first_key = false;
 3737|  44.8k|                  line_indent = 0;
 3738|  44.8k|               }
 3739|  2.62M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 207k, False: 2.41M]
  |  Branch (3739:40): [True: 65.6k, False: 2.35M]
  ------------------
 3740|   272k|                  skip_newline(it, end);
 3741|   272k|                  first_key = false;
 3742|   272k|                  line_indent = 0;
 3743|   272k|               }
 3744|  2.35M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 643k, False: 1.70M]
  ------------------
 3745|   643k|                  line_start = it;
 3746|   643k|                  line_indent = 0;
 3747|  4.00M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 4.00M, False: 4.06k]
  |  Branch (3747:39): [True: 3.36M, False: 639k]
  ------------------
 3748|  3.36M|                     ++line_indent;
 3749|  3.36M|                     ++it;
 3750|  3.36M|                  }
 3751|       |
 3752|   643k|                  bool saw_tab = false;
 3753|   660k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 655k, False: 4.83k]
  |  Branch (3753:40): [True: 1.08k, False: 654k]
  |  Branch (3753:54): [True: 15.9k, False: 638k]
  ------------------
 3754|  17.0k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 12.1k, False: 4.88k]
  |  Branch (3754:43): [True: 4.88k, False: 0]
  ------------------
 3755|  17.0k|                     ++it;
 3756|  17.0k|                  }
 3757|       |
 3758|   643k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 4.83k, False: 638k]
  |  Branch (3758:36): [True: 12.7k, False: 626k]
  |  Branch (3758:51): [True: 8.82k, False: 617k]
  |  Branch (3758:66): [True: 18.3k, False: 598k]
  ------------------
 3759|  44.7k|                     first_key = false;
 3760|  44.7k|                     line_indent = 0;
 3761|  44.7k|                     continue; // Blank or comment line
 3762|  44.7k|                  }
 3763|       |
 3764|   598k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 142, False: 598k]
  ------------------
 3765|    142|                     ctx.error = error_code::syntax_error;
 3766|    142|                     return;
 3767|    142|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   598k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 595k, False: 3.13k]
  |  Branch (3770:46): [True: 684, False: 594k]
  ------------------
 3771|    684|                     it = line_start;
 3772|    684|                     return;
 3773|    684|                  }
 3774|       |
 3775|   598k|                  first_key = false;
 3776|   598k|                  break; // Found content
 3777|   598k|               }
 3778|  1.70M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 5.93k, False: 1.70M]
  ------------------
 3779|  5.93k|                  line_start = it;
 3780|  19.3k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 18.6k, False: 688]
  |  Branch (3780:40): [True: 3.65k, False: 15.0k]
  |  Branch (3780:54): [True: 9.76k, False: 5.24k]
  ------------------
 3781|  5.93k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 688, False: 5.24k]
  |  Branch (3781:36): [True: 2.06k, False: 3.18k]
  |  Branch (3781:51): [True: 1.39k, False: 1.79k]
  |  Branch (3781:66): [True: 1.48k, False: 301]
  ------------------
 3782|  5.63k|                     first_key = false;
 3783|  5.63k|                     line_indent = 0;
 3784|  5.63k|                     continue; // Blank or comment-only line with tab indentation
 3785|  5.63k|                  }
 3786|    301|                  ctx.error = error_code::syntax_error;
 3787|    301|                  return;
 3788|  5.93k|               }
 3789|  1.70M|               else {
 3790|  1.70M|                  line_start = it;
 3791|  1.70M|                  break; // Content at column 0
 3792|  1.70M|               }
 3793|  2.67M|            }
 3794|       |
 3795|  2.32M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 23.3k, False: 2.30M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  2.30M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 7.45k, False: 2.29M]
  |  Branch (3799:45): [True: 1.91k, False: 2.29M]
  ------------------
 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|  2.29M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 2.29M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  2.29M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 2.29M, False: 0]
  |  Branch (3806:39): [True: 1.46M, False: 827k]
  |  Branch (3806:62): [True: 497k, False: 967k]
  |  Branch (3806:84): [True: 366k, False: 131k]
  ------------------
 3807|   366k|                  it = line_start;
 3808|   366k|                  return;
 3809|   366k|               }
 3810|  1.92M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 1.09M, False: 827k]
  |  Branch (3810:43): [True: 425, False: 1.09M]
  ------------------
 3811|    425|                  it = line_start;
 3812|    425|                  return;
 3813|    425|               }
 3814|  1.92M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.92M|            bool established_mapping_indent_this_line = false;
 3818|  1.92M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 827k, False: 1.09M]
  ------------------
 3819|   827k|               mapping_indent = line_indent;
 3820|   827k|               established_mapping_indent_this_line = true;
 3821|   827k|               discovered_first_key_visual_indent = line_indent;
 3822|   827k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   827k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 827k, False: 0]
  |  Branch (3823:43): [True: 811k, False: 15.9k]
  ------------------
 3824|   811k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   811k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 554, False: 811k]
  ------------------
 3826|    554|                        ctx.error = error_code::syntax_error;
 3827|    554|                        return;
 3828|    554|                     }
 3829|       |
 3830|   811k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   811k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 807k, False: 3.13k]
  |  Branch (3831:49): [True: 701k, False: 106k]
  ------------------
 3832|   701k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   701k|                     }
 3834|   811k|                  }
 3835|   827k|               }
 3836|   827k|            }
 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.92M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.92M, False: 554]
  |  Branch (3840:36): [True: 1.92M, False: 0]
  |  Branch (3840:59): [True: 1.09M, False: 826k]
  ------------------
 3841|  1.09M|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 674k, False: 423k]
  ------------------
 3842|   674k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 672k, False: 1.62k]
  |  Branch (3842:43): [True: 59.1k, False: 613k]
  ------------------
 3843|  59.1k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 105, False: 59.0k]
  ------------------
 3844|    105|                     ctx.error = error_code::syntax_error;
 3845|    105|                     return;
 3846|    105|                  }
 3847|  59.0k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 3.65k, False: 55.4k]
  ------------------
 3848|  3.65k|                     it = line_start;
 3849|  3.65k|                     return;
 3850|  3.65k|                  }
 3851|  59.0k|               }
 3852|   615k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 3.64k, False: 611k]
  ------------------
 3853|  3.64k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 898, False: 2.75k]
  |  Branch (3853:47): [True: 6, False: 2.74k]
  ------------------
 3854|  2.74k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 2.74k, False: 0]
  |  Branch (3854:49): [True: 2.74k, False: 0]
  |  Branch (3854:72): [True: 39, False: 2.70k]
  ------------------
 3855|    943|                  ctx.error = error_code::syntax_error;
 3856|    943|                  return;
 3857|    943|               }
 3858|   674k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.92M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.92M]
  |  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.92M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.92M]
  ------------------
 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.92M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 554, False: 1.92M]
  |  Branch (3876:32): [True: 0, False: 1.92M]
  ------------------
 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.92M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 383k, False: 1.53M]
  |  Branch (3885:53): [True: 90.4k, False: 293k]
  |  Branch (3885:94): [True: 24.5k, False: 65.9k]
  ------------------
 3886|  24.5k|               const auto after_colon = it + 1;
 3887|  24.5k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 18.2k, False: 6.35k]
  ------------------
 3888|  24.5k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 1.23k, False: 23.3k]
  |  Branch (3888:43): [True: 16.4k, False: 6.89k]
  ------------------
 3889|  17.6k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 2.50k, False: 15.1k]
  ------------------
 3890|  2.50k|                  it = line_start;
 3891|  2.50k|                  return;
 3892|  2.50k|               }
 3893|  24.5k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.91M|            int32_t effective_line_indent = line_indent;
 3897|  1.91M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.91M, False: 554]
  |  Branch (3897:36): [True: 826k, False: 1.09M]
  ------------------
 3898|   826k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 701k, False: 125k]
  ------------------
 3899|   701k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 554k, False: 147k]
  |  Branch (3899:52): [True: 65.5k, False: 489k]
  ------------------
 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|   636k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   636k|            }
 3912|       |
 3913|  1.91M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 88.8k, False: 1.82M]
  ------------------
 3914|  88.8k|               return;
 3915|  88.8k|            }
 3916|  1.82M|            first_key = false;
 3917|       |
 3918|  1.82M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.82M]
  ------------------
 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.82M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 1.56M, False: 267k]
  ------------------
 3938|  1.56M|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 461k, False: 1.10M]
  |  Branch (3938:34): [True: 8.80k, False: 1.09M]
  ------------------
 3939|   470k|                  auto peek = it;
 3940|   470k|                  skip_inline_ws(peek, end);
 3941|   470k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 468k, False: 2.00k]
  |  Branch (3941:38): [True: 457k, False: 10.5k]
  |  Branch (3941:55): [True: 442k, False: 14.9k]
  |  Branch (3941:72): [True: 437k, False: 5.10k]
  ------------------
 3942|   437k|                     continue; // At leading indent of new line
 3943|   437k|                  }
 3944|   470k|               }
 3945|  1.12M|               skip_inline_ws(it, end);
 3946|  1.12M|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 1.12M, False: 2.00k]
  |  Branch (3946:33): [True: 32.2k, False: 1.09M]
  ------------------
 3947|  32.2k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  32.2k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 32.2k, False: 0]
  ------------------
 3949|  32.2k|                        const char prev = *(it - 1);
 3950|  32.2k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 16.3k, False: 15.9k]
  |  Branch (3950:44): [True: 13.4k, False: 2.96k]
  |  Branch (3950:60): [True: 10.4k, False: 2.93k]
  |  Branch (3950:76): [True: 23, False: 10.4k]
  ------------------
 3951|     23|                           ctx.error = error_code::syntax_error;
 3952|     23|                           return;
 3953|     23|                        }
 3954|  32.2k|                     }
 3955|  32.2k|                  }
 3956|  32.2k|               }
 3957|  32.2k|               skip_comment(it, end);
 3958|  1.12M|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 1.12M, False: 3.03k]
  |  Branch (3958:34): [True: 225k, False: 896k]
  |  Branch (3958:49): [True: 173k, False: 722k]
  ------------------
 3959|   398k|                  skip_newline(it, end);
 3960|   398k|               }
 3961|   726k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 722k, False: 3.03k]
  ------------------
 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|   722k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   722k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 1.33k, False: 721k]
  ------------------
 3968|  1.33k|                        ctx.error = error_code::syntax_error;
 3969|  1.33k|                        return;
 3970|  1.33k|                     }
 3971|   722k|                  }
 3972|   722k|               }
 3973|  1.12M|            }
 3974|  1.82M|         }
 3975|   828k|      }
_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.91M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4883|  1.91M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.91M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4885|  1.91M|                        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.91M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|  1.91M|                           if (ctx.stream_begin) {
 4893|  1.91M|                              auto is_line_content_start = [&](auto pos) {
 4894|  1.91M|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|  1.91M|                              };
 4896|       |
 4897|  1.91M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|  1.91M|                                 const char* line = ctx.line_begin_of(pos);
 4899|  1.91M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|  1.91M|                                 return line != end && *line == ':';
 4901|  1.91M|                              };
 4902|       |
 4903|  1.91M|                              if (!is_line_content_start(it) &&
 4904|  1.91M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4905|  1.91M|                                  !line_has_explicit_value_indicator(it)) {
 4906|  1.91M|                                 ctx.error = error_code::syntax_error;
 4907|  1.91M|                                 return false;
 4908|  1.91M|                              }
 4909|  1.91M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|  1.91M|                           }
 4911|  1.91M|                        }
 4912|       |
 4913|  1.91M|                        if (*it == '-' &&
 4914|  1.91M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4915|  1.91M|                            !line_starts_with_explicit_value_indicator) {
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|  1.91M|                           ctx.error = error_code::syntax_error;
 4918|  1.91M|                           return false;
 4919|  1.91M|                        }
 4920|       |
 4921|  1.91M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4922|  1.91M|                           return false;
 4923|  1.91M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|  1.91M|                        ctx.pop_indent();
 4925|  1.91M|                     }
 4926|  1.91M|                     else {
 4927|  1.91M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|  1.91M|                        if (nested_indent >= 0) {
 4929|  1.91M|                           yaml::skip_to_content(it, end);
 4930|  1.91M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4931|  1.91M|                              ctx.error = error_code::syntax_error;
 4932|  1.91M|                              return false;
 4933|  1.91M|                           }
 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.91M|                           const int32_t value_indent =
 4937|  1.91M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4938|  1.91M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4939|  1.91M|                              return false;
 4940|  1.91M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|  1.91M|                           ctx.pop_indent();
 4942|  1.91M|                        }
 4943|  1.91M|                     }
 4944|  1.91M|                     return !bool(ctx.error);
 4945|  1.91M|                  };
 4946|       |
 4947|       |                  // Explicit key entry form:
 4948|       |                  // ? key
 4949|       |                  // : value
 4950|  1.91M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4950:23): [True: 785k, False: 1.13M]
  |  Branch (4950:37): [True: 783k, False: 1.92k]
  |  Branch (4950:58): [True: 9, False: 783k]
  ------------------
 4951|      9|                     ctx.error = error_code::syntax_error;
 4952|      9|                     return false;
 4953|      9|                  }
 4954|  1.91M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4954:23): [True: 785k, False: 1.13M]
  |  Branch (4954:38): [True: 1.92k, False: 783k]
  |  Branch (4954:57): [True: 127k, False: 656k]
  |  Branch (4954:77): [True: 115k, False: 540k]
  |  Branch (4954:98): [True: 531k, False: 9.15k]
  ------------------
 4955|   775k|                     ++it; // skip '?'
 4956|   775k|                     yaml::skip_inline_ws(it, end);
 4957|       |
 4958|   775k|                     const int32_t explicit_value_indicator_indent =
 4959|   775k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4959:25): [True: 556k, False: 219k]
  ------------------
 4960|       |
 4961|   775k|                     key_t key{};
 4962|   775k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4963|   775k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   775k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   775k|                        };
 4966|       |
 4967|   775k|                        auto key_it = it;
 4968|   775k|                        yaml::skip_inline_ws(key_it, end);
 4969|       |
 4970|   775k|                        auto content = key_it;
 4971|   775k|                        yaml::skip_to_content(content, end);
 4972|   775k|                        bool handled_anchor_only_empty_key = false;
 4973|       |
 4974|       |                        // Anchor on an empty explicit key node:
 4975|       |                        //   ? &a
 4976|       |                        //   : value
 4977|   775k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4977:29): [True: 734k, False: 41.6k]
  |  Branch (4977:47): [True: 53.6k, False: 680k]
  ------------------
 4978|  53.6k|                           auto anchor_probe = content + 1;
 4979|  53.6k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4980|  53.6k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4980:32): [True: 53.5k, False: 61]
  ------------------
 4981|  53.5k|                              auto after_anchor = anchor_probe;
 4982|  53.5k|                              yaml::skip_inline_ws(after_anchor, end);
 4983|       |
 4984|  53.5k|                              auto value_indicator = after_anchor;
 4985|  53.5k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4985:35): [True: 52.0k, False: 1.54k]
  |  Branch (4985:61): [True: 6.76k, False: 45.2k]
  ------------------
 4986|  6.76k|                                 key.clear();
 4987|  6.76k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4988|  6.76k|                                 it = value_indicator;
 4989|  6.76k|                                 handled_anchor_only_empty_key = true;
 4990|  6.76k|                              }
 4991|  46.7k|                              else {
 4992|  46.7k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4992:38): [True: 45.2k, False: 1.54k]
  |  Branch (4992:64): [True: 2.99k, False: 42.2k]
  ------------------
 4993|  2.99k|                                    yaml::skip_comment(value_indicator, end);
 4994|  2.99k|                                 }
 4995|  46.7k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4995:38): [True: 44.4k, False: 2.37k]
  |  Branch (4995:65): [True: 8.64k, False: 35.7k]
  |  Branch (4995:93): [True: 7.19k, False: 28.5k]
  ------------------
 4996|  15.8k|                                    yaml::skip_newline(value_indicator, end);
 4997|  15.8k|                                    auto value_line = value_indicator;
 4998|  15.8k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4999|  15.8k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4999:41): [True: 6, False: 15.8k]
  ------------------
 5000|      6|                                       return false;
 5001|  15.8k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (5001:41): [True: 14.0k, False: 1.83k]
  |  Branch (5001:62): [True: 2.67k, False: 11.3k]
  ------------------
 5002|  2.67k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5002:41): [True: 2.64k, False: 36]
  ------------------
 5003|  2.64k|                                       key.clear();
 5004|  2.64k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 5005|  2.64k|                                       it = value_line;
 5006|  2.64k|                                       handled_anchor_only_empty_key = true;
 5007|  2.64k|                                    }
 5008|  13.1k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (5008:46): [True: 11.3k, False: 1.83k]
  |  Branch (5008:67): [True: 36, False: 11.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|     36|                                       ctx.error = error_code::syntax_error;
 5013|     36|                                       return false;
 5014|     36|                                    }
 5015|  15.8k|                                 }
 5016|  46.7k|                              }
 5017|  53.5k|                           }
 5018|  53.6k|                        }
 5019|       |
 5020|   775k|                        const bool key_content_spans_lines = [&] {
 5021|   775k|                           auto scan = key_it;
 5022|   775k|                           while (scan != content && scan != end) {
 5023|   775k|                              if (*scan == '\n' || *scan == '\r') return true;
 5024|   775k|                              ++scan;
 5025|   775k|                           }
 5026|   775k|                           return false;
 5027|   775k|                        }();
 5028|       |
 5029|   775k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5029:29): [True: 9.40k, False: 766k]
  ------------------
 5030|       |                           // 'it' already points to the explicit value indicator ':'
 5031|  9.40k|                        }
 5032|   766k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5032:34): [True: 41.6k, False: 724k]
  |  Branch (5032:53): [True: 387k, False: 337k]
  |  Branch (5032:72): [True: 384k, False: 2.57k]
  ------------------
 5033|   426k|                           key.clear();
 5034|   426k|                           it = content;
 5035|   426k|                        }
 5036|   340k|                        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|   340k|                           auto key_node_it = content;
 5042|   340k|                           auto key_node_end = end;
 5043|   340k|                           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|   340k|                              auto scan = content;
 5048|  8.30M|                              while (scan != end) {
  ------------------
  |  Branch (5048:38): [True: 8.14M, False: 162k]
  ------------------
 5049|   148M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5049:41): [True: 148M, False: 73.9k]
  |  Branch (5049:56): [True: 143M, False: 4.20M]
  |  Branch (5049:73): [True: 140M, False: 3.86M]
  ------------------
 5050|   140M|                                    ++scan;
 5051|   140M|                                 }
 5052|  8.14M|                                 if (scan == end) {
  ------------------
  |  Branch (5052:38): [True: 73.9k, False: 8.06M]
  ------------------
 5053|  73.9k|                                    break;
 5054|  73.9k|                                 }
 5055|       |
 5056|  8.06M|                                 yaml::skip_newline(scan, end);
 5057|  8.06M|                                 auto line_start = scan;
 5058|       |
 5059|  8.06M|                                 int32_t indicator_indent = 0;
 5060|  14.8M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5060:41): [True: 14.7M, False: 162k]
  |  Branch (5060:56): [True: 6.82M, False: 7.90M]
  ------------------
 5061|  6.82M|                                    ++indicator_indent;
 5062|  6.82M|                                    ++scan;
 5063|  6.82M|                                 }
 5064|       |
 5065|  8.06M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5065:38): [True: 7.90M, False: 162k]
  |  Branch (5065:53): [True: 519k, False: 7.38M]
  ------------------
 5066|   519k|                                    const auto after_colon = scan + 1;
 5067|   519k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5067:42): [True: 785, False: 518k]
  ------------------
 5068|   518k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5068:42): [True: 337k, False: 180k]
  ------------------
 5069|   338k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5069:41): [True: 104k, False: 234k]
  ------------------
 5070|   104k|                                       key_node_end = line_start;
 5071|   104k|                                       break;
 5072|   104k|                                    }
 5073|   519k|                                 }
 5074|  8.06M|                              }
 5075|   340k|                           }
 5076|       |
 5077|   340k|                           glz::generic key_node{};
 5078|   340k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5079|   340k|                           ctx.explicit_mapping_key_context = true;
 5080|   340k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5081|   340k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5082|   340k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5082:32): [True: 18.3k, False: 321k]
  ------------------
 5083|  18.3k|                              return false;
 5084|   321k|                           it = key_node_it;
 5085|   321k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5085:32): [True: 74, False: 321k]
  ------------------
 5086|     74|                              return false;
 5087|   321k|                        }
 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|   757k|                     yaml::skip_inline_ws(it, end);
 5098|   775k|                     yaml::skip_comment(it, end);
 5099|       |
 5100|       |                     // Value indicator may appear on the next line at the same indent.
 5101|   775k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5101:26): [True: 644k, False: 131k]
  |  Branch (5101:40): [True: 56.9k, False: 587k]
  |  Branch (5101:55): [True: 83.3k, False: 504k]
  ------------------
 5102|   140k|                        auto probe = it;
 5103|   140k|                        bool found_value_indicator = false;
 5104|       |
 5105|   219k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5105:32): [True: 175k, False: 43.8k]
  |  Branch (5105:49): [True: 70.1k, False: 104k]
  |  Branch (5105:67): [True: 104k, False: 64]
  ------------------
 5106|   175k|                           yaml::skip_newline(probe, end);
 5107|       |
 5108|   175k|                           auto value_line = probe;
 5109|   175k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5110|   175k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5110:32): [True: 7, False: 175k]
  ------------------
 5111|      7|                              return false;
 5112|       |
 5113|   175k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5113:32): [True: 43.4k, False: 131k]
  |  Branch (5113:53): [True: 7.61k, False: 124k]
  |  Branch (5113:76): [True: 17.8k, False: 106k]
  ------------------
 5114|  68.9k|                              probe = value_line;
 5115|  68.9k|                              continue; // blank line
 5116|  68.9k|                           }
 5117|   106k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5117:32): [True: 9.82k, False: 96.3k]
  ------------------
 5118|  9.82k|                              yaml::skip_comment(value_line, end);
 5119|  9.82k|                              probe = value_line;
 5120|  9.82k|                              continue; // comment-only line
 5121|  9.82k|                           }
 5122|  96.3k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5122:32): [True: 28.0k, False: 68.2k]
  |  Branch (5122:54): [True: 17.9k, False: 10.1k]
  ------------------
 5123|  17.9k|                              it = value_line;
 5124|  17.9k|                              found_value_indicator = true;
 5125|  17.9k|                           }
 5126|  96.3k|                           break;
 5127|   106k|                        }
 5128|       |
 5129|   140k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5129:29): [True: 17.9k, False: 122k]
  ------------------
 5130|  17.9k|                           yaml::skip_inline_ws(it, end);
 5131|  17.9k|                        }
 5132|   140k|                     }
 5133|       |
 5134|   775k|                     val_t val{};
 5135|   775k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5135:26): [True: 644k, False: 131k]
  |  Branch (5135:39): [True: 497k, False: 147k]
  ------------------
 5136|   497k|                        ++it;
 5137|   497k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5137:29): [True: 496k, False: 774]
  |  Branch (5137:42): [True: 15, False: 496k]
  ------------------
 5138|     15|                           ctx.error = error_code::syntax_error;
 5139|     15|                           return false;
 5140|     15|                        }
 5141|   497k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5141:29): [True: 496k, False: 774]
  |  Branch (5141:43): [True: 6.27k, False: 490k]
  |  Branch (5141:58): [True: 396k, False: 94.3k]
  ------------------
 5142|   402k|                           auto probe = it;
 5143|   402k|                           yaml::skip_newline(probe, end);
 5144|   555k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5144:35): [True: 550k, False: 4.29k]
  |  Branch (5144:51): [True: 152k, False: 398k]
  ------------------
 5145|   402k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5145:32): [True: 398k, False: 4.29k]
  |  Branch (5145:48): [True: 124k, False: 273k]
  |  Branch (5145:65): [True: 123k, False: 293]
  |  Branch (5145:89): [True: 6, False: 123k]
  ------------------
 5146|      6|                              ctx.error = error_code::syntax_error;
 5147|      6|                              return false;
 5148|      6|                           }
 5149|   402k|                        }
 5150|   497k|                        yaml::skip_inline_ws(it, end);
 5151|   497k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5151:29): [True: 1.54k, False: 496k]
  ------------------
 5152|  1.54k|                           return false;
 5153|   497k|                     }
 5154|       |
 5155|   774k|                     value.emplace(std::move(key), std::move(val));
 5156|   774k|                     return true;
 5157|   775k|                  }
 5158|       |
 5159|  1.14M|                  key_t key{};
 5160|  1.14M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5161|  1.14M|                     auto key_probe = it;
 5162|  1.14M|                     yaml::skip_inline_ws(key_probe, end);
 5163|  1.14M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5163:53): [True: 1.14M, False: 0]
  |  Branch (5163:74): [True: 3.97k, False: 1.13M]
  |  Branch (5163:95): [True: 1.92k, False: 1.13M]
  ------------------
 5164|  1.14M|                     if (complex_flow_key) {
  ------------------
  |  Branch (5164:26): [True: 5.89k, False: 1.13M]
  ------------------
 5165|  5.89k|                        glz::generic key_node{};
 5166|  5.89k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5167|  5.89k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5167:29): [True: 1.50k, False: 4.39k]
  ------------------
 5168|  1.50k|                           return false;
 5169|  4.39k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5169:29): [True: 4, False: 4.38k]
  ------------------
 5170|      4|                           return false;
 5171|  4.39k|                     }
 5172|  1.13M|                     else {
 5173|  1.13M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5173:29): [True: 8.46k, False: 1.12M]
  ------------------
 5174|  8.46k|                           return false;
 5175|  8.46k|                        }
 5176|  1.13M|                     }
 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.13M|                  yaml::skip_inline_ws(it, end);
 5185|       |
 5186|  1.14M|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5186:23): [True: 10.8k, False: 1.13M]
  |  Branch (5186:36): [True: 2.55k, False: 1.12M]
  ------------------
 5187|  3.40k|                     ctx.error = error_code::syntax_error;
 5188|  3.40k|                     return false;
 5189|  3.40k|                  }
 5190|  1.13M|                  ++it;
 5191|  1.13M|                  yaml::skip_inline_ws(it, end);
 5192|       |
 5193|  1.13M|                  val_t val{};
 5194|  1.13M|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5194:23): [True: 55.3k, False: 1.08M]
  ------------------
 5195|  55.3k|                     return false;
 5196|       |
 5197|  1.08M|                  value.emplace(std::move(key), std::move(val));
 5198|  1.08M|                  return true;
 5199|  1.13M|               });
_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|   775k|                        const bool key_content_spans_lines = [&] {
 5021|   775k|                           auto scan = key_it;
 5022|   796k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (5022:35): [True: 672k, False: 124k]
  |  Branch (5022:54): [True: 672k, False: 0]
  ------------------
 5023|   672k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (5023:35): [True: 117k, False: 555k]
  |  Branch (5023:52): [True: 534k, False: 20.6k]
  ------------------
 5024|  20.6k|                              ++scan;
 5025|  20.6k|                           }
 5026|   124k|                           return false;
 5027|   775k|                        }();
_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|   321k|                        auto to_string_key = [&](glz::generic& key_node) {
 4964|   321k|                           return yaml::materialize_key(key, key_node, ctx);
 4965|   321k|                        };
_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.62M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4884|  1.62M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4884:26): [True: 1.60M, False: 24.9k]
  |  Branch (4884:39): [True: 793k, False: 807k]
  ------------------
 4885|   793k|                        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|   793k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4892|   793k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4892:32): [True: 793k, False: 0]
  ------------------
 4893|   793k|                              auto is_line_content_start = [&](auto pos) {
 4894|   793k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   793k|                              };
 4896|       |
 4897|   793k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   793k|                                 const char* line = ctx.line_begin_of(pos);
 4899|   793k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4900|   793k|                                 return line != end && *line == ':';
 4901|   793k|                              };
 4902|       |
 4903|   793k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4903:35): [True: 793k, False: 0]
  ------------------
 4904|   793k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4904:35): [True: 129k, False: 664k]
  ------------------
 4905|   129k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4905:35): [True: 690, False: 128k]
  ------------------
 4906|    690|                                 ctx.error = error_code::syntax_error;
 4907|    690|                                 return false;
 4908|    690|                              }
 4909|   792k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4910|   792k|                           }
 4911|   793k|                        }
 4912|       |
 4913|   793k|                        if (*it == '-' &&
  ------------------
  |  Branch (4913:29): [True: 12.8k, False: 780k]
  ------------------
 4914|  12.8k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4914:30): [True: 806, False: 11.9k]
  |  Branch (4914:49): [True: 1.97k, False: 10.0k]
  ------------------
 4915|  2.78k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4915:29): [True: 28, False: 2.75k]
  ------------------
 4916|       |                           // "key: - item" is not valid block sequence syntax.
 4917|     28|                           ctx.error = error_code::syntax_error;
 4918|     28|                           return false;
 4919|     28|                        }
 4920|       |
 4921|   793k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4921:29): [True: 0, False: 793k]
  ------------------
 4922|      0|                           return false;
 4923|   793k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4924|   793k|                        ctx.pop_indent();
 4925|   793k|                     }
 4926|   832k|                     else {
 4927|   832k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4928|   832k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4928:29): [True: 121k, False: 711k]
  ------------------
 4929|   121k|                           yaml::skip_to_content(it, end);
 4930|   121k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4930:32): [True: 121k, False: 0]
  |  Branch (4930:45): [True: 0, False: 121k]
  |  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|   121k|                           const int32_t value_indent =
 4937|   121k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4937:31): [Folded, False: 121k]
  ------------------
 4938|   121k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4938:32): [True: 0, False: 121k]
  ------------------
 4939|      0|                              return false;
 4940|   121k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4941|   121k|                           ctx.pop_indent();
 4942|   121k|                        }
 4943|   832k|                     }
 4944|  1.62M|                     return !bool(ctx.error);
 4945|  1.62M|                  };
_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|   793k|                              auto is_line_content_start = [&](auto pos) {
 4894|   793k|                                 return !ctx.line_prefix_before(pos).has_content;
 4895|   793k|                              };
_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|   922k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4898|   922k|                                 const char* line = ctx.line_begin_of(pos);
 4899|  2.95M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4899:41): [True: 2.95M, False: 0]
  |  Branch (4899:57): [True: 2.03M, False: 923k]
  |  Branch (4899:73): [True: 1.73k, False: 922k]
  ------------------
 4900|   922k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4900:41): [True: 922k, False: 0]
  |  Branch (4900:56): [True: 657k, False: 264k]
  ------------------
 4901|   922k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4652|   903k|            {
 4653|       |               // emplace is a no-op for keys the document already wrote, so only
 4654|       |               // untouched pre-existing entries are put back.
 4655|   903k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4655:33): [True: 0, False: 903k]
  ------------------
 4656|      0|                  target.emplace(entry.first, std::move(entry.second));
 4657|      0|               }
 4658|   903k|            }
_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|   247k|      {
 6718|   247k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 6719|   247k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (6719:14): [True: 9, False: 247k]
  ------------------
 6720|      9|            return;
 6721|   247k|         op<Opts>(value, ctx, it, end);
 6722|   247k|      }
_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|   265k|      {
  301|   265k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 265k]
  |  Branch (301:27): [True: 0, False: 265k]
  ------------------
  302|       |
  303|   265k|         ++it; // skip '*'
  304|   265k|         auto name = parse_anchor_name(it, end);
  305|   265k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 519, False: 264k]
  ------------------
  306|    519|            ctx.error = error_code::syntax_error;
  307|    519|            return true;
  308|    519|         }
  309|       |
  310|   264k|         auto anchor_it = ctx.anchors.find(name);
  311|   264k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.48k, False: 262k]
  ------------------
  312|  2.48k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.48k|            return true;
  314|  2.48k|         }
  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|   262k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   262k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 5.51k, False: 256k]
  ------------------
  322|  5.51k|            return true;
  323|  5.51k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   256k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 130, False: 256k]
  ------------------
  329|    130|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    130|            return true;
  331|    130|         }
  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|   256k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   256k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 256k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   256k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 24, False: 256k]
  ------------------
  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|   256k|         auto replay_it = span.begin;
  348|   256k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   256k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   256k|         ctx.indent_stack.clear();
  353|   256k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 153k, False: 102k]
  ------------------
  354|   153k|            ctx.push_indent(span.base_indent - 1);
  355|   153k|         }
  356|       |
  357|   256k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   256k|         using V = std::remove_cvref_t<T>;
  360|   256k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   256k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   256k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   256k|         return true;
  367|   256k|      }
_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|   390k|      {
 5311|   390k|         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|   390k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   390k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   390k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   390k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 390k, False: 0]
  ------------------
 5321|   390k|            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|   390k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1960|   401k|      {
 1961|   401k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 26.3k, False: 374k]
  ------------------
 1962|  26.3k|            return;
 1963|       |
 1964|   374k|         yaml::node_preamble_state preamble{};
 1965|   374k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 13.0k, False: 361k]
  ------------------
 1966|   374k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  13.0k|            return;
 1968|       |
 1969|   361k|         std::string str;
 1970|   361k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   361k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 361k, False: 0]
  ------------------
 1973|  2.45k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 2.45k, False: 359k]
  ------------------
 1974|  2.45k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  2.45k|            break;
 1976|  2.20k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 2.20k, False: 359k]
  ------------------
 1977|  2.20k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  2.20k|            break;
 1979|  1.11k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 1.11k, False: 360k]
  ------------------
 1980|  4.43k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 3.31k, False: 358k]
  ------------------
 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.43k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  4.43k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 1.84k, False: 2.59k]
  ------------------
 1986|  4.43k|            break;
 1987|   352k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 352k, False: 9.09k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   352k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   352k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 282k, False: 70.3k]
  ------------------
 1992|   282k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|   282k|               }
 1994|  70.3k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|  70.3k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|  70.3k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   352k|            break;
 2003|   361k|         }
 2004|       |
 2005|   361k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 348k, False: 13.5k]
  ------------------
 2006|   348k|            value = std::move(str);
 2007|   348k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   348k|         }
 2009|   361k|      }
_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|   374k|      {
  466|   374k|         skip_inline_ws(it, end);
  467|       |
  468|   374k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 21, False: 374k]
  ------------------
  469|     21|            if constexpr (!AllowEmptyInput) {
  470|     21|               ctx.error = error_code::unexpected_end;
  471|     21|            }
  472|     21|            return true;
  473|     21|         }
  474|       |
  475|   374k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   374k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 21, False: 374k]
  ------------------
  477|     21|            ctx.error = error_code::syntax_error;
  478|     21|            return true;
  479|     21|         }
  480|   374k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 12, False: 374k]
  ------------------
  481|     12|            ctx.error = error_code::syntax_error;
  482|     12|            return true;
  483|     12|         }
  484|       |
  485|   374k|         skip_inline_ws(it, end);
  486|       |
  487|   374k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 32, False: 374k]
  ------------------
  488|     32|            if constexpr (!AllowEmptyInput) {
  489|     32|               ctx.error = error_code::unexpected_end;
  490|     32|            }
  491|     32|            return true;
  492|     32|         }
  493|       |
  494|   374k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 12.9k, False: 361k]
  ------------------
  495|  12.9k|            return true;
  496|  12.9k|         }
  497|       |
  498|   361k|         return false;
  499|   374k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1966|   374k|                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|   374k|      {
  409|   374k|         state.has_anchor = false;
  410|   374k|         state.anchor_name.clear();
  411|   374k|         state.anchor_start = nullptr;
  412|   374k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   374k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   374k|            else {
  421|   374k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 12.8k, False: 362k]
  ------------------
  422|   374k|            }
  423|   374k|         }
  424|       |
  425|   374k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 362k, False: 12.8k]
  |  Branch (425:27): [True: 17.5k, False: 344k]
  ------------------
  426|  17.5k|            ++it;
  427|  17.5k|            auto name = parse_anchor_name(it, end);
  428|  17.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 63, False: 17.4k]
  ------------------
  429|     63|               ctx.error = error_code::syntax_error;
  430|     63|               return true;
  431|     63|            }
  432|  17.4k|            skip_inline_ws(it, end);
  433|  17.4k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 102, False: 17.3k]
  ------------------
  434|    102|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    102|                  ctx.error = error_code::unexpected_end;
  436|    102|               }
  437|    102|               return true;
  438|    102|            }
  439|  17.3k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  17.3k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 17.3k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  17.3k|            }
  445|  17.3k|            state.has_anchor = true;
  446|  17.3k|            state.anchor_name = std::string(name);
  447|  17.3k|            state.anchor_start = &*it;
  448|  17.3k|         }
  449|       |
  450|   374k|         return false;
  451|   374k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   374k|      {
  301|   374k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 374k]
  |  Branch (301:27): [True: 362k, False: 12.8k]
  ------------------
  302|       |
  303|  12.8k|         ++it; // skip '*'
  304|  12.8k|         auto name = parse_anchor_name(it, end);
  305|  12.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 39, False: 12.7k]
  ------------------
  306|     39|            ctx.error = error_code::syntax_error;
  307|     39|            return true;
  308|     39|         }
  309|       |
  310|  12.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  12.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 107, False: 12.6k]
  ------------------
  312|    107|            ctx.error = error_code::syntax_error; // undefined alias
  313|    107|            return true;
  314|    107|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  12.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  12.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.56k, False: 11.1k]
  ------------------
  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|  11.1k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 49, False: 11.0k]
  ------------------
  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.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  11.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 11.0k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  11.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 11.0k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  11.0k|         auto replay_it = span.begin;
  348|  11.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  11.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  11.0k|         ctx.indent_stack.clear();
  353|  11.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 9.00k, False: 2.04k]
  ------------------
  354|  9.00k|            ctx.push_indent(span.base_indent - 1);
  355|  9.00k|         }
  356|       |
  357|  11.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  11.0k|         using V = std::remove_cvref_t<T>;
  360|  11.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  11.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  11.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  11.0k|         return true;
  367|  11.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_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|  92.2k|      {
 5311|  92.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|  92.2k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  92.2k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  92.2k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  92.2k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 92.2k, False: 0]
  ------------------
 5321|  92.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|  92.2k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2115|  96.8k|      {
 2116|  96.8k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 96.8k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  96.8k|         yaml::node_preamble_state preamble{};
 2120|  96.8k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 15.0k, False: 81.8k]
  ------------------
 2121|  96.8k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  96.8k|                   return yaml::tag_valid_for_float(tag);
 2123|  96.8k|                }
 2124|  96.8k|                else {
 2125|  96.8k|                   return yaml::tag_valid_for_int(tag);
 2126|  96.8k|                }
 2127|  96.8k|             }))
 2128|  15.0k|            return;
 2129|       |
 2130|  81.8k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  81.8k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  81.8k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  81.8k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 24.5k, False: 57.2k]
  ------------------
 2138|  24.5k|               ++it;
 2139|  24.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 23.4k, False: 1.14k]
  |  Branch (2139:38): [True: 2.79k, False: 20.6k]
  |  Branch (2139:74): [True: 779, False: 19.8k]
  ------------------
 2140|  19.8k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 867, False: 19.0k]
  ------------------
 2141|  4.44k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  4.44k|                  it += 3;
 2143|  4.44k|                  finalize();
 2144|  4.44k|                  return;
 2145|  4.44k|               }
 2146|  20.1k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 19.0k, False: 1.14k]
  |  Branch (2146:38): [True: 4.71k, False: 14.2k]
  |  Branch (2146:74): [True: 654, False: 13.6k]
  ------------------
 2147|  13.6k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 777, False: 12.8k]
  ------------------
 2148|  6.14k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  6.14k|                  it += 3;
 2150|  6.14k|                  finalize();
 2151|  6.14k|                  return;
 2152|  6.14k|               }
 2153|  14.0k|               it = start;
 2154|  14.0k|            }
 2155|       |
 2156|  71.2k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 6.21k, False: 65.0k]
  |  Branch (2156:31): [True: 10.5k, False: 54.4k]
  ------------------
 2157|  16.7k|               const char sign = *it;
 2158|  16.7k|               ++it;
 2159|  16.7k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 16.0k, False: 732]
  |  Branch (2159:33): [True: 5.52k, False: 10.5k]
  ------------------
 2160|  5.52k|                  ++it;
 2161|  5.52k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 4.41k, False: 1.10k]
  |  Branch (2161:41): [True: 1.00k, False: 3.41k]
  |  Branch (2161:77): [True: 1.26k, False: 2.15k]
  ------------------
 2162|  2.65k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 384, False: 1.76k]
  ------------------
 2163|  2.65k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 1.31k, False: 1.33k]
  ------------------
 2164|  1.31k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  1.31k|                     }
 2166|  1.33k|                     else {
 2167|  1.33k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  1.33k|                     }
 2169|  2.65k|                     it += 3;
 2170|  2.65k|                     finalize();
 2171|  2.65k|                     return;
 2172|  2.65k|                  }
 2173|  5.52k|               }
 2174|  14.1k|               it = start;
 2175|  14.1k|            }
 2176|  71.2k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  68.6k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  72.7M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 72.7M, False: 26.9k]
  ------------------
 2183|  72.7M|            const char c = *it;
 2184|  72.7M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 16.3k, False: 72.7M]
  |  Branch (2184:29): [True: 3.02k, False: 72.7M]
  |  Branch (2184:42): [True: 6.40k, False: 72.7M]
  |  Branch (2184:55): [True: 5.09k, False: 72.7M]
  |  Branch (2184:68): [True: 4.14k, False: 72.7M]
  |  Branch (2184:80): [True: 1.85k, False: 72.7M]
  |  Branch (2184:92): [True: 1.66k, False: 72.7M]
  |  Branch (2184:104): [True: 6.68k, False: 72.7M]
  ------------------
 2185|  45.2k|               break;
 2186|  45.2k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  72.7M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 29.4k, False: 72.6M]
  ------------------
 2189|  29.4k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 1.06k, False: 28.3k]
  |  Branch (2189:39): [True: 5.78k, False: 22.5k]
  |  Branch (2189:59): [True: 335, False: 22.2k]
  |  Branch (2189:80): [True: 1.52k, False: 20.6k]
  |  Branch (2189:101): [True: 948, False: 19.7k]
  ------------------
 2190|  9.65k|                  break;
 2191|  9.65k|               }
 2192|  29.4k|            }
 2193|  72.6M|            ++it;
 2194|  72.6M|         }
 2195|       |
 2196|  81.8k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  81.8k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 4.59k, False: 77.2k]
  ------------------
 2199|  4.59k|            ctx.error = error_code::parse_number_failure;
 2200|  4.59k|            return;
 2201|  4.59k|         }
 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|  77.2k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  77.2k|            bool negative = false;
 2254|  77.2k|            std::string_view digits = num_str;
 2255|       |
 2256|  77.2k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 64.0k, False: 13.2k]
  |  Branch (2256:37): [True: 9.23k, False: 54.7k]
  |  Branch (2256:62): [True: 4.90k, False: 49.8k]
  ------------------
 2257|  14.1k|               negative = (digits.front() == '-');
 2258|  14.1k|               digits.remove_prefix(1);
 2259|  14.1k|            }
 2260|       |
 2261|  77.2k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 42.4k, False: 34.8k]
  |  Branch (2261:38): [True: 14.1k, False: 28.2k]
  ------------------
 2262|  14.1k|               int base = 10;
 2263|  14.1k|               size_t offset = 0;
 2264|       |
 2265|  14.1k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 4.79k, False: 9.36k]
  |  Branch (2265:40): [True: 951, False: 8.41k]
  ------------------
 2266|  5.74k|                  base = 16;
 2267|  5.74k|                  offset = 2;
 2268|  5.74k|               }
 2269|  8.41k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 915, False: 7.50k]
  |  Branch (2269:45): [True: 1.02k, False: 6.47k]
  ------------------
 2270|  1.94k|                  base = 8;
 2271|  1.94k|                  offset = 2;
 2272|  1.94k|               }
 2273|  6.47k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 817, False: 5.66k]
  |  Branch (2273:45): [True: 294, False: 5.36k]
  ------------------
 2274|  1.11k|                  base = 2;
 2275|  1.11k|                  offset = 2;
 2276|  1.11k|               }
 2277|       |
 2278|  14.1k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 8.80k, False: 5.36k]
  ------------------
 2279|  8.80k|                  auto raw_digits = digits.substr(offset);
 2280|  8.80k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  8.80k|                  std::string clean_storage;
 2283|  8.80k|                  std::string_view clean_view;
 2284|  8.80k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 2.84k, False: 5.95k]
  ------------------
 2285|  2.84k|                     clean_storage.reserve(raw_digits.size());
 2286|  7.05M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 7.05M, False: 2.84k]
  ------------------
 2287|  7.05M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 7.04M, False: 5.65k]
  ------------------
 2288|  7.04M|                           clean_storage.push_back(c);
 2289|  7.04M|                        }
 2290|  7.05M|                     }
 2291|  2.84k|                     clean_view = clean_storage;
 2292|  2.84k|                  }
 2293|  5.95k|                  else {
 2294|  5.95k|                     clean_view = raw_digits;
 2295|  5.95k|                  }
 2296|       |
 2297|  8.80k|                  uint64_t parsed_int{};
 2298|  8.80k|                  auto [ptr, ec] =
 2299|  8.80k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  8.80k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 4.44k, False: 4.35k]
  |  Branch (2300:44): [True: 2.60k, False: 1.75k]
  ------------------
 2301|  7.04k|                     ctx.error = error_code::parse_number_failure;
 2302|  7.04k|                     finalize();
 2303|  7.04k|                     return;
 2304|  7.04k|                  }
 2305|       |
 2306|  1.75k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  1.75k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 858, False: 899]
  ------------------
 2308|  1.75k|                  finalize();
 2309|  1.75k|                  return;
 2310|  8.80k|               }
 2311|  14.1k|            }
 2312|  77.2k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  68.4k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  77.2k|         std::string clean_storage;
 2318|  77.2k|         std::string_view clean_view;
 2319|       |
 2320|  77.2k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 5.26k, False: 71.9k]
  ------------------
 2321|  5.26k|            clean_storage.reserve(num_str.size());
 2322|  34.9M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 34.9M, False: 5.26k]
  ------------------
 2323|  34.9M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 34.8M, False: 19.6k]
  ------------------
 2324|  34.8M|                  clean_storage.push_back(c);
 2325|  34.8M|               }
 2326|  34.9M|            }
 2327|  5.26k|            clean_view = clean_storage;
 2328|  5.26k|         }
 2329|  71.9k|         else {
 2330|  71.9k|            clean_view = num_str;
 2331|  71.9k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  77.2k|         auto parse_view = clean_view;
 2336|  77.2k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 54.8k, False: 22.3k]
  |  Branch (2336:37): [True: 9.23k, False: 45.6k]
  ------------------
 2337|  9.23k|            parse_view.remove_prefix(1);
 2338|  9.23k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 2.70k, False: 6.53k]
  ------------------
 2339|  2.70k|               ctx.error = error_code::parse_number_failure;
 2340|  2.70k|               return;
 2341|  2.70k|            }
 2342|  9.23k|         }
 2343|       |
 2344|  74.5k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  74.5k|            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|  74.5k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 50.3k, False: 24.2k]
  |  Branch (2347:45): [True: 14.8k, False: 9.37k]
  ------------------
 2348|  43.1k|               ctx.error = error_code::parse_number_failure;
 2349|  43.1k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  74.5k|         finalize();
 2360|  74.5k|      }
_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|  96.8k|      {
  466|  96.8k|         skip_inline_ws(it, end);
  467|       |
  468|  96.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 635, False: 96.2k]
  ------------------
  469|    635|            if constexpr (!AllowEmptyInput) {
  470|    635|               ctx.error = error_code::unexpected_end;
  471|    635|            }
  472|    635|            return true;
  473|    635|         }
  474|       |
  475|  96.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  96.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1.06k, False: 95.1k]
  ------------------
  477|  1.06k|            ctx.error = error_code::syntax_error;
  478|  1.06k|            return true;
  479|  1.06k|         }
  480|  95.1k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 642, False: 94.5k]
  ------------------
  481|    642|            ctx.error = error_code::syntax_error;
  482|    642|            return true;
  483|    642|         }
  484|       |
  485|  94.5k|         skip_inline_ws(it, end);
  486|       |
  487|  94.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 522, False: 94.0k]
  ------------------
  488|    522|            if constexpr (!AllowEmptyInput) {
  489|    522|               ctx.error = error_code::unexpected_end;
  490|    522|            }
  491|    522|            return true;
  492|    522|         }
  493|       |
  494|  94.0k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 12.1k, False: 81.8k]
  ------------------
  495|  12.1k|            return true;
  496|  12.1k|         }
  497|       |
  498|  81.8k|         return false;
  499|  94.0k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2120|  95.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  95.1k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  95.1k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  95.1k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  94.0k|      {
  409|  94.0k|         state.has_anchor = false;
  410|  94.0k|         state.anchor_name.clear();
  411|  94.0k|         state.anchor_start = nullptr;
  412|  94.0k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  94.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|  94.0k|            else {
  421|  94.0k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.5k, False: 83.4k]
  ------------------
  422|  94.0k|            }
  423|  94.0k|         }
  424|       |
  425|  94.0k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 83.4k, False: 10.5k]
  |  Branch (425:27): [True: 8.83k, False: 74.5k]
  ------------------
  426|  8.83k|            ++it;
  427|  8.83k|            auto name = parse_anchor_name(it, end);
  428|  8.83k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 856, False: 7.97k]
  ------------------
  429|    856|               ctx.error = error_code::syntax_error;
  430|    856|               return true;
  431|    856|            }
  432|  7.97k|            skip_inline_ws(it, end);
  433|  7.97k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 720, False: 7.25k]
  ------------------
  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|  7.25k|            state.has_anchor = true;
  446|  7.25k|            state.anchor_name = std::string(name);
  447|  7.25k|            state.anchor_start = &*it;
  448|  7.25k|         }
  449|       |
  450|  92.4k|         return false;
  451|  94.0k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  94.0k|      {
  301|  94.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 94.0k]
  |  Branch (301:27): [True: 83.4k, False: 10.5k]
  ------------------
  302|       |
  303|  10.5k|         ++it; // skip '*'
  304|  10.5k|         auto name = parse_anchor_name(it, end);
  305|  10.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 1.06k, False: 9.52k]
  ------------------
  306|  1.06k|            ctx.error = error_code::syntax_error;
  307|  1.06k|            return true;
  308|  1.06k|         }
  309|       |
  310|  9.52k|         auto anchor_it = ctx.anchors.find(name);
  311|  9.52k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 3.26k, False: 6.26k]
  ------------------
  312|  3.26k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  3.26k|            return true;
  314|  3.26k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  6.26k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  6.26k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.19k, False: 5.07k]
  ------------------
  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|  5.07k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 449, False: 4.62k]
  ------------------
  329|    449|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    449|            return true;
  331|    449|         }
  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.62k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.62k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 4.62k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  4.62k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.62k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.62k|         auto replay_it = span.begin;
  348|  4.62k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.62k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.62k|         ctx.indent_stack.clear();
  353|  4.62k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.62k, False: 2.99k]
  ------------------
  354|  1.62k|            ctx.push_indent(span.base_indent - 1);
  355|  1.62k|         }
  356|       |
  357|  4.62k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.62k|         using V = std::remove_cvref_t<T>;
  360|  4.62k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.62k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.62k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.62k|         return true;
  367|  4.62k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  74.5k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5310|  63.3k|      {
 5311|  63.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|  63.3k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|  63.3k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|  63.3k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|  63.3k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 63.3k, False: 0]
  ------------------
 5321|  63.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|  63.3k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2080|  75.7k|      {
 2081|  75.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 75.7k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  75.7k|         yaml::node_preamble_state preamble{};
 2085|  75.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 15.4k, False: 60.3k]
  ------------------
 2086|  75.7k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  15.4k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  60.3k|         std::string str;
 2091|  60.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  60.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 23.0k, False: 37.2k]
  |  Branch (2093:31): [True: 5.57k, False: 31.7k]
  |  Branch (2093:48): [True: 1.96k, False: 29.7k]
  |  Branch (2093:65): [True: 789, False: 28.9k]
  |  Branch (2093:81): [True: 1.10k, False: 27.8k]
  |  Branch (2093:97): [True: 971, False: 26.8k]
  ------------------
 2094|  35.6k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 795, False: 26.1k]
  |  Branch (2094:29): [True: 501, False: 25.5k]
  |  Branch (2094:44): [True: 917, False: 24.6k]
  ------------------
 2095|  35.6k|            value = true;
 2096|  35.6k|         }
 2097|  24.6k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 3.97k, False: 20.7k]
  |  Branch (2097:37): [True: 11.7k, False: 9.00k]
  |  Branch (2097:55): [True: 1.57k, False: 7.42k]
  |  Branch (2097:73): [True: 930, False: 6.49k]
  |  Branch (2097:88): [True: 2.95k, False: 3.53k]
  |  Branch (2097:103): [True: 695, False: 2.84k]
  ------------------
 2098|  24.0k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 729, False: 2.11k]
  |  Branch (2098:35): [True: 759, False: 1.35k]
  |  Branch (2098:51): [True: 768, False: 584]
  ------------------
 2099|  24.0k|            value = false;
 2100|  24.0k|         }
 2101|    584|         else {
 2102|    584|            ctx.error = error_code::expected_true_or_false;
 2103|    584|         }
 2104|       |
 2105|  60.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  60.3k|      }
_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|  75.7k|      {
  466|  75.7k|         skip_inline_ws(it, end);
  467|       |
  468|  75.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 12, False: 75.7k]
  ------------------
  469|     12|            if constexpr (!AllowEmptyInput) {
  470|     12|               ctx.error = error_code::unexpected_end;
  471|     12|            }
  472|     12|            return true;
  473|     12|         }
  474|       |
  475|  75.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  75.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 75.7k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  75.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 75.7k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  75.7k|         skip_inline_ws(it, end);
  486|       |
  487|  75.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 9, False: 75.6k]
  ------------------
  488|      9|            if constexpr (!AllowEmptyInput) {
  489|      9|               ctx.error = error_code::unexpected_end;
  490|      9|            }
  491|      9|            return true;
  492|      9|         }
  493|       |
  494|  75.6k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 15.3k, False: 60.3k]
  ------------------
  495|  15.3k|            return true;
  496|  15.3k|         }
  497|       |
  498|  60.3k|         return false;
  499|  75.6k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2086|  75.7k|                                             [](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|  75.6k|      {
  409|  75.6k|         state.has_anchor = false;
  410|  75.6k|         state.anchor_name.clear();
  411|  75.6k|         state.anchor_start = nullptr;
  412|  75.6k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  75.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|  75.6k|            else {
  421|  75.6k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 15.3k, False: 60.3k]
  ------------------
  422|  75.6k|            }
  423|  75.6k|         }
  424|       |
  425|  75.6k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 60.3k, False: 15.3k]
  |  Branch (425:27): [True: 4.36k, False: 56.0k]
  ------------------
  426|  4.36k|            ++it;
  427|  4.36k|            auto name = parse_anchor_name(it, end);
  428|  4.36k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 16, False: 4.35k]
  ------------------
  429|     16|               ctx.error = error_code::syntax_error;
  430|     16|               return true;
  431|     16|            }
  432|  4.35k|            skip_inline_ws(it, end);
  433|  4.35k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 49, False: 4.30k]
  ------------------
  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|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  4.30k|            state.has_anchor = true;
  446|  4.30k|            state.anchor_name = std::string(name);
  447|  4.30k|            state.anchor_start = &*it;
  448|  4.30k|         }
  449|       |
  450|  75.6k|         return false;
  451|  75.6k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  75.6k|      {
  301|  75.6k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 75.6k]
  |  Branch (301:27): [True: 60.3k, False: 15.3k]
  ------------------
  302|       |
  303|  15.3k|         ++it; // skip '*'
  304|  15.3k|         auto name = parse_anchor_name(it, end);
  305|  15.3k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 39, False: 15.2k]
  ------------------
  306|     39|            ctx.error = error_code::syntax_error;
  307|     39|            return true;
  308|     39|         }
  309|       |
  310|  15.2k|         auto anchor_it = ctx.anchors.find(name);
  311|  15.2k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 129, False: 15.1k]
  ------------------
  312|    129|            ctx.error = error_code::syntax_error; // undefined alias
  313|    129|            return true;
  314|    129|         }
  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.1k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  15.1k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.78k, False: 12.3k]
  ------------------
  322|  2.78k|            return true;
  323|  2.78k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  12.3k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 12, False: 12.3k]
  ------------------
  329|     12|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     12|            return true;
  331|     12|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader 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.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 12.3k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  12.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 12.3k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  12.3k|         auto replay_it = span.begin;
  348|  12.3k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  12.3k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  12.3k|         ctx.indent_stack.clear();
  353|  12.3k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.49k, False: 7.86k]
  ------------------
  354|  4.49k|            ctx.push_indent(span.base_indent - 1);
  355|  4.49k|         }
  356|       |
  357|  12.3k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  12.3k|         using V = std::remove_cvref_t<T>;
  360|  12.3k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  12.3k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  12.3k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  12.3k|         return true;
  367|  12.3k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2466|  36.1k|      {
 2467|  36.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 36.1k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  36.1k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  36.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 20, False: 36.1k]
  ------------------
 2473|     20|            ctx.error = error_code::unexpected_end;
 2474|     20|            return;
 2475|     20|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  36.1k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 4.12k, False: 32.0k]
  ------------------
 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|  32.0k|         auto start = it;
 2485|   157k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 156k, False: 1.24k]
  |  Branch (2485:30): [True: 125k, False: 30.7k]
  ------------------
 2486|   125k|            ++it;
 2487|   125k|         }
 2488|       |
 2489|  32.0k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  32.0k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 71, False: 31.9k]
  ------------------
 2491|     71|            ctx.error = error_code::syntax_error;
 2492|     71|         }
 2493|  32.0k|      }
_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|   212k|      {
 5311|   212k|         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|   212k|         else if constexpr (category_count == 1) {
 5317|       |            // Only one type in this category, use it directly
 5318|   212k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5319|   212k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5320|   212k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5320:17): [True: 212k, False: 0]
  ------------------
 5321|   212k|            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|   212k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4182|   220k|      {
 4183|   220k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4183:14): [True: 0, False: 220k]
  ------------------
 4184|      0|            return;
 4185|       |
 4186|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4187|   220k|         auto peek = it;
 4188|   220k|         yaml::node_preamble_state preamble{};
 4189|   220k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4189:14): [True: 11.0k, False: 209k]
  ------------------
 4190|   220k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4191|  11.0k|            it = peek;
 4192|  11.0k|            return;
 4193|  11.0k|         }
 4194|       |
 4195|       |         // A level of nesting, taken past the preamble as for sets above.
 4196|   209k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 4197|   209k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (4197:14): [True: 9, False: 209k]
  ------------------
 4198|      9|            return;
 4199|       |
 4200|   209k|         if (*peek == '[') {
  ------------------
  |  Branch (4200:14): [True: 87.9k, False: 121k]
  ------------------
 4201|       |            // Flow sequence - consume whitespace and parse
 4202|  87.9k|            it = peek;
 4203|  87.9k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4204|  87.9k|         }
 4205|   121k|         else if (*peek == '-') {
  ------------------
  |  Branch (4205:19): [True: 120k, False: 333]
  ------------------
 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|   120k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4208:17): [True: 906, False: 120k]
  |  Branch (4208:57): [True: 2.26k, False: 117k]
  ------------------
 4209|  3.17k|               it = peek;
 4210|  3.17k|            }
 4211|   120k|            int32_t seq_indent = ctx.current_indent();
 4212|   120k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4212:17): [True: 120k, False: 790]
  |  Branch (4212:31): [True: 85.8k, False: 34.3k]
  ------------------
 4213|  85.8k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4213:29): [True: 35.6k, False: 50.1k]
  |  Branch (4213:62): [True: 19.6k, False: 16.0k]
  ------------------
 4214|  85.8k|                                                          : (ctx.current_indent() + 1);
 4215|  85.8k|            }
 4216|   120k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4217|   120k|         }
 4218|    333|         else {
 4219|    333|            ctx.error = error_code::syntax_error;
 4220|    333|         }
 4221|       |
 4222|   209k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4223|   209k|      }
_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|   220k|      {
  466|   220k|         skip_inline_ws(it, end);
  467|       |
  468|   220k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 13, False: 220k]
  ------------------
  469|     13|            if constexpr (!AllowEmptyInput) {
  470|     13|               ctx.error = error_code::unexpected_end;
  471|     13|            }
  472|     13|            return true;
  473|     13|         }
  474|       |
  475|   220k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   220k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 220k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|   220k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 9, False: 220k]
  ------------------
  481|      9|            ctx.error = error_code::syntax_error;
  482|      9|            return true;
  483|      9|         }
  484|       |
  485|   220k|         skip_inline_ws(it, end);
  486|       |
  487|   220k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 17, False: 220k]
  ------------------
  488|     17|            if constexpr (!AllowEmptyInput) {
  489|     17|               ctx.error = error_code::unexpected_end;
  490|     17|            }
  491|     17|            return true;
  492|     17|         }
  493|       |
  494|   220k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 10.9k, False: 209k]
  ------------------
  495|  10.9k|            return true;
  496|  10.9k|         }
  497|       |
  498|   209k|         return false;
  499|   220k|      }
_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|   220k|                                             [](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|   220k|      {
  409|   220k|         state.has_anchor = false;
  410|   220k|         state.anchor_name.clear();
  411|   220k|         state.anchor_start = nullptr;
  412|   220k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   220k|         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|   220k|            else {
  421|   220k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.8k, False: 209k]
  ------------------
  422|   220k|            }
  423|   220k|         }
  424|       |
  425|   220k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 209k, False: 10.8k]
  |  Branch (425:27): [True: 3.36k, False: 206k]
  ------------------
  426|  3.36k|            ++it;
  427|  3.36k|            auto name = parse_anchor_name(it, end);
  428|  3.36k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 29, False: 3.33k]
  ------------------
  429|     29|               ctx.error = error_code::syntax_error;
  430|     29|               return true;
  431|     29|            }
  432|  3.33k|            skip_inline_ws(it, end);
  433|  3.33k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 65, False: 3.26k]
  ------------------
  434|     65|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     65|                  ctx.error = error_code::unexpected_end;
  436|     65|               }
  437|     65|               return true;
  438|     65|            }
  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.26k|            state.has_anchor = true;
  446|  3.26k|            state.anchor_name = std::string(name);
  447|  3.26k|            state.anchor_start = &*it;
  448|  3.26k|         }
  449|       |
  450|   220k|         return false;
  451|   220k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   220k|      {
  301|   220k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 220k]
  |  Branch (301:27): [True: 209k, False: 10.8k]
  ------------------
  302|       |
  303|  10.8k|         ++it; // skip '*'
  304|  10.8k|         auto name = parse_anchor_name(it, end);
  305|  10.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 32, False: 10.8k]
  ------------------
  306|     32|            ctx.error = error_code::syntax_error;
  307|     32|            return true;
  308|     32|         }
  309|       |
  310|  10.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 93, False: 10.7k]
  ------------------
  312|     93|            ctx.error = error_code::syntax_error; // undefined alias
  313|     93|            return true;
  314|     93|         }
  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: 2.49k, False: 8.25k]
  ------------------
  322|  2.49k|            return true;
  323|  2.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|  8.25k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 64, False: 8.19k]
  ------------------
  329|     64|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     64|            return true;
  331|     64|         }
  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.19k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.19k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 8.19k]
  ------------------
  339|      3|            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.24k, False: 2.94k]
  ------------------
  354|  5.24k|            ctx.push_indent(span.base_indent - 1);
  355|  5.24k|         }
  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|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  87.9k|      {
 2665|  87.9k|         using V = std::remove_cvref_t<T>;
 2666|  87.9k|         using value_type = typename V::value_type;
 2667|       |
 2668|  87.9k|         struct sequence_container_adapter
 2669|  87.9k|         {
 2670|  87.9k|            size_t index = 0;
 2671|       |
 2672|  87.9k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  87.9k|            {
 2674|  87.9k|               if constexpr (!resizable<V>) {
 2675|  87.9k|                  return index >= container.size();
 2676|  87.9k|               }
 2677|  87.9k|               else {
 2678|  87.9k|                  (void)container;
 2679|  87.9k|                  return false;
 2680|  87.9k|               }
 2681|  87.9k|            }
 2682|       |
 2683|  87.9k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  87.9k|            inline void append(V& container, value_type&& element) noexcept
 2686|  87.9k|            {
 2687|  87.9k|               if constexpr (emplace_backable<V>) {
 2688|  87.9k|                  container.emplace_back(std::move(element));
 2689|  87.9k|               }
 2690|  87.9k|               else if constexpr (emplaceable<V>) {
 2691|  87.9k|                  container.emplace(std::move(element));
 2692|  87.9k|               }
 2693|  87.9k|            }
 2694|  87.9k|         };
 2695|       |
 2696|  87.9k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 87.9k]
  |  Branch (2696:27): [True: 0, False: 87.9k]
  ------------------
 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|  87.9k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  87.9k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  87.9k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  87.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 81, False: 87.8k]
  ------------------
 2709|     81|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  87.8k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 86.3k, False: 1.51k]
  |  Branch (2712:27): [True: 9.74k, False: 76.5k]
  ------------------
 2713|  9.74k|            ++it;
 2714|  9.74k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  9.74k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 51, False: 9.68k]
  ------------------
 2716|     51|               return;
 2717|  9.68k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  9.68k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 1.34k, False: 8.34k]
  ------------------
 2719|  1.34k|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|  1.34k|               }
 2721|  9.68k|            }
 2722|  9.68k|            return;
 2723|  9.74k|         }
 2724|       |
 2725|  78.1k|         bool just_saw_comma = false;
 2726|  78.1k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  78.1k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  1.80M|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 1.80M, False: 2.79k]
  ------------------
 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.3k, False: 1.79M]
  ------------------
 2741|  10.3k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 10.3k, False: 0]
  ------------------
 2742|  10.3k|                     ++it;
 2743|  10.3k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  10.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 31, False: 10.2k]
  ------------------
 2745|     31|                        return;
 2746|  10.2k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  10.2k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 1.58k, False: 8.68k]
  ------------------
 2748|  1.58k|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|  1.58k|                        }
 2750|  10.2k|                     }
 2751|  10.2k|                     return;
 2752|  10.3k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  10.3k|               }
 2756|       |
 2757|  1.79M|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 218, False: 1.79M]
  |  Branch (2757:34): [True: 62, False: 1.79M]
  ------------------
 2758|    280|                  ctx.error = error_code::syntax_error;
 2759|    280|                  return;
 2760|    280|               }
 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.1k, False: 1.75M]
  ------------------
 2767|  44.1k|                  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: 38, False: 1.75M]
  ------------------
 2772|     38|                  return;
 2773|       |
 2774|  1.75M|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 1.74M, False: 2.94k]
  |  Branch (2774:33): [True: 9.10k, False: 1.74M]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  9.10k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 141, False: 8.96k]
  ------------------
 2777|    141|                     ctx.error = error_code::syntax_error;
 2778|    141|                     return;
 2779|    141|                  }
 2780|  8.96k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  8.96k|                     glz::generic key_node = std::move(element);
 2782|  8.96k|                     ++it;
 2783|  8.96k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  8.96k|                     glz::generic mapped{};
 2786|  8.96k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  8.96k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 1.24k, False: 7.71k]
  ------------------
 2788|  1.24k|                        return;
 2789|       |
 2790|  7.71k|                     std::string key;
 2791|  7.71k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 5, False: 7.70k]
  ------------------
 2792|      5|                        return;
 2793|       |
 2794|  7.70k|                     glz::generic pair{};
 2795|  7.70k|                     pair[key] = std::move(mapped);
 2796|  7.70k|                     element = std::move(pair);
 2797|       |
 2798|  7.70k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  7.70k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 7, False: 7.70k]
  ------------------
 2800|      7|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  8.96k|               }
 2807|       |
 2808|  1.75M|               adapter.append(value, std::move(element));
 2809|       |
 2810|  1.75M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 3.07k, False: 1.74M]
  ------------------
 2811|  3.07k|                  ctx.error = error_code::unexpected_end;
 2812|  3.07k|                  return;
 2813|  3.07k|               }
 2814|       |
 2815|  1.74M|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 11.7k, False: 1.73M]
  ------------------
 2816|  11.7k|                  ++it;
 2817|  11.7k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  11.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 266, False: 11.5k]
  ------------------
 2819|    266|                     return;
 2820|  11.5k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  11.5k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 1.78k, False: 9.73k]
  ------------------
 2822|  1.78k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|  1.78k|                     }
 2824|  11.5k|                  }
 2825|  11.5k|                  return;
 2826|  11.7k|               }
 2827|  1.73M|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 1.73M, False: 5.51k]
  ------------------
 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: 25, False: 1.73M]
  ------------------
 2832|     25|                     return;
 2833|  1.73M|               }
 2834|  5.51k|               else {
 2835|  5.51k|                  ctx.error = error_code::syntax_error;
 2836|  5.51k|                  return;
 2837|  5.51k|               }
 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.1k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   208k|      {
 2649|   208k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   208k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   208k|               value.clear();
 2653|   208k|            }
 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|   208k|      }
_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|   120k|      {
 3160|   120k|         using V = std::remove_cvref_t<T>;
 3161|   120k|         using value_type = typename V::value_type;
 3162|       |
 3163|   120k|         struct sequence_container_adapter
 3164|   120k|         {
 3165|   120k|            size_t index = 0;
 3166|       |
 3167|   120k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   120k|            {
 3169|   120k|               if constexpr (!resizable<V>) {
 3170|   120k|                  return index >= container.size();
 3171|   120k|               }
 3172|   120k|               else {
 3173|   120k|                  (void)container;
 3174|   120k|                  return false;
 3175|   120k|               }
 3176|   120k|            }
 3177|       |
 3178|   120k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   120k|            inline void append(V& container, value_type&& element) noexcept
 3181|   120k|            {
 3182|   120k|               if constexpr (emplace_backable<V>) {
 3183|   120k|                  container.emplace_back(std::move(element));
 3184|   120k|               }
 3185|   120k|               else if constexpr (emplaceable<V>) {
 3186|   120k|                  container.emplace(std::move(element));
 3187|   120k|               }
 3188|   120k|            }
 3189|   120k|         };
 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|   120k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   120k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   120k|         bool first_item = true;
 3200|   120k|         bool has_pending_item_anchor = false;
 3201|   120k|         std::string pending_item_anchor_name{};
 3202|   120k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   483k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 433k, False: 49.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|   433k|            int32_t line_indent = 0;
 3215|   433k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   433k|            auto line_start = it;
 3217|       |
 3218|   821k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 795k, False: 25.6k]
  ------------------
 3219|   795k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 28.5k, False: 767k]
  ------------------
 3220|  28.5k|                  skip_comment(it, end);
 3221|  28.5k|                  skip_newline(it, end);
 3222|  28.5k|                  line_start = it;
 3223|  28.5k|                  line_indent = 0;
 3224|  28.5k|               }
 3225|   767k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 82.5k, False: 684k]
  |  Branch (3225:40): [True: 213k, False: 471k]
  ------------------
 3226|   295k|                  skip_newline(it, end);
 3227|   295k|                  line_start = it;
 3228|   295k|                  line_indent = 0;
 3229|   295k|               }
 3230|   471k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 76.5k, False: 394k]
  ------------------
 3231|  76.5k|                  line_start = it;
 3232|  76.5k|                  line_indent = 0;
 3233|   235k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 234k, False: 1.31k]
  |  Branch (3233:39): [True: 159k, False: 75.1k]
  ------------------
 3234|   159k|                     ++line_indent;
 3235|   159k|                     ++it;
 3236|   159k|                  }
 3237|       |
 3238|  76.5k|                  bool saw_tab = false;
 3239|  82.5k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 80.8k, False: 1.69k]
  |  Branch (3239:40): [True: 1.51k, False: 79.3k]
  |  Branch (3239:54): [True: 4.57k, False: 74.8k]
  ------------------
 3240|  6.08k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 4.22k, False: 1.85k]
  |  Branch (3240:43): [True: 1.85k, False: 0]
  ------------------
 3241|  6.08k|                     ++it;
 3242|  6.08k|                  }
 3243|       |
 3244|  76.5k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 1.69k, False: 74.8k]
  |  Branch (3244:36): [True: 3.14k, False: 71.6k]
  |  Branch (3244:51): [True: 42.9k, False: 28.7k]
  |  Branch (3244:66): [True: 11.1k, False: 17.5k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  58.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 57.2k, False: 1.69k]
  |  Branch (3246:39): [True: 11.1k, False: 46.0k]
  ------------------
 3247|  11.1k|                        skip_comment(it, end);
 3248|  11.1k|                     }
 3249|  58.9k|                     line_indent = 0;
 3250|  58.9k|                     continue;
 3251|  58.9k|                  }
 3252|       |
 3253|  17.5k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 44, False: 17.5k]
  ------------------
 3254|     44|                     ctx.error = error_code::syntax_error;
 3255|     44|                     return;
 3256|     44|                  }
 3257|  17.5k|                  break; // Found content
 3258|  17.5k|               }
 3259|   394k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 4.46k, False: 390k]
  ------------------
 3260|  4.46k|                  line_start = it;
 3261|  12.9k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 12.2k, False: 729]
  |  Branch (3261:40): [True: 1.79k, False: 10.4k]
  |  Branch (3261:54): [True: 6.73k, False: 3.73k]
  ------------------
 3262|  4.46k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 729, False: 3.73k]
  |  Branch (3262:36): [True: 948, False: 2.78k]
  |  Branch (3262:51): [True: 995, False: 1.79k]
  |  Branch (3262:66): [True: 1.71k, False: 80]
  ------------------
 3263|  4.38k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 3.65k, False: 729]
  |  Branch (3263:39): [True: 1.71k, False: 1.94k]
  ------------------
 3264|  1.71k|                        skip_comment(it, end);
 3265|  1.71k|                     }
 3266|  4.38k|                     line_indent = 0;
 3267|  4.38k|                     continue;
 3268|  4.38k|                  }
 3269|     80|                  ctx.error = error_code::syntax_error;
 3270|     80|                  return;
 3271|  4.46k|               }
 3272|   390k|               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|   390k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 120k, False: 269k]
  |  Branch (3276:37): [True: 120k, False: 790]
  ------------------
 3277|   120k|                     line_indent = sequence_indent;
 3278|   120k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   120k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 120k, False: 0]
  |  Branch (3279:49): [True: 118k, False: 2.05k]
  ------------------
 3280|   118k|                           auto probe = it;
 3281|   118k|                           int32_t leading_ws = 0;
 3282|   118k|                           bool saw_tab = false;
 3283|   384k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 383k, False: 305]
  |  Branch (3283:64): [True: 261k, False: 122k]
  |  Branch (3283:87): [True: 4.44k, False: 117k]
  ------------------
 3284|   266k|                              --probe;
 3285|   266k|                              ++leading_ws;
 3286|   266k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 1.41k, False: 264k]
  |  Branch (3286:52): [True: 3.20k, False: 261k]
  ------------------
 3287|   266k|                           }
 3288|   118k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 305, False: 117k]
  |  Branch (3288:61): [True: 25.7k, False: 92.0k]
  |  Branch (3288:85): [True: 27.1k, False: 64.9k]
  ------------------
 3289|  53.2k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 50, False: 53.1k]
  ------------------
 3290|     50|                                 ctx.error = error_code::syntax_error;
 3291|     50|                                 return;
 3292|     50|                              }
 3293|  53.1k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  53.1k|                           }
 3295|   118k|                        }
 3296|   120k|                     }
 3297|   120k|                  }
 3298|   120k|                  break;
 3299|   390k|               }
 3300|   795k|            }
 3301|       |
 3302|   433k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 25.6k, False: 407k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   407k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 3.77k, False: 404k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   404k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 10.6k, False: 393k]
  ------------------
 3309|  10.6k|               it = line_start;
 3310|  10.6k|               return;
 3311|  10.6k|            }
 3312|       |
 3313|   393k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 13.5k, False: 379k]
  ------------------
 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.5k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 18, False: 13.5k]
  ------------------
 3318|     18|                  ctx.error = error_code::syntax_error;
 3319|     18|                  return;
 3320|     18|               }
 3321|       |
 3322|  13.5k|               ++it;
 3323|  13.5k|               auto pending_name = parse_anchor_name(it, end);
 3324|  13.5k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 20, False: 13.4k]
  ------------------
 3325|     20|                  ctx.error = error_code::syntax_error;
 3326|     20|                  return;
 3327|     20|               }
 3328|  13.4k|               skip_inline_ws(it, end);
 3329|  13.4k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 13.3k, False: 157]
  |  Branch (3329:33): [True: 2.05k, False: 11.2k]
  ------------------
 3330|  2.05k|                  skip_comment(it, end);
 3331|  2.05k|               }
 3332|       |
 3333|  13.4k|               has_pending_item_anchor = true;
 3334|  13.4k|               pending_item_anchor_name = std::string(pending_name);
 3335|  13.4k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  13.4k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 168, False: 13.3k]
  |  Branch (3337:34): [True: 7.08k, False: 6.23k]
  |  Branch (3337:49): [True: 121, False: 6.96k]
  ------------------
 3338|    289|                  ctx.error = error_code::syntax_error;
 3339|    289|                  return;
 3340|    289|               }
 3341|       |
 3342|  13.1k|               skip_newline(it, end);
 3343|  13.1k|               continue;
 3344|  13.4k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   379k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 19.6k, False: 360k]
  ------------------
 3348|  19.6k|               it = line_start;
 3349|  19.6k|               return;
 3350|  19.6k|            }
 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|   360k|            dash_col = line_indent;
 3356|   360k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   360k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 360k, False: 50]
  ------------------
 3358|   360k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   360k|               }
 3360|   360k|            }
 3361|       |
 3362|   360k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   360k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 356k, False: 3.41k]
  |  Branch (3365:30): [True: 6.82k, False: 350k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  6.82k|               it = line_start;
 3368|  6.82k|               return;
 3369|  6.82k|            }
 3370|       |
 3371|   353k|            bool saw_tab_after_dash = false;
 3372|   581k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 576k, False: 5.05k]
  |  Branch (3372:34): [True: 194k, False: 381k]
  |  Branch (3372:48): [True: 32.8k, False: 348k]
  ------------------
 3373|   227k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.07k, False: 223k]
  |  Branch (3373:59): [True: 29.1k, False: 194k]
  ------------------
 3374|   227k|               ++it;
 3375|   227k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   353k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 29.1k, False: 324k]
  |  Branch (3377:39): [True: 28.3k, False: 778]
  |  Branch (3377:52): [True: 1.09k, False: 27.3k]
  ------------------
 3378|  1.09k|               const auto after_dash = it + 1;
 3379|  1.09k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 11, False: 1.08k]
  |  Branch (3379:41): [True: 12, False: 1.06k]
  ------------------
 3380|     23|                  ctx.error = error_code::syntax_error;
 3381|     23|                  return;
 3382|     23|               }
 3383|  1.09k|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   353k|            auto parse_element = [&](auto& element) {
 3387|   353k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   353k|               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|   353k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   353k|                     return;
 3397|   353k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   353k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   353k|                  ctx.sequence_item_value_context = true;
 3400|   353k|                  ctx.sequence_dash_indent = dash_col;
 3401|   353k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   353k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   353k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   353k|                  ctx.pop_indent();
 3405|   353k|               }
 3406|   353k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   353k|                  skip_ws_and_comment(it, end);
 3409|   353k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   353k|                  auto nested_start = it;
 3413|   353k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   353k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   353k|                     return;
 3416|   353k|                  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|   353k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   353k|                  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|   353k|                     const int32_t element_indent =
 3428|   353k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   353k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   353k|                        return;
 3431|   353k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   353k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   353k|                     ctx.sequence_item_value_context = true;
 3434|   353k|                     ctx.sequence_dash_indent = dash_col;
 3435|   353k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   353k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   353k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   353k|                     ctx.pop_indent();
 3439|   353k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   353k|               }
 3442|       |
 3443|   353k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   353k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   353k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   353k|                                                                      pending_item_anchor_indent};
 3447|   353k|                  has_pending_item_anchor = false;
 3448|   353k|               }
 3449|   353k|            };
 3450|       |
 3451|   353k|            if constexpr (emplace_backable<V>) {
 3452|   353k|               auto& element = value.emplace_back();
 3453|   353k|               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|   353k|            first_item = false;
 3472|       |
 3473|   353k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 4.00k, False: 349k]
  ------------------
 3474|  4.00k|               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|   353k|         }
 3479|   120k|      }
_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|   353k|            auto parse_element = [&](auto& element) {
 3387|   353k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 348k, False: 5.00k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   353k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 348k, False: 5.00k]
  |  Branch (3390:33): [True: 143k, False: 205k]
  ------------------
 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|   143k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 143k]
  ------------------
 3396|      0|                     return;
 3397|   143k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   143k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   143k|                  ctx.sequence_item_value_context = true;
 3400|   143k|                  ctx.sequence_dash_indent = dash_col;
 3401|   143k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   143k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   143k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   143k|                  ctx.pop_indent();
 3405|   143k|               }
 3406|   210k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   210k|                  skip_ws_and_comment(it, end);
 3409|   210k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   210k|                  auto nested_start = it;
 3413|   210k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   210k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 12, False: 210k]
  ------------------
 3415|     12|                     return;
 3416|   210k|                  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|   210k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 3.80k, False: 206k]
  ------------------
 3422|   210k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 171k, False: 38.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|   171k|                     const int32_t element_indent =
 3428|   171k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 171k]
  ------------------
 3429|   171k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 171k]
  ------------------
 3430|      0|                        return;
 3431|   171k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   171k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   171k|                     ctx.sequence_item_value_context = true;
 3434|   171k|                     ctx.sequence_dash_indent = dash_col;
 3435|   171k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   171k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   171k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   171k|                     ctx.pop_indent();
 3439|   171k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   210k|               }
 3442|       |
 3443|   353k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 4.67k, False: 348k]
  |  Branch (3443:47): [True: 4.37k, False: 302]
  ------------------
 3444|  4.37k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 2.42k, False: 1.95k]
  ------------------
 3445|  4.37k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  4.37k|                                                                      pending_item_anchor_indent};
 3447|  4.37k|                  has_pending_item_anchor = false;
 3448|  4.37k|               }
 3449|   353k|            };
_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|   669k|   {
 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|   669k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5600:11): [True: 338k, False: 331k]
  ------------------
 5601|   338k|         return;
 5602|   338k|      }
 5603|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5604|   331k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5604:11): [True: 24.6k, False: 306k]
  ------------------
 5605|  24.6k|         return;
 5606|  24.6k|      }
 5607|   306k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5608|   306k|   }
_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.39k, False: 96.6k]
  ------------------
 5964|  6.39k|                  return true;
 5965|  6.39k|               }
 5966|  96.6k|               if (*ptr == ':') {
  ------------------
  |  Branch (5966:20): [True: 24.0k, False: 72.6k]
  ------------------
 5967|  24.0k|                  auto next = ptr + 1;
 5968|  24.0k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5968:26): [True: 8.51k, False: 15.4k]
  |  Branch (5968:43): [True: 3.25k, False: 12.2k]
  |  Branch (5968:59): [True: 3.87k, False: 8.35k]
  |  Branch (5968:76): [True: 2.70k, False: 5.65k]
  |  Branch (5968:93): [True: 3.51k, False: 2.14k]
  ------------------
 5969|  24.0k|               }
 5970|  72.6k|               return is_plain_scalar_boundary(*ptr);
 5971|  96.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5888|  72.6k|            auto is_plain_scalar_boundary = [](const char ch) {
 5889|  72.6k|               switch (ch) {
 5890|  1.61k|               case ' ':
  ------------------
  |  Branch (5890:16): [True: 1.61k, False: 71.0k]
  ------------------
 5891|  3.45k|               case '\t':
  ------------------
  |  Branch (5891:16): [True: 1.83k, False: 70.8k]
  ------------------
 5892|  18.5k|               case '\n':
  ------------------
  |  Branch (5892:16): [True: 15.0k, False: 57.6k]
  ------------------
 5893|  61.5k|               case '\r':
  ------------------
  |  Branch (5893:16): [True: 43.0k, False: 29.6k]
  ------------------
 5894|  62.4k|               case ',':
  ------------------
  |  Branch (5894:16): [True: 899, False: 71.7k]
  ------------------
 5895|  63.4k|               case ']':
  ------------------
  |  Branch (5895:16): [True: 932, False: 71.7k]
  ------------------
 5896|  64.2k|               case '}':
  ------------------
  |  Branch (5896:16): [True: 818, False: 71.8k]
  ------------------
 5897|  64.2k|                  return true;
 5898|  8.46k|               default:
  ------------------
  |  Branch (5898:16): [True: 8.46k, False: 64.2k]
  ------------------
 5899|  8.46k|                  return false;
 5900|  72.6k|               }
 5901|  72.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5903|  92.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5904|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5905|       |                  return false;
 5906|       |               }
 5907|  92.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5907:20): [True: 10.0k, False: 82.4k]
  ------------------
 5908|  10.0k|                  return false;
 5909|  10.0k|               }
 5910|  82.4k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5910:20): [True: 4.42k, False: 77.9k]
  |  Branch (5910:40): [True: 62.9k, False: 15.0k]
  |  Branch (5910:61): [True: 20.0k, False: 42.8k]
  ------------------
 5911|  24.5k|                  return false;
 5912|  24.5k|               }
 5913|       |
 5914|  57.8k|               auto look = word_end;
 5915|  57.8k|               yaml::skip_newline(look, end);
 5916|   179k|               while (look != end) {
  ------------------
  |  Branch (5916:23): [True: 158k, False: 21.2k]
  ------------------
 5917|   158k|                  int32_t line_indent = 0;
 5918|   399k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5918:26): [True: 398k, False: 1.04k]
  |  Branch (5918:41): [True: 241k, False: 157k]
  ------------------
 5919|   241k|                     ++line_indent;
 5920|   241k|                     ++look;
 5921|   241k|                  }
 5922|   158k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5922:23): [True: 157k, False: 1.04k]
  |  Branch (5922:38): [True: 2.10k, False: 154k]
  ------------------
 5923|  2.10k|                     return false;
 5924|  2.10k|                  }
 5925|   156k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5925:23): [True: 1.04k, False: 154k]
  |  Branch (5925:38): [True: 96.6k, False: 58.3k]
  |  Branch (5925:55): [True: 13.5k, False: 44.7k]
  ------------------
 5926|   111k|                     if (look != end) {
  ------------------
  |  Branch (5926:26): [True: 110k, False: 1.04k]
  ------------------
 5927|   110k|                        yaml::skip_newline(look, end);
 5928|   110k|                        continue;
 5929|   110k|                     }
 5930|  1.04k|                     return false;
 5931|   111k|                  }
 5932|  44.7k|                  if (*look == '#') {
  ------------------
  |  Branch (5932:23): [True: 12.1k, False: 32.5k]
  ------------------
 5933|  12.1k|                     yaml::skip_comment(look, end);
 5934|  12.1k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5934:26): [True: 11.3k, False: 809]
  |  Branch (5934:42): [True: 5.12k, False: 6.26k]
  |  Branch (5934:59): [True: 6.21k, False: 49]
  ------------------
 5935|  11.3k|                        yaml::skip_newline(look, end);
 5936|  11.3k|                        continue;
 5937|  11.3k|                     }
 5938|    858|                     return false;
 5939|  12.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|  32.5k|                  {
 5945|  32.5k|                     auto scan = look;
 5946|   304k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5946:29): [True: 303k, False: 1.09k]
  |  Branch (5946:44): [True: 288k, False: 15.1k]
  |  Branch (5946:61): [True: 285k, False: 3.39k]
  ------------------
 5947|   285k|                        if (*scan == ':') {
  ------------------
  |  Branch (5947:29): [True: 23.2k, False: 262k]
  ------------------
 5948|  23.2k|                           auto after_colon = scan + 1;
 5949|  23.2k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5949:32): [True: 695, False: 22.5k]
  |  Branch (5949:54): [True: 8.05k, False: 14.4k]
  |  Branch (5949:77): [True: 1.13k, False: 13.3k]
  ------------------
 5950|  13.3k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5950:32): [True: 1.36k, False: 11.9k]
  |  Branch (5950:56): [True: 1.68k, False: 10.3k]
  ------------------
 5951|  12.9k|                              return false;
 5952|  12.9k|                           }
 5953|  23.2k|                        }
 5954|   272k|                        ++scan;
 5955|   272k|                     }
 5956|  32.5k|                  }
 5957|       |
 5958|  19.6k|                  return line_indent > ctx.current_indent();
 5959|  32.5k|               }
 5960|  21.2k|               return false;
 5961|  57.8k|            };
_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|   745k|   {
 5485|   745k|      using counts = yaml_variant_type_count<Variant>;
 5486|       |      if constexpr (counts::n_object == 0) {
 5487|       |         return false;
 5488|       |      }
 5489|   745k|      else {
 5490|       |         // Quick check: if no viable mapping separator in the current span,
 5491|       |         // avoid expensive speculative parse.
 5492|   745k|         const bool could_be_mapping = [&] {
 5493|   745k|            if constexpr (yaml::check_flow_context(Opts)) {
 5494|   745k|               return line_could_be_flow_mapping(it, end);
 5495|   745k|            }
 5496|   745k|            else {
 5497|   745k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   745k|            }
 5499|   745k|         }();
 5500|   745k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5500:14): [True: 330k, False: 414k]
  ------------------
 5501|   330k|            return false;
 5502|   330k|         }
 5503|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5504|   414k|         auto temp_ctx = ctx.make_speculative();
 5505|   414k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5506|   414k|                                                                                               end);
 5507|   414k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5508|   414k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5509|   414k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5509:14): [True: 363k, False: 51.4k]
  ------------------
 5510|   363k|            ctx.anchors = std::move(temp_ctx.anchors);
 5511|   363k|            return true;
 5512|   363k|         }
 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.4k|         ctx.error = temp_ctx.error;
 5517|  51.4k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5518|  51.4k|         return false;
 5519|   414k|      }
 5520|   745k|   }
_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|   745k|         const bool could_be_mapping = [&] {
 5493|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5494|       |               return line_could_be_flow_mapping(it, end);
 5495|       |            }
 5496|   745k|            else {
 5497|   745k|               return yaml::line_could_be_block_mapping(it, end);
 5498|   745k|            }
 5499|   745k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|  1.86k|               auto is_document_start = [&](auto pos) {
  146|  1.86k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 1.06k, False: 800]
  |  Branch (146:41): [True: 470, False: 595]
  |  Branch (146:58): [True: 394, False: 76]
  |  Branch (146:75): [True: 373, False: 21]
  ------------------
  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: 140, False: 222]
  |  Branch (148:62): [True: 147, 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.49k|                  return false;
  152|  1.86k|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6732|  41.1k|   {
 6733|  41.1k|      if (buffer.size() == 0) {
  ------------------
  |  Branch (6733:11): [True: 0, False: 41.1k]
  ------------------
 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|  41.1k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6746|  41.1k|   }

